Billing APIs

Introduction
Billing API is a RESTful API that allows setting up customers, collecting payments and maintaining balances for these customers, as well as creating recurring billing subscriptions.

Billing API documentation includes the following sections:

Objects - lists all recurring billing objects. The purpose of this section is to describe all object fields, their format and usage, provide the links to the corresponding database tables.

Type Enumerations – lists possible values that can be used in the respective fields within Billing API requests and responses. The purpose of this section is to provide an explanation of all enumerations used for API calls.

Actions - lists all actions that can be performed with key recurring billing objects. The purpose of this section is to describe the methods and format of API requests and the format of responses.

Integration Notes – lists integration notes associated with the Billing API objects and actions. The purpose of this section is to provide explicit information about the peculiarities of specific actions and object fields.

Code samples - provides examples of recurring billing use cases (creating billing plans, subscriptions, freeing or canceling subscriptions, reversing transactions, etc) and their implementation in JSON, XML formats. The purpose of this section is to provide examples that can be used for testing of the integration with the gateway.

To learn how to work with the Billing API, we recommend reviewing the integration notes first. Key recurring billing module terms are available here. For more detailed information about the recurring billing configurations and management, check the Recurring Billing Guide.

Base Resource URL:

https://[server-name]/api/v01/customers/[customer-id]/[subscriptions]

Description:

Allows to manage the subscriptions associated with the specified customer.

Supported sub-resources:

Resource URL Description
https://[server-name]/api/v01/customers/[customer-id]/[subscriptions]/[subscription-id] Allows to manage the specified subscription.

Supported Actions:

~create (request)

Method:  PUT
Implicit:  Yes
Returns:  Subscription
Consumes:  json,xml
Produces:  json,xml

Creates a subscription.
Path Parameters:
# Name Type Pattern Format Mode Usage Description
1 customer-id Long O Unique Customer ID generated by the system.
For more information see term: Customer.
Body Parameters:
# Name Type Pattern Format Mode Usage Description
2 firstInvoicingDate Date O Date when the invoicing will occur for the first time.
For more information see integration notes.
3 nextInvoicingDate Date O
4 taxAmount Integer O Tax amount (in cents) that will be associated with the transaction processing.
6 billingCycleType Enum C O Type of billing cycle to be used.
For more information see Billing Cycle Classifier.
7 code String(60) CODE C O Unique Subscription ID supplied by external/user's system.
Note: Optional secondary identifier. Typically this field is a reference to an ID in your own system to cross-reference it within our system. If not provided, the system will use the object 'id' generated at the time of object creation.
For more information see Reference Field Type.
9 firstBillingDate Date C R Date when the first billing will occur.
For more information see integration notes.
13 pendingAdjustmentEffectiveDate Date O Date when the pending adjustment for the Subscription will become effective.
15 pendingAdjustmentNote String(255) TEXT R Any additional details will be associated with the pending adjustment for the Subscription.
16 planId Reference C O Reference to a Plan that a Subscription will be associated with.
Note: Reference to the Plan that the Customer is subscribing.
19 accountId Integer O
20 amount Integer O
22 customerId Long O
23 firstBillingDate Date C R
26 length Integer C O
Length parameter is required for Fixed Subscriptions and cannot exceed 3 years. For subscriptions longer than 3 years, use Perpetual Subscription type, which does not require length parameter. Length maximum value correlated with the selected billingCycleType:
  • annually - 3,
  • semi-annually - 6,
  • quarterly - 12,
  • monthly - 36,
  • weekly - 153.
27 nextBillingDate Date O The date must be submitted in yyyy-MM-dd format.
28 note String(255) TEXT O
29 paymentOptionId Reference R
30 planId Reference O Identifier of the associated payment plan.
32 type Enum C O
33 billingCycleType Enum C O Type of the applied billing cycle.
34 pendingAdjustmentEffectiveDate Date O Effective date of the pending payment plan adjustment. The date must be submitted in yyyy-MM-dd format.
35 pendingAdjustmentNote String(255) TEXT R Note associated with the pending payment plan adjustment.
37 code String(60) CODE C O
39 nextInvoicingDate Date O
40 firstInvoicingDate Date O
41 taxAmount Integer O

