Billing

GET /v1/billing/products

Description

Get all available products.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

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.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

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.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Path Parameters

Param

Type

Required

Description

id

string

yes

ID of the payment method you want to update

Body Parameters

Param

Type

Required

Description

card_id

string

yes

ID of the payment method (card) you are updating

card_exp_month

no

Updated card expiration month

card_exp_year

no

Updated card expiration year

billing_details

object

no

Object containing one or more updated fields

⌞ name

string

no

Name on the card

⌞ city

string

no

Billing city

⌞ country

string

no

Billing country

⌞ line1

string

no

Billing address line 1

⌞ line2

string

no

Billing address line 2

⌞ postal_code

int

no

Billing zip code

⌞ state

string

no

Billing state

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.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

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.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Path Parameters

Param

Type

Required

Description

id

uuid

yes

ID of the source you want to delete

Example Response

{
  "message":"successfully deleted payment method"
}

PUT /v1/billing/subscription

Description

Update subscription.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Body Parameters

Param

Type

Required

Description

TODO

uuid

yes

ID of the source you want to fetch

Example Response

{}

GET /v1/billing/subscription

Description

Get current subscription.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Example Response

{}

GET /v1/billing/invoice/upcoming

Description

Get upcoming invoice.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Example Response

{}

GET /v1/billing/invoice/history

Description

Get invoice history.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Example Response

{}

POST /v1/billing/addon

Description

Update used addons.

Header Parameters

Param

Type

Required

Description

Authorization

string

yes

Bearer token containing API key

Body Parameters

Param

Type

Required

Description

addons

array

yes

array containing one or more addon objects

- product_id

string

yes

ID of the addon you want to update

- quantity

int

yes

Update subscription to contain this many addons

Example Response

{
  "created": 1,
  "updated": 1,
  "deleted": 0
}

Last updated