PATCH
/
billing_templates
/
{id}
/
clients
/
{id}
/
curl --request PATCH \
  --url https://gate.chip-in.asia/api/v1/billing_templates/{id}/clients/{id}/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "active"
}'
{
  "type": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_on": 1619740800,
  "updated_on": 1619740800,
  "client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "pending",
  "subscription_billing_scheduled_on": "2020-04-30",
  "payment_method_whitelist": [
    "<string>"
  ],
  "send_invoice_on_charge_failure": true,
  "send_invoice_on_add_subscriber": true,
  "send_receipt": true
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Object ID (UUID)

Body

application/json
client_id
string
required

ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.

status
enum<string>
default: inactive

For subscriptions, you can edit (PATCH /billing_templates/{id}/clients/{id}/) this status between active and subscription_paused values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle a day before the billing date, the next day the invoice will not be issued; but, if you unpause the client a day after the planned billing would have taken place, the planned billing in a month (minus one day) will happen as usual.

Read-only if the BillingTemplateClient is in inactive (internal status not managed through public API) or pending (see documentation for POST /billing_templates/{id}/add_subscriber/) statuses.

Available options:
pending,
inactive,
active,
subscription_paused
payment_method_whitelist
string[]

An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to Purchase.payment_method_whitelist field on created Purchases (see its description).

send_invoice_on_charge_failure
boolean
default: true

Sends invoice when subscription charge fails if this is true

send_invoice_on_add_subscriber
boolean
default: false

Sends invoice when POST /billing_templates/{id}/add_subscriber/ is called if this is true

send_receipt
boolean
default: true

Sends receipt when subscription charge succeeds if this is true

Response

200 - application/json
type
string

Object type identifier

id
string
created_on
integer

Object creation time

updated_on
integer

Object last modification time

client_id
string
required

ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.

status
enum<string>
default: inactive

For subscriptions, you can edit (PATCH /billing_templates/{id}/clients/{id}/) this status between active and subscription_paused values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle a day before the billing date, the next day the invoice will not be issued; but, if you unpause the client a day after the planned billing would have taken place, the planned billing in a month (minus one day) will happen as usual.

Read-only if the BillingTemplateClient is in inactive (internal status not managed through public API) or pending (see documentation for POST /billing_templates/{id}/add_subscriber/) statuses.

Available options:
pending,
inactive,
active,
subscription_paused
subscription_billing_scheduled_on
string

If not null, reports the date when the next billing is scheduled for this client.

payment_method_whitelist
string[]

An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to Purchase.payment_method_whitelist field on created Purchases (see its description).

send_invoice_on_charge_failure
boolean
default: true

Sends invoice when subscription charge fails if this is true

send_invoice_on_add_subscriber
boolean
default: false

Sends invoice when POST /billing_templates/{id}/add_subscriber/ is called if this is true

send_receipt
boolean
default: true

Sends receipt when subscription charge succeeds if this is true