v1
latestOpenAPI 3.0.02026-07-246335313.6 KBSubscription APIs
Create Subscription
Create a Subscription link. In response you will get the Subscription Link reference and the Subscription link URL. You can share the subscription link with your customer. The master merchant can also create the subscription link for their sub-merchants, by passing the sub-merchant key as a header. Refer API docs for additional information.
post/api/subscription/createSubscription
Headers
Content-Typestring
X-Portone-Client-Keystring
The PortOne Key of the merchant
Authorizationstring
The Authorization header is used to include the JWT for authenticating API requests; learn how to generate the token <a href="/docs/jwt-authentication" target="_blank">in this guide</a>
Request body
Example request
{
"portone_key": "<PortoneKey>",
"signature_hash": "<Genrated signature_hash>",
"merchant_order_ref": "<Unique merchant_order_ref>",
"description": "Product name for the customer's subscription purchase",
"source": "api",
"quantity": 3,
"currency": "THB",
"allow_accumulate": "Y",
"recurrance_count": 3,
"plan_order_ref": "2RmeBi6k3mH850nvmRfYfnfADyp",
"started_at": "2023-06-27T17:30:00.000Z",
"expiry_date": "2023-06-27T17:30:00.000Z",
"success_url": "https://subscription.portone.cloud/success.html",
"failure_url": "https://subscription.portone.cloud/failure.html",
"pending_url": "https://subscription.portone.cloud/pending.html",
"subscription_type": "REGULAR"
}Response
Successful response