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.

Subscription

Type:  
Abstract:  no
Status:  Active
Java Class:  PaymentPlan
Information about the subscription transaction.

Available Fields:

# Name Type Pattern Format Mode Usage Description
1 pendingAdjustmentType Enum R O Type of scheduled change to be applied to this subscription.\n\r\n> **Note:** This field is only included if a future adjustment has been scheduled.\n\r\n> **Tip:** Common values include F (Freeze), C (Cancel), or P (Pause).
2 firstInvoicingDate Date O Date when the first invoice will be generated for this subscription.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if invoicing is configured separately from billing.
3 nextInvoicingDate Date O Date when the next invoice will be generated for this subscription.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if relevant to the subscription's current state.
4 taxAmount Integer O Tax amount (in cents) that will be applied to each billing cycle.\n\r\n> **Note:** This field is only included if tax calculation is enabled for this subscription.
5 planName String(255) R O Name of the payment plan associated with this subscription.\n\r\n> **Note:** This value is derived from the referenced planId and provides a human-readable identifier.
6 billingCycleType Enum C O Frequency at which the customer will be billed for this subscription.\n\r\n> **Note:** Common values include M (Monthly), A (Annual), Q (Quarterly), etc.
7 code String(60) CODE C O Secondary identifier for the subscription that references an ID in your own system.\n\r\n> **Note:** If you didn't provide a value in the request, this will be set to the same value as the id field.\n\r\n> **Tip:** Use this field to cross-reference subscriptions between systems.
8 createDate Datetime R O Date and time when the subscription was created in the system.\n\r\n> **Note:** This value is returned in yyyy-MM-dd HH:mm:ss format.
9 firstBillingDate Date C R Date when the first billing for this subscription will occur.\n\r\n> **Note:** Format must be yyyy-MM-dd. This date establishes the billing cycle start date.
10 id Long R O System-generated unique identifier for the newly created subscription.\n\r\n> **Note:** Use this identifier in subsequent API calls when referencing this subscription.\n\r\n> **Tip:** Store this value in your system for future subscription management operations.
11 lastBillingDate Date R O Final date when billing will occur for this subscription.\n\r\n> **Note:** This field is only included for subscriptions with type=F (Fixed). Format must be yyyy-MM-dd.
12 lastUpdateDate Datetime R O Date and time when the subscription was last modified.\n\r\n> **Note:** This value is returned in yyyy-MM-dd HH:mm:ss format. Matches createDate for newly created subscriptions.
13 pendingAdjustmentEffectiveDate Date O Date when the scheduled change will take effect.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if pendingAdjustmentType is present.
14 pendingAdjustmentLength Integer R O Number of billing cycles for which the adjustment will apply.\n\r\n> **Note:** This field is only included if pendingAdjustmentType is F (Freeze).
15 pendingAdjustmentNote String(255) TEXT R Additional information about the scheduled adjustment.\n\r\n> **Note:** This field is only included if pendingAdjustmentType is present.
16 planId Reference C O Reference to the payment plan this subscription is based on.\n\r\n> **Note:** The plan defines the base pricing and billing terms for this subscription.
17 status Enum R O Current status of the subscription in the system.\n\r\n> **Note:** For new subscriptions, this is typically set to "Current" or "Unbilled" depending on the billing schedule.
18 id Long R O System-generated unique identifier for the newly created subscription.\n\r\n> **Note:** Use this identifier in subsequent API calls when referencing this subscription.\n\r\n> **Tip:** Store this value in your system for future subscription management operations.
19 accountId Integer O Identifier of the merchant account under which this subscription was created.\n\r\n> **Note:** This indicates which merchant account is managing this subscription.
20 amount Integer O Amount (in cents) that will be charged for each billing cycle of this subscription.\n\r\n> **Note:** For example, $10.00 would be represented as 1000.
21 createDate Datetime R O Date and time when the subscription was created in the system.\n\r\n> **Note:** This value is returned in yyyy-MM-dd HH:mm:ss format.
22 customerId Long O Identifier of the customer for whom the subscription is being created.\n\r\n> **Tip:** Use this to retrieve customer details or to group all subscriptions for a particular customer.
23 firstBillingDate Date C R Date when the first billing for this subscription will occur.\n\r\n> **Note:** Format must be yyyy-MM-dd. This date establishes the billing cycle start date.
24 lastBillingDate Date R O Final date when billing will occur for this subscription.\n\r\n> **Note:** This field is only included for subscriptions with type=F (Fixed). Format must be yyyy-MM-dd.
25 lastUpdateDate Datetime R O Date and time when the subscription was last modified.\n\r\n> **Note:** This value is returned in yyyy-MM-dd HH:mm:ss format. Matches createDate for newly created subscriptions.
26 length Integer C O Number of billing cycles for which the subscription will be active.\n\r\n> **Note:** This field is only included for subscriptions with type=F (Fixed). The maximum value depends on the billingCycleType: A (Annual) - 3, S (Semi-annual) - 6, Q (Quarterly) - 12, M (Monthly) - 36, W (Weekly) - 153.
27 nextBillingDate Date O Date when the next billing will occur for this subscription.\n\r\n> **Note:** Format must be yyyy-MM-dd. This value is automatically calculated based on the billing cycle and the firstBillingDate.
28 note String(255) TEXT O Additional information or comments about this subscription.\n\r\n> **Note:** This field is only included if a note was provided in the request.
29 paymentOptionId Reference R Reference to the customer's payment method that will be used to collect subscription payments.\n\r\n> **Note:** This is the payment method that will be charged according to the subscription schedule.
30 planId Reference O Reference to the payment plan this subscription is based on.\n\r\n> **Note:** The plan defines the base pricing and billing terms for this subscription.
31 status Enum R O Current status of the subscription in the system.\n\r\n> **Note:** For new subscriptions, this is typically set to "Current" or "Unbilled" depending on the billing schedule.
32 type Enum C O Type of subscription - either fixed-term or perpetual (ongoing).\n\r\n> **Note:** F (Fixed) indicates a subscription with a defined end date, while P (Perpetual) indicates an ongoing subscription.
33 billingCycleType Enum C O Frequency at which the customer will be billed for this subscription.\n\r\n> **Note:** Common values include M (Monthly), A (Annual), Q (Quarterly), etc.
34 pendingAdjustmentEffectiveDate Date O Date when the scheduled change will take effect.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if pendingAdjustmentType is present.
35 pendingAdjustmentNote String(255) TEXT R Additional information about the scheduled adjustment.\n\r\n> **Note:** This field is only included if pendingAdjustmentType is present.
36 pendingAdjustmentLength Integer R O Number of billing cycles for which the adjustment will apply.\n\r\n> **Note:** This field is only included if pendingAdjustmentType is F (Freeze).
37 code String(60) CODE C O Secondary identifier for the subscription that references an ID in your own system.\n\r\n> **Note:** If you didn't provide a value in the request, this will be set to the same value as the id field.\n\r\n> **Tip:** Use this field to cross-reference subscriptions between systems.
38 planName String R O Name of the payment plan associated with this subscription.\n\r\n> **Note:** This value is derived from the referenced planId and provides a human-readable identifier.
39 nextInvoicingDate Date O Date when the next invoice will be generated for this subscription.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if relevant to the subscription's current state.
40 firstInvoicingDate Date O Date when the first invoice will be generated for this subscription.\n\r\n> **Note:** Format must be yyyy-MM-dd. This field is only included if invoicing is configured separately from billing.
41 taxAmount Integer O Tax amount (in cents) that will be applied to each billing cycle.\n\r\n> **Note:** This field is only included if tax calculation is enabled for this subscription.
42 planName String NAME O Name of the payment plan associated with this subscription.\n\r\n> **Note:** This value is derived from the referenced planId and provides a human-readable identifier.

