Subscription

Create Subscription

Creates a subscription or scheduled payment to run at a specified time and frequency. You can use stored payment method tokens for card, ACH, and digital wallets by passing them into the paymentMethod.storedMethodId field.

post/Subscription/add

Request

  • Base URL: https://api-sandbox.payabli.com/api
  • URL: https://api-sandbox.payabli.com/api/Subscription/add
  • Auth: HTTP bearer

Query parameters

forceCustomerCreationboolean

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

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

Headers

idempotencyKeystring

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. The key persists for 2 minutes. After 2 minutes, you can reuse the key if needed.

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. This key persists for 2 minutes. After 2 minutes, you can reuse the key if needed.

Request body

entryPointstring

The entrypoint identifier.

setPauseboolean

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.

sourcestring

Custom identifier to indicate the transaction or request source.

subdomainstring

Refers to the payment page identifier. If provided, then the transaction is linked to the payment page.

subscriptionType'Regular' | 'BalanceDriven'

Subscription type or category. Can't be changed after the subscription is created; if sent to the update endpoint, it's ignored.

  • Regular: A standard recurring subscription that charges a fixed amount each cycle.
  • BalanceDriven: A subscription that charges the payor's outstanding balance at run time instead of a fixed amount. Each scheduled run reads the live balance and charges that amount; a zero balance is skipped, not charged. BalanceDriven subscriptions only accept the firstofmonth, fifteenthofmonth, and endofmonth frequencies, ignore any startDate and endDate you supply (start date is calculated from frequency; the schedule runs until cancelled), and don't store a static totalAmount on the schedule.

Response

Success

customerIdinteger

The Payabli-generated unique ID for the customer.

responseTextstring required

Response text for operation: 'Success' or 'Declined'.

isSuccessboolean

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

responseDatainteger required

The identifier of the newly created subscription.

Changes

No recorded changes to this operation across all 1 revision of this API.