GET /v1/billing/products
Description
Get all available products.
Example Response
{
"plans":[
{
"product_id":"prod_J2M8Yy44PsRsoZ",
"name":"Team",
"price":50000,
"price_id":"price_1IQHPvDoAelPEtRKMXDNXCAA",
"currency":"usd",
"base_value":0,
"attributes":{
"num_sources":5,
"num_collections":10,
"storage_gb":500,
"replay_gb":500,
"trial_available":false,
"trial_length_days":30
}
},
{
"product_id":"prod_J2M7C8Zgv9Ux42",
"name":"Personal",
"price":2000,
"price_id":"price_1IQHPZDoAelPEtRKT8tubp4t",
"currency":"usd",
"base_value":0,
"attributes":{
"num_sources":1,
"num_collections":1,
"storage_gb":10,
"replay_gb":10,
"trial_available":true,
"trial_length_days":14
}
},
{
"product_id":"prod_J2M8a2MYh1irDP",
"name":"Pro",
"price":10000,
"price_id":"price_1IQHPpDoAelPEtRKG8Msdaa2",
"currency":"usd",
"base_value":0,
"attributes":{
"num_sources":3,
"num_collections":3,
"storage_gb":100,
"replay_gb":100,
"trial_available":false,
"trial_length_days":30
}
}
],
"addons":[
{
"product_id":"prod_J2M8e17JvpNKvw",
"name":"Add-on: Replay",
"price":500,
"price_id":"price_1IQHQGDoAelPEtRK8WftMyA6",
"currency":"usd",
"base_value":0
},
{
"product_id":"prod_J2M8Q4ydjUnteb",
"name":"Add-on: Collection",
"price":1000,
"price_id":"price_1IQHQKDoAelPEtRKFGqd07CB",
"currency":"usd",
"base_value":0
},
{
"product_id":"prod_JjPGScLp2jTLpe",
"name":"Add-on: Hosted Plumber Source",
"price":5000,
"price_id":"price_1J5wRtDoAelPEtRKcFcGSajZ",
"currency":"usd",
"base_value":0
},
{
"product_id":"prod_J2M8qTgNQ4cVW4",
"name":"Add-on: Storage",
"price":500,
"price_id":"price_1IQHQCDoAelPEtRKFNJ50PzP",
"currency":"usd",
"base_value":0
}
]
}
GET /v1/billing/payment
Description
Get added payment methods.
Example Response
[
{
"id":"pm_1IV3aCDoAelPEtRKg21R1a1i",
"brand":"visa",
"exp_month":4,
"exp_year":2024,
"fingerprint":"2pgisdQqqgiQSldH",
"last4":"4242",
"billing_details":{
"name":"",
"city":"",
"country":"",
"line1":"",
"line2":"",
"postal_code":"42424",
"state":""
},
"default":true,
"customer_id":"cus_J7I9QVCOmJPUU6"
}
]
PUT /v1/billing/payment/{id}
Description
Update a payment method's expiration and billing zipcode.
Path Parameters
Body Parameters
Example Response
{
"id":"pm_1IV3aCDoAelPEtRKg21R1a1i",
"brand":"visa",
"exp_month":4,
"exp_year":2024,
"fingerprint":"2pgisdQqqgiQSldH",
"last4":"4242",
"billing_details":{
"name":"",
"city":"",
"country":"",
"line1":"",
"line2":"",
"postal_code":"42424",
"state":""
},
"default":false,
"customer_id":"cus_J7I9QVCOmJPUU6"
}
POST /v1/billing/payment
Description
Attach a payment method to a customer ID.
Body Parameters
{
"id":"pm_1J5zrFDoAelPEtRKqaMijdQj",
"object":"payment_method",
"billing_details":{
"address":{
"city":null,
"country":null,
"line1":null,
"line2":null,
"postal_code":"42424",
"state":null
},
"email":null,
"name":null,
"phone":null
},
"card":{
"brand":"visa",
"checks":{
"address_line1_check":null,
"address_postal_code_check":null,
"cvc_check":null
},
"country":"US",
"exp_month":4,
"exp_year":2024,
"funding":"credit",
"generated_from":null,
"last4":"4242",
"networks":{
"available":[
"visa"
],
"preferred":null
},
"three_d_secure_usage":{
"supported":true
},
"wallet":null
},
"created":1624569190,
"customer":null,
"livemode":false,
"type":"card"
}
Example Response
{
"id":"pm_1J5zrFDoAelPEtRKqaMijdQj",
"brand":"visa",
"exp_month":4,
"exp_year":2024,
"fingerprint":"2pgisdQqqgiQSldH",
"last4":"4242",
"billing_details":{
"name":"",
"city":"",
"country":"",
"line1":"",
"line2":"",
"postal_code":"42424",
"state":""
},
"default":false,
"customer_id":"cus_J7I9QVCOmJPUU6"
}
DELETE /v1/billing/payment/{id}
Description
Delete an existing payment method.
Path Parameters
Example Response
{
"message":"successfully deleted payment method"
}
PUT /v1/billing/subscription
Description
Update subscription.
Body Parameters
Example Response
GET /v1/billing/subscription
Description
Get current subscription.
Example Response
GET /v1/billing/invoice/upcoming
Description
Get upcoming invoice.
Example Response
GET /v1/billing/invoice/history
Description
Get invoice history.
Example Response
POST /v1/billing/addon
Description
Update used addons.
Body Parameters
Example Response
{
"created": 1,
"updated": 1,
"deleted": 0
}