XML Sample:

<subscription
    pendingAdjustmentType="" 
    firstInvoicingDate="" 
    nextInvoicingDate="" 
    taxAmount="" 
    planName="" 
    billingCycleType="" 
    code="" 
    createDate="" 
    firstBillingDate="" 
    id="" 
    lastBillingDate="" 
    lastUpdateDate="" 
    pendingAdjustmentEffectiveDate="" 
    pendingAdjustmentLength="" 
    pendingAdjustmentNote="" 
    planId="" 
    status="" 
    id="" 
    accountId="" 
    amount="" 
    createDate="" 
    customerId="" 
    firstBillingDate="" 
    lastBillingDate="" 
    lastUpdateDate="" 
    length="" 
    nextBillingDate="" 
    note="" 
    paymentOptionId="" 
    planId="" 
    status="" 
    type="" 
    billingCycleType="" 
    pendingAdjustmentEffectiveDate="" 
    pendingAdjustmentNote="" 
    pendingAdjustmentLength="" 
    code="" 
    planName="" 
    nextInvoicingDate="" 
    firstInvoicingDate="" 
    taxAmount="" 
    planName="" />

JSON Sample:

{
  "pendingAdjustmentType": "",
  "firstInvoicingDate": "",
  "nextInvoicingDate": "",
  "taxAmount": "",
  "planName": "",
  "billingCycleType": "",
  "code": "",
  "createDate": "",
  "firstBillingDate": "",
  "id": "",
  "lastBillingDate": "",
  "lastUpdateDate": "",
  "pendingAdjustmentEffectiveDate": "",
  "pendingAdjustmentLength": "",
  "pendingAdjustmentNote": "",
  "planId": "",
  "status": "",
  "accountId": "",
  "amount": "",
  "customerId": "",
  "length": "",
  "nextBillingDate": "",
  "note": "",
  "paymentOptionId": "",
  "type": ""
}

XURL Sample:

?pendingAdjustmentType=&firstInvoicingDate=&nextInvoicingDate=&taxAmount=&planName=&billingCycleType=&code=&createDate=&firstBillingDate=&id=&lastBillingDate=&lastUpdateDate=&pendingAdjustmentEffectiveDate=&pendingAdjustmentLength=&pendingAdjustmentNote=&planId=&status=&id=&accountId=&amount=&createDate=&customerId=&firstBillingDate=&lastBillingDate=&lastUpdateDate=&length=&nextBillingDate=&note=&paymentOptionId=&planId=&status=&type=&billingCycleType=&pendingAdjustmentEffectiveDate=&pendingAdjustmentNote=&pendingAdjustmentLength=&code=&planName=&nextInvoicingDate=&firstInvoicingDate=&taxAmount=&planName=&
pendingAdjustmentType=
firstInvoicingDate=
nextInvoicingDate=
taxAmount=
planName=
billingCycleType=
code=
createDate=
firstBillingDate=
id=
lastBillingDate=
lastUpdateDate=
pendingAdjustmentEffectiveDate=
pendingAdjustmentLength=
pendingAdjustmentNote=
planId=
status=
id=
accountId=
amount=
createDate=
customerId=
firstBillingDate=
lastBillingDate=
lastUpdateDate=
length=
nextBillingDate=
note=
paymentOptionId=
planId=
status=
type=
billingCycleType=
pendingAdjustmentEffectiveDate=
pendingAdjustmentNote=
pendingAdjustmentLength=
code=
planName=
nextInvoicingDate=
firstInvoicingDate=
taxAmount=
planName=