Manage subscriptions with the API

Learn how to create, update, and delete your scheduled, subscription, and autopay transactions with the Payabli API

Applies to:Developers

Subscriptions, also known as recurring transactions, autopays, or scheduled payments, are a powerful way to automate billing and payment collection. With Payabli’s API, you can manage these transactions, including creating, updating, and deleting subscriptions.

This guide covers the key operations for managing subscriptions through the API.

Considerations

When working with subscriptions, keep the following in mind:

  • Payabli automatically tokenizes payment information and assigns stored payment methods to the provided customer.
  • Subscriptions are always linked to a customer - if no customerId is provided and the customerData fields don’t match an existing customer, a new customer is created.
  • Best practice is to create the customer first and pass the customerId in the customerData object.
  • When using a stored payment method, ensure the storedId in paymentMethod corresponds to the customer in customerData.
  • Subscription and autopay transactions typically run between 2:30 AM and 3:30 AM Eastern time.
  • If a subscription payment is declined, you can update the subscription and retry the payment. See Subscription retry logic for more information. Payabli doesn’t retry failed autopays.
  • If you pass an invoiceData object to a subscription, the payments in the subscription are automatically added to the invoice as they’re processed.

Pause a subscription or skip a payment

Pausing a subscription stops all future payments until the subscription is unpaused. Skipping payments allows the subscription to continue but skips the next scheduled payment.

To skip a payment, update the subscription’s totalAmount to 0. To resume payments, update totalAmount to a non-zero amount. Note that if totalAmount is set to 0, then serviceFee must also be set to 0.

To pause a subscription, send a PUT request to /api/Subscription/\{subscriptionId\} with the setPause field set to true. When you’re ready to resume the subscription, send another PUT request with setPause set to false.

PUT
/api/Subscription/:subId
1curl -X PUT https://api-sandbox.payabli.com/api/Subscription/231 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "setPause": true
6}'

Create a subscription

Send a POST request to /api/Subscription/add to create a new subscription or scheduled payment. See the API reference for this endpoint for full documentation.

POST
/api/Subscription/add
1curl -X POST https://api-sandbox.payabli.com/api/Subscription/add \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "customerData": {
6 "customerId": 4440
7 },
8 "entryPoint": "f743aed24a",
9 "paymentDetails": {
10 "totalAmount": 100,
11 "serviceFee": 0
12 },
13 "paymentMethod": {
14 "cardcvv": "123",
15 "cardexp": "02/25",
16 "cardHolder": "John Cassian",
17 "cardnumber": "4111111111111111",
18 "cardzip": "37615",
19 "initiator": "payor",
20 "method": "card"
21 },
22 "scheduleDetails": {
23 "endDate": "03-20-2025",
24 "frequency": "weekly",
25 "planId": 1,
26 "startDate": "09-20-2024"
27 }
28}'

A successful request sends a response that includes the subscription ID (in responseData) and customer ID.

Response
1{
2 "CustomerId": 4440,
3 "isSuccess": true,
4 "responseData": "396",
5 "responseText": "Success"
6}

Get subscription details

Send a GET request to /api/Subscription/{subscriptionId} to retrieve details about a specific subscription.

This example gets the details for the subscription with ID 263.

GET
/api/Subscription/:subId
1curl https://api-sandbox.payabli.com/api/Subscription/263 \
2 -H "requestToken: <apiKey>"

A successful request returns a response that includes all available details about a subscription. See the API reference for a full response example.

Response
1{
2 "CreatedAt": "2022-07-01T15:00:01Z",
3 "Customer": {
4 "AdditionalData": "AdditionalData",
5 "BillingAddress1": "1111 West 1st Street",
6 "BillingAddress2": "Suite 200",
7 "BillingCity": "Miami",
8 "BillingCountry": "US",
9 "BillingEmail": "example@email.com",
10 "BillingPhone": "5555555555",
11 "BillingState": "FL",
12 "BillingZip": "45567",
13 "CompanyName": "Sunshine LLC",
14 "CreatedAt": "2022-07-01T15:00:01Z",
15 "customerId": 4440,
16 "CustomerId": 4440,
17 "CustomerNumber": "3456-7645A",
18 "customerStatus": 1,
19 "FirstName": "John",
20 "Identifiers": [
21 "\\\"firstname\\\"",
22 "\\\"lastname\\\"",
23 "\\\"email\\\"",
24 "\\\"customId\\\""
25 ],
26 "LastName": "Doe",
27 "ShippingAddress1": "123 Walnut St",
28 "ShippingAddress2": "STE 900",
29 "ShippingCity": "Johnson City",
30 "ShippingCountry": "US",
31 "ShippingState": "TN",
32 "ShippingZip": "37619"
33 },
34 "EndDate": "2025-10-19T00:00:00Z",
35 "EntrypageId": 0,
36 "ExternalPaypointID": "Paypoint-100",
37 "FeeAmount": 3,
38 "Frequency": "monthly",
39 "IdSub": 396,
40 "InvoiceData": {
41 "AdditionalData": "AdditionalData",
42 "attachments": [
43 {}
44 ],
45 "company": "ACME, INC",
46 "discount": 10,
47 "dutyAmount": 0,
48 "firstName": "Chad",
49 "freightAmount": 10,
50 "frequency": "one-time",
51 "invoiceAmount": 105,
52 "invoiceDate": "2025-07-01",
53 "invoiceDueDate": "2025-07-01",
54 "invoiceEndDate": "2025-07-01",
55 "invoiceNumber": "INV-2345",
56 "invoiceStatus": 1,
57 "invoiceType": 0,
58 "items": [
59 {
60 "itemCost": 5,
61 "itemProductName": "Materials deposit",
62 "itemQty": 1
63 }
64 ],
65 "lastName": "Mercia",
66 "notes": "Example notes.",
67 "paymentTerms": "PIA",
68 "purchaseOrder": "PO-345",
69 "shippingAddress1": "123 Walnut St",
70 "shippingAddress2": "STE 900",
71 "shippingCity": "Johnson City",
72 "shippingCountry": "US",
73 "shippingEmail": "example@email.com",
74 "shippingFromZip": "30040",
75 "shippingPhone": "5555555555",
76 "shippingState": "TN",
77 "shippingZip": "37619",
78 "summaryCommodityCode": "501718",
79 "tax": 2.05,
80 "termsConditions": "Must be paid before work scheduled."
81 },
82 "LastRun": "2025-10-19T00:00:00Z",
83 "LastUpdated": "2022-07-01T15:00:01Z",
84 "LeftCycles": 15,
85 "Method": "card",
86 "NetAmount": 3762.87,
87 "NextDate": "2025-10-19T00:00:00Z",
88 "ParentOrgName": "PropertyManager Pro",
89 "PaymentData": {
90 "AccountExp": "11/29",
91 "accountId": "accountId",
92 "AccountType": "visa",
93 "AccountZip": "90210",
94 "binData": {
95 "binCardBrand": "Visa",
96 "binCardCategory": "PLATINUM",
97 "binCardIssuer": "Bank of Example",
98 "binCardIssuerCountry": "United States",
99 "binCardIssuerCountryCodeA2": "US",
100 "binCardIssuerCountryNumber": 840,
101 "binCardType": "Credit",
102 "binMatchedLength": 6
103 },
104 "HolderName": "Chad Mercia",
105 "Initiator": "payor",
106 "MaskedAccount": "4XXXXXXXX1111",
107 "orderDescription": "Depost for materials for 123 Walnut St",
108 "paymentDetails": {
109 "totalAmount": 100,
110 "categories": [
111 {
112 "amount": 1000,
113 "label": "Deposit"
114 }
115 ],
116 "checkImage": {
117 "key": "value"
118 },
119 "checkNumber": "107",
120 "currency": "USD",
121 "serviceFee": 0,
122 "splitFunding": [
123 {}
124 ]
125 },
126 "Sequence": "subsequent",
127 "SignatureData": "SignatureData",
128 "StoredId": "1ec55af9-7b5a-4ff0-81ed-c12d2f95e135-4440",
129 "StoredMethodUsageType": "subscription"
130 },
131 "PaypointDbaname": "Sunshine Gutters",
132 "PaypointEntryname": "d193cf9a46",
133 "PaypointId": 255,
134 "PaypointLegalname": "Sunshine Services, LLC",
135 "PlanId": 0,
136 "Source": "api",
137 "StartDate": "2025-10-19T00:00:00Z",
138 "SubEvents": [
139 {
140 "description": "TransferCreated",
141 "eventTime": "2023-07-05T22:31:06Z",
142 "extraData": {
143 "key": "value"
144 },
145 "refData": "refData",
146 "source": "api"
147 }
148 ],
149 "SubStatus": 1,
150 "TotalAmount": 103,
151 "TotalCycles": 24,
152 "UntilCancelled": true
153}

Update a subscription

Send a PUT request to /api/Subscription/{subscriptionId} to change an existing subscription’s payment details, schedule, or pause status. See the API reference for this endpoint for full documentation.

PUT
/api/Subscription/:subId
1curl -X PUT https://api-sandbox.payabli.com/api/Subscription/231 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "paymentDetails": {
6 "totalAmount": 100,
7 "serviceFee": 0
8 },
9 "scheduleDetails": {
10 "endDate": "03-20-2025",
11 "frequency": "weekly",
12 "planId": 1,
13 "startDate": "09-20-2024"
14 }
15}'

A successful request returns a response that includes the subscription ID (in responseData) and customer ID.

Response
1{
2 "isSuccess": true,
3 "responseData": "396 updated",
4 "responseText": "Success"
5}

Delete a subscription

Send a DELETE request to /api/Subscription/{subscriptionId} to cancel a subscription and stop future payments. See the API reference for this endpoint for full documentation.

This example deletes the subscription with the ID 396.

DELETE
/api/Subscription/:subId
1curl -X DELETE https://api-sandbox.payabli.com/api/Subscription/396 \
2 -H "requestToken: <apiKey>"

A successful deletion returns a response that includes the subscription ID (in responseData) and customer ID.

Response
1{
2 "isSuccess": true,
3 "responseData": "396",
4 "responseText": "Success"
5}

Next steps

Use the Subscription Utilities to manage your subscriptions. These utilities provide additional functionality, such as retrying failed payments and managing autopay transactions.