POST
/
Subscription
/
add
curl --request POST \
  --url https://api-sandbox.payabli.com/api/Subscription/add \
  --header 'Content-Type: application/json' \
  --header 'requestToken: <api-key>' \
  --data '{
  "entryPoint": "f743aed24a",
  "paymentMethod": {
    "initiator": "payor",
    "cardHolder": "John Cassian",
    "cardzip": "12345",
    "cardcvv": "123",
    "cardexp": "02/25",
    "cardnumber": "4111111111111111",
    "method": "card"
  },
  "paymentDetails": {
    "totalAmount": 100,
    "serviceFee": 0
  },
  "customerData": {
    "customerId": 4440
  },
  "scheduleDetails": {
    "planId": 1,
    "startDate": "09-20-2024",
    "endDate": "03-20-2025",
    "frequency": "weekly"
  }
}'

Authorizations

requestToken
string
header
required

Most endpoints require an organization token. Some endpoints require an application token, and those endpoints are noted.

Headers

idempotencyKey
string

A unique ID you can include to prevent duplicating objects or transactions if a request is sent more than once. This key is not generated in Payabli, you must generate it yourself.

Query Parameters

forceCustomerCreation
boolean
default:
false

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

Body

entryPoint
string | null
required

The entrypoint identifier.

Maximum length: 50
customerData
object

Object describing the customer/payor.

invoiceData
object

Object describing an Invoice linked to the subscription.

paymentDetails
object

Object describing details of the payment.

paymentMethod
object

Information about the payment method for the transaction. Required and recommended fields for each payment method type are described in each schema below.

scheduleDetails
object

Object describing the schedule for subscription.

setPause
boolean

Flag indicating if subscription is paused.

source
string | null

Custom identifier to indicate the transaction or request source.

Maximum length: 100
subdomain
string | null

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

Maximum length: 50

Response

200 - application/json
CustomerId
integer | null

Payabli-generated unique ID of the customer the subscription belongs to.

isSuccess
boolean

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

responseData
object | null

If isSuccess = true, this contains the identifier of the subscription.

If isSuccess = false, this contains the reason for the failure."

responseText
string | null

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