~create (response)

Method:  PUT
Implicit:  Yes
Returns:  Subscription
Consumes:  json,xml
Produces:  json,xml

Creates a subscription.
Body Parameters:
# Name Type Pattern Format Mode Usage Description
1 pendingAdjustmentType Enum R O Type of the pending payment plan adjustment.
2 firstInvoicingDate Date O Date when the invoicing will occur for the first time, used for filtering records.
3 nextInvoicingDate Date O
4 taxAmount Integer O Tax amount used for filtering records.
5 planName String(255) R O Name of the plan.
6 billingCycleType Enum C O Type of a billing cycle used for filtering records.
7 code String(60) CODE C O Unique Subscription ID supplied by external/user's system used for filtering records.
8 createDate Datetime R O Date when the Subscription was created.
Note: Date format: yyyy-MM-dd.
9 firstBillingDate Date C R Date used for filtering Subscription records.
10 id Long R O Unique Subscription ID generated by the system.
11 lastBillingDate Date R O Date when the last billing occured.
12 lastUpdateDate Datetime R O Date when the last update was made to the Subscription.
13 pendingAdjustmentEffectiveDate Date O Date used for filtering Subscription records.
14 pendingAdjustmentLength Integer R O Number of times that the pending adjustment for the Subscription will generate an invoice.
15 pendingAdjustmentNote String(255) TEXT R Any additional details associated with the pending adjustment for the Subscription used for filtering Subscription records.
16 planId Reference C O Reference to a Plan used for filtering Subscription records.
17 status Enum R O Status of the record in the system.
For more information see Payment Plan Status.
18 id Long R O
19 accountId Integer O
20 amount Integer O
21 createDate Datetime R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
22 customerId Long O
23 firstBillingDate Date C R
24 lastBillingDate Date R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
25 lastUpdateDate Datetime R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
26 length Integer C O
Length parameter is required for Fixed Subscriptions and cannot exceed 3 years. For subscriptions longer than 3 years, use Perpetual Subscription type, which does not require length parameter. Length maximum value correlated with the selected billingCycleType:
  • annually - 3,
  • semi-annually - 6,
  • quarterly - 12,
  • monthly - 36,
  • weekly - 153.
27 nextBillingDate Date O The date must be submitted in yyyy-MM-dd format.
28 note String(255) TEXT O
29 paymentOptionId Reference R
30 planId Reference O Identifier of the associated payment plan.
31 status Enum R O
32 type Enum C O
33 billingCycleType Enum C O Type of the applied billing cycle.
34 pendingAdjustmentEffectiveDate Date O Effective date of the pending payment plan adjustment. The date must be submitted in yyyy-MM-dd format.
35 pendingAdjustmentNote String(255) TEXT R Note associated with the pending payment plan adjustment.
36 pendingAdjustmentLength Integer R O Length of the pending payment plan adjustment.
37 code String(60) CODE C O
38 planName String R O Name of the associated payment plan.
39 nextInvoicingDate Date O
40 firstInvoicingDate Date O
41 taxAmount Integer O

~find (request)

Method:  GET
Implicit:  Yes
Consumes:  xurl
Produces:  json,xml

Returns a list of available subscriptions.
Path Parameters:
# Name Type Pattern Format Mode Usage Description
1 customer-id Long O Unique Customer ID generated by the system.
For more information see term: Customer.
Body Parameters:
# Name Type Pattern Format Mode Usage Description
1 offset Integer O Index of the first record returned to the customer from the search result of a web search.
2 limit Integer O Maximum number of records to load per single search web call made by the customer.
3 planId Integer O Plan ID used for filtering Subscription records.
4 status String O Status of the Subscription used for filtering Subscription records.
5 billingCycleType String O Type of a Billing Cycle used for filtering Subscription records.
6 createDateFrom Date O The beginning date for filtering Subscription records; only records dated from this specific day onwards are included.
7 createDateTo Date O The concluding date for filtering Subscription records; only records up to and through this specified date are included.
8 lastBillingDateFrom Date O The beginning date of the last billing date range for filtering billing records; only records dated from this specified day onwards are included.
9 lastBillingDateTo Date O The concluding date of the last billing date range for filtering billing records; only records up to and through this specified date are included.
10 nextBillingDateFrom Date O The beginning date of the next billing date range for filtering upcoming billing records; only future records dated from this specified day onwards are included.
11 nextBillingDateTo Date O The concluding date of the next billing date range for filtering upcoming billing records; only future records up to and through this specified date are included.
12 amountFrom Integer O The lower amount limit for filtering Subscription records; only those with values at or above this specified amount are included.
13 amountTo Integer O The upper amount limit for filtering Subscription records; only those with values up to and through this specified amount are included.
14 type String O Type of the Subscription used for filtering Subscription records.
15 name String O Name of the Subscription used for filtering Subscription records.

