Create subscription

Creates a subscription or scheduled payment to run at a specified time and frequency.

Headers

requestTokenstringRequired
idempotencyKeystringOptional

Optional but recommended A unique ID that you can include to prevent duplicating objects or transactions in the case that a request is sent more than once. This key isn’t generated in Payabli, you must generate it yourself.

Query parameters

forceCustomerCreationbooleanOptional

When true, the request creates a new customer record, regardless of whether customer identifiers match an existing customer. Defaults to false.

Request

This endpoint expects an object.
customerDataobjectOptional

Object describing the customer/payor.

entryPointstringOptional<=50 characters
The entrypoint identifier.
invoiceDataobjectOptional
Object describing an Invoice linked to the subscription.
paymentDetailsobjectOptional

Object describing details of the payment. To skip the payment, set the totalAmount to 0. Payments will be paused until the amount is updated to a non-zero value. When totalAmount is set to 0, the serviceFee must also be set to 0.

paymentMethodobjectOptional
Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.
scheduleDetailsobjectOptional
Object describing the schedule for subscription.
setPausebooleanOptional

Flag indicating if subscription is paused. When a subscription is paused, no payments are processed until the subscription is unpaused, and the next payment date isn’t calculated automatically. If you want to skip a payment instead, set the totalAmount to 0 in the paymentDetails object.

sourcestringOptional<=100 characters
Custom identifier to indicate the transaction or request source.
subdomainstringOptional<=50 characters
Refers to the payment page identifier. If provided, then the transaction is linked to the payment page.

Response

Success
responseDatainteger
The identifier of the newly created subscription.
customerIdlong or null

The Payabli-generated unique ID for the customer.

responseTextstring or null

Response text for operation: ‘Success’ or ‘Declined’.

isSuccessboolean or null

Boolean indicating whether the operation was successful. A true value indicates success. A false value indicates failure.

Errors