Skip to main content
POST
/
v1
/
billing
/
subscriptions
curl
curl -X POST https://api.paybridgenp.com/v1/billing/subscriptions \
  -H "Authorization: Bearer pk_sandbox_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "bc_01j9x2k3m4n5p6q7r8s9t0u1v2",
    "planId": "bp_01j9x2k3m4n5p6q7r8s9t0u1v2"
  }'
{
  "id": "sub_01j9x2k3m4n5p6q7r8s9t0u1v2",
  "livemode": true,
  "status": "active",
  "displayStatus": "draft",
  "startDate": "2023-11-07T05:31:56Z",
  "currentPeriodStart": "2023-11-07T05:31:56Z",
  "currentPeriodEnd": "2023-11-07T05:31:56Z",
  "nextInvoiceAt": "2023-11-07T05:31:56Z",
  "trialEndsAt": "2023-11-07T05:31:56Z",
  "cancelAtPeriodEnd": true,
  "cancelledAt": "2023-11-07T05:31:56Z",
  "cancelReason": "<string>",
  "cancelEffectiveAt": "2023-11-07T05:31:56Z",
  "pausedAt": "2023-11-07T05:31:56Z",
  "pauseReason": "<string>",
  "endedAt": "2023-11-07T05:31:56Z",
  "providerPreference": "esewa",
  "referenceId": "<string>",
  "customer": {
    "id": "<string>",
    "name": "<string>",
    "email": "<string>"
  },
  "plan": {
    "id": "<string>",
    "name": "<string>",
    "amount": 123,
    "currency": "<string>",
    "intervalUnit": "<string>",
    "intervalCount": 123
  },
  "latestInvoice": {
    "status": "<string>",
    "dueAt": "2023-11-07T05:31:56Z",
    "paidAt": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z"
  },
  "metadata": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.paybridgenp.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Your PayBridge API key. Obtain one from the dashboard under Settings → API Keys. Prefix: pk_sandbox_ for testing, pk_live_ for production.

Body

application/json
customerId
string
required

ID of the billing customer.

Example:

"bc_01j9x2k3m4n5p6q7r8s9t0u1v2"

planId
string
required

ID of the billing plan.

Example:

"bp_01j9x2k3m4n5p6q7r8s9t0u1v2"

startDate
string<date-time>

When to start the subscription. Defaults to now.

providerPreference
enum<string>

Override the plan's defaultProvider for this subscription.

Available options:
esewa,
khalti,
connectips,
hamropay
referenceId
string

Your internal reference ID.

Example:

"subscription_abc123"

metadata
object

Response

Subscription created.

id
string
Example:

"sub_01j9x2k3m4n5p6q7r8s9t0u1v2"

livemode
boolean

true when created with a live key, false for sandbox.

status
enum<string>
Available options:
active,
paused,
past_due,
cancelled,
completed
displayStatus
enum<string>

Human-friendly status including draft (future start) and trialing states.

Available options:
draft,
trialing,
active,
paused,
past_due,
cancelled,
completed
startDate
string<date-time>
currentPeriodStart
string<date-time>
currentPeriodEnd
string<date-time>
nextInvoiceAt
string<date-time> | null
trialEndsAt
string<date-time> | null
cancelAtPeriodEnd
boolean
cancelledAt
string<date-time> | null
cancelReason
string | null
cancelEffectiveAt
string<date-time> | null
pausedAt
string<date-time> | null
pauseReason
string | null
endedAt
string<date-time> | null
providerPreference
enum<string> | null
Available options:
esewa,
khalti,
connectips,
hamropay
referenceId
string | null

Your internal reference for this subscription.

customer
object
plan
object
latestInvoice
object
metadata
object
createdAt
string<date-time>
updatedAt
string<date-time>