Skip to main content
POST
https://api-sandbox.pavewaygroup.com/v1
/
subscriptions
Create a Subscription
curl --request POST \
  --url https://api-sandbox.pavewaygroup.com/v1/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "<string>",
  "plan_id": "<string>",
  "payment_method": "<string>",
  "mobile_money.phone": "<string>",
  "mobile_money.network": "<string>",
  "card.token": "<string>",
  "fee_bearer": "<string>",
  "is_internal": true
}
'
{
  "status_code": 200,
  "data": {
    "id": "sub_123...",
    "status": "active",
    "amount": 5000,
    "current_period_end": "2024-02-01T12:00:00Z",
    "current_invoice": {
       "status": "paid",
       "amount": 5000
    }
  }
}

Request Body

customer_id
string
required
The PaveWay ID of the customer (cus_...).
plan_id
string
required
The ID of the plan to subscribe to.
payment_method
string
required
card or mobile_money.

Mobile Money Options

mobile_money.phone
string
Phone number for USSD prompts.
mobile_money.network
string
MTN, ORANGE, AIRTEL, etc.

Card Options

card.token
string
The card token (tok_...) obtained from a previous one-time payment.
fee_bearer
string
default:"merchant"
Specifies who bears the transaction fees.
  • merchant: Fees are deducted from the payout.
  • customer: Fees are added to the transaction amount.
is_internal
boolean
default:"false"
Flag to indicate if the business is an internal PaveWay application. If true, the platform fee is reduced to 0.5%.

Response

{
  "status_code": 200,
  "data": {
    "id": "sub_123...",
    "status": "active",
    "amount": 5000,
    "current_period_end": "2024-02-01T12:00:00Z",
    "current_invoice": {
       "status": "paid",
       "amount": 5000
    }
  }
}