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"
  }
}'
{
  "isSuccess": true,
  "responseText": "Success",
  "responseData": "396",
  "CustomerId": "4440"
}

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.

Example:

"6B29FC40-CA47-1067-B31D-00DD010662DA"

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

A subscription must be linked to a customer, so if you don't include CustomerId, and the identifier fields in customerData don't match an existing customer, then a new customer is created and associated with the subscription.

If you are using a stored payment method, then make sure the storedMethodId passed in the paymentMethod object belongs to the customer provided in customerData.

The body is of type object.

Response

200
application/json

Success