APICenter
DocsBuildLearn
Guides & Tutorials

Subscriptions & Invoices API

Create subscriptions and inspect their invoices.

Subscriptions represent recurring billing against a PayMongo plan and customer record. Reusable payment-method setup is not currently exposed by the public API.

For a Node.js backend, use the api.payments.subscriptions and api.payments.plans methods from the APICenter SDK. The REST examples below are for other runtimes.

Plans

Create an actual PayMongo subscription plan with POST /api/v1/payments/plans. Amounts use PHP centavos, so 150050 means PHP 1,500.50. Intervals are weekly, monthly, or yearly; intervalCount accepts 1 to 10. Omit cycleCount to bill indefinitely, or provide an integer of at least 2.

curl -X POST https://api.apicenter.itsandbox.site/api/v1/payments/plans \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Idempotency-Key: plan-starter-monthly" \
  -H "Content-Type: application/json" \
  -d '{"name":"Starter monthly","amount":150050,"currency":"PHP","interval":"monthly","intervalCount":1}'

Use GET /api/v1/payments/plans/{planId} to retrieve a plan and GET /api/v1/payments/plans to list plans created by the calling project.


Create Subscription

  • Endpoint: POST /api/v1/payments/subscriptions
  • Required Scope: payments:subscriptions:write or a broader payment write scope
  • Required Header: Idempotency-Key
curl -X POST https://api.apicenter.itsandbox.site/api/v1/payments/subscriptions \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Idempotency-Key: sub-idem-8812" \
  -H "Content-Type: application/json" \
  -d '{
    "referenceId": "SUB-TIER-PRO-001",
    "customerId": "cus_9912041",
    "planId": "plan_pro_monthly"
  }'