~find (response)

Method:  GET
Implicit:  Yes
Consumes:  xurl
Produces:  json,xml

Returns a list of available subscriptions.
Body Parameters:
# Name Type Pattern Format Mode Usage Description
1 pendingAdjustmentType Enum R O Type of the pending payment plan adjustment.
2 firstInvoicingDate Date O Date when the invoicing will occur for the first time.
For more information see integration notes.
3 nextInvoicingDate Date O
4 taxAmount Integer O Tax amount (in cents) associated with the transaction processing.
5 planName String(255) R O Name of the plan.
6 billingCycleType Enum C O Type of billing cycle used.
For more information see Billing Cycle Classifier.
7 code String(60) CODE C O Unique Subscription ID supplied by external/user's system.
Note: Optional secondary identifier. Typically this field is a reference to an ID in your own system to cross-reference it within our system. If not provided, the system will use the object 'id' generated at the time of object creation.
For more information see Reference Field Type.
8 createDate Datetime R O Date when the Subscription was created.
Note: Date format: yyyy-MM-dd.
9 firstBillingDate Date C R Date when the first billing occured.
For more information see integration notes.
10 id Long R O Unique Subscription ID generated by the system.
11 lastBillingDate Date R O Date when the last billing occured.
12 lastUpdateDate Datetime R O Date when the last update was made to the Subscription.
13 pendingAdjustmentEffectiveDate Date O Date when the pending adjustment for the Subscription become effective.
14 pendingAdjustmentLength Integer R O Number of times that the pending adjustment for the Subscription will generate an invoice.
15 pendingAdjustmentNote String(255) TEXT R Any additional details associated with the pending adjustment for the Subscription.
16 planId Reference C O Reference to a Plan that a Subscription is associated with.
Note: Reference to the Plan that the Customer is subscribing.
17 status Enum R O Status of the record in the system.
For more information see Payment Plan Status.
18 id Long R O
19 accountId Integer O
20 amount Integer O
21 createDate Datetime R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
22 customerId Long O
23 firstBillingDate Date C R
24 lastBillingDate Date R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
25 lastUpdateDate Datetime R O In API request, the date must be submitted in yyyy-MM-dd format.
In API response, the date is returned in yyyy-MM-dd HH:mm:ss format.
26 length Integer C O
Length parameter is required for Fixed Subscriptions and cannot exceed 3 years. For subscriptions longer than 3 years, use Perpetual Subscription type, which does not require length parameter. Length maximum value correlated with the selected billingCycleType:
  • annually - 3,
  • semi-annually - 6,
  • quarterly - 12,
  • monthly - 36,
  • weekly - 153.
27 nextBillingDate Date O The date must be submitted in yyyy-MM-dd format.
28 note String(255) TEXT O
29 paymentOptionId Reference R
30 planId Reference O Identifier of the associated payment plan.
31 status Enum R O
32 type Enum C O
33 billingCycleType Enum C O Type of the applied billing cycle.
34 pendingAdjustmentEffectiveDate Date O Effective date of the pending payment plan adjustment. The date must be submitted in yyyy-MM-dd format.
35 pendingAdjustmentNote String(255) TEXT R Note associated with the pending payment plan adjustment.
36 pendingAdjustmentLength Integer R O Length of the pending payment plan adjustment.
37 code String(60) CODE C O
38 planName String R O Name of the associated payment plan.
39 nextInvoicingDate Date O
40 firstInvoicingDate Date O
41 taxAmount Integer O