For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscriptions

You can create subscription plans with customizable billing frequencies (daily, weekly, monthly, etc.) and amounts using just a single endpoint.

We currently support creation of subscription plans for NGN, GHS, ZAR, and USD only.

Authorization
Set value to `Bearer SECRET_KEY`

Content-type

Set value to application/json

The secret key can be gotten from the 'Settings' page on your Startbutton dashboard.

Post a request to the URL below, where the base URL is determined by the environment you are in.

BaseUrl

Sandbox/PROD: https://api.startbutton.tech

Create Subscription Plan

POST: {{baseUrl}}/subscription/api

Sample code:

{
    "name": "Free trial subscription 7",
    "description": "This is a Free trial Subscription Test",
    "frequency": "monthly",
    "currency": "NGN",
    "type": "fixed",
    "amount": 1000,
    "initialAmount": "500", //to set first time subscriber amount
    "freeTrial": true, //to enable free trial period
    "freeTrialPeriod": 5, //to set free trial period
    "endDate": "2025-06-30", //this is optional
    "notificationSettings": {
        "freeTrial": {
            "enabled": true,
            "period": 3
        }
    }
}

Sample response:

Deactivate a Subscription Plan

This is endpoint allows you cancel or deactivate an active subscription plan

POST: {{baseUrl}}/subscription/api/:planId

Path variable
Required?

planId

Yes

Sample Code:

Sample Response:

Get Subscribers

This endpoint retrieves details of all subscribers on a subscription plan and allows filtering by status.

GET: {{baseUrl}}/subscribers

Query Params
Required?
Description

subscriptionPlanId

Yes

the subscription plan id

status

No

should be activated, 'completed', or 'cancelled',

Sample Response:

The Subscription Plan detail associated with the subscriber is also returned, but for the scope of this DOC we will only share the Subscriber's detail. Additionally, if a Subscription Plan isn't created with an endDate— then no endDate is returned for the Plan.

Cancel Subscriber [merchant-facing]

With this endpoint, you can cancel a subscriber from a subscription plan. It allows you to remove a subscriber's access to a previously active subscription plan. You need to retrieve the subscriber's Id using the Get-subscriber endpoint first.

PATCH : {{baseUrl}}/subscribers/:subscriberId/update-status

Path Variable
Required?
Description

subscriberId

Yes

the subscriber's id

Sample Payload

Sample Response

Cancel subscription [customer-facing]

With this endpoint, you can integrate an unsubcribe or cancel function in your customer facing UI for a subscription plan. This functionality allows a subscriber opt-out of an active subscription plan by themselves. You can retrieve the subscriber's Id using the Get-subscriber endpoint first.

POST: {{baseUrl}}/subscribers/cancel-customer-initiated

Sample Payload

Sample Response

Subscription FAQs

  1. How can we identify the subscription plan the user paid for - from the webhook response? ANS: The payment code returned in the webhook response would be the same as the code on the subscription link.

  2. If a subscription charge attempt fails, will it be retried in the next billing cycle? ANS: Yes, until the number of expected payment cycles is completed— we retry in the next billing cycle.

Last updated