Subscription Links

Create Subscription Link

Changed on

Create a new card-on-file subscription enrollment link

post/subscription-links

Request

  • The document declares no server URL.
  • Auth
    none declared. Required headers: ApiKey, MerchantId, Environment

Headers

ApiKeystring required

Your api key. To create a key, please get into our dashboard. If you don't have access to it, please reach the Support team.

MerchantIdstring required

Your merchant ID. This information is available in our dashboard. If you don't have access to it, please reach the Support team.

Environment'live' | 'sandbox' required

Allow you to choose between the sandbox mode to perform some tests or the live mode for real world transactions.

Request body

amountnumber required

Recurring debit amount charged on each occurrence.

currencystring required

Three-letter ISO 4217 currency code

purchaseReferencestring required

Unique reference for this subscription

frequency'weekly' | 'monthly' required

Recurring debit frequency.

startDatestring required

ISO-8601 date of the first recurring debit.

countrystring required

Two-letter ISO 3166-1 alpha-2 country code where the enrollment will be processed

descriptionstring

Description of the subscription link

expirationDatestring

Expiration date for the enrollment link (ISO 8601 format)

successUrlstring

URL to redirect to after successful enrollment

failureUrlstring

URL to redirect to after failed enrollment

Example request

{
  "amount": 5000,
  "currency": "XOF",
  "purchaseReference": "SUB_2024_001",
  "frequency": "monthly",
  "startDate": "2026-08-01",
  "country": "CI",
  "expirationDate": "2026-12-31T23:59:59.000Z",
  "successUrl": "https://merchant.com/success",
  "failureUrl": "https://merchant.com/failure"
}

Response

Subscription link created successfully

idstring required

Unique identifier for the payment link

urlstring required

URL for the payment link

status'active' | 'expired' | 'closed' | 'completed' required

Current status of the payment link

purchaseReferencestring required

Merchant reference for the payment

amountobject nullable required

Amount intended to be charged in the smallest currency unit. Null when openAmount is true.

openAmountboolean

When true, the payer decides the amount at payment time.

minAmountnumber

Minimum amount the payer can enter (only when openAmount is true).

maxAmountnumber

Maximum amount the payer can enter (only when openAmount is true).

currencystring required

Three-letter ISO 4217 currency code

maximumPaymentsnumber

Maximum successful payments allowed (omitted when unlimited multi_use)

currentSuccessCountnumber required

Number of successful payments recorded for this link

maximumAttemptsnumber required

Maximum number of failed payments allowed per user

createdAtstring required

Creation date in ISO 8601 format

updatedAtstring required

Last update date in ISO 8601 format

expirationDatestring required

Expiration date in ISO 8601 format

customerPhoneNumberstring required

Restricted MSISDN

type'single_use' | 'multi_use' | 'bill_payment' required

Type of the payment link

providersstring[]

Mobile money providers the link offers. A provider listed at creation that is not enabled in the country for a method the link offers, or that the routing check refused for the merchant, is missing here. Absent on a card-only link.

Example response

{
  "id": "pl_z1urYtVFgEebtcj8fxp4v",
  "url": "https://pay.hub2.com/pl_z1urYtVFgEebtcj8fxp4v",
  "status": "active",
  "purchaseReference": "ORDER-12345",
  "minAmount": 500,
  "maxAmount": 100000,
  "currency": "XOF",
  "maximumPayments": 50,
  "maximumAttempts": 3,
  "createdAt": "2024-01-15T12:00:00.000Z",
  "updatedAt": "2024-01-15T12:30:00.000Z",
  "expirationDate": "2024-01-15T14:30:00.000Z",
  "customerPhoneNumber": "123456789",
  "type": "single_use",
  "providers": [
    "orange",
    "mtn"
  ],
  "customerFields": [
    {
      "fieldName": "national_id",
      "fieldLabel": "National ID"
    }
  ]
}

Changes