Update a subscription's next billing cycle
Move a subscription's next billing date. The date must be today or later, and one-time purchases cannot be rescheduled. Unlike cancel and resume, the subscription is named in the body rather than the path, so this endpoint never returns 404: an unknown or inactive `subscription_id` comes back as a 400 keyed on that field. `next_billing_cycle` is sent as a plain date and stored as midnight Nepal time, which is why it reads back as a timestamp.
Authorization
ApiKey API key issued to the partner, sent with the Bearer prefix — for example: Authorization: Bearer su_key_9f2c4d1ab3….
Keys minted on the live instance are prefixed su_key_ and keys minted on sandbox su_test_key_. The two instances keep separate key tables and separate hosts, so a sandbox key sent to the live host — or the reverse — answers Invalid API key. rather than falling back to the other environment.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/subscriptions/update-billing-cycle/" \ -H "Content-Type: application/json" \ -d '{ "subscription_id": "aa11a4c2-a467-43db-b413-c4ab0f5cf627", "next_billing_cycle": "2019-08-24" }'{ "message": "Billing cycle updated."}Create a subscription POST
Create a subscription for a client against one of your billing periods. `client.phone` identifies the buyer and must be a Nepali mobile number (10 digits starting with 96, 97 or 98); a +977 country code is accepted and stripped. The subscription starts in `pending_checkout`; send the returned `checkout_url` to the client to collect payment. `client.email` and `client.phone` are read back on the subscription as `client.email` and `client.phone`, but the `client.billing` block loses its `billing_` prefix on the way back out. `return_url` is required despite reading as optional on the model behind this body — a missing, null or blank value is rejected the same way. A client may hold only one live recurring subscription per product, so a second one on a different billing period of the same product is refused. This endpoint takes no idempotency key: a retried request that timed out opens a second subscription and a second checkout, so reconcile by `subscription_id` before retrying.
Retrieve a subscription GET
Return a single subscription belonging to your account.