v1

latestOpenAPI 3.0.02026-07-246335313.6 KB
Subscription APIs

Create Ondemand Deduction

Use this API for Creating Ondemand Deduction.

post/api/subscription/createDeduction

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

portone_keystring required

The unique PortOne key for merchant

signature_hashstring required

The signature_hash of ondemand deduction generated as per <a href="/docs/ondemand-deduction" target="_blank">Ondemand Deduction Request Signature Documentation</a>

merchant_order_refstring required

The unique merchant order reference generated by the merchant

subscription_order_refstring required

The unique subscription order reference of the subscription link

descriptionstring

Product name for the customer's subscription purchase

source'api' | 'checkout' required

default, api or checkout -- The Source of creation.

amountnumber double required

The amount of deduction, can be a floating-point number

currencystring required

The currency of the subscription

environment'live' | 'sandbox' required

The environment of transacation either live OR sandbox

Example request

{
  "portone_key": "<PortoneKey>",
  "signature_hash": "<Genrated signature_hash>",
  "merchant_order_ref": "<Unique merchant_order_ref>",
  "subscription_order_ref": "<Unique subscription_order_ref>",
  "description": "Product name for the customer's subscription purchase",
  "source": "api",
  "amount": 10,
  "currency": "THB",
  "subscription_type": "ONDEMAND"
}

Response

Successful response

is_successboolean

The boolean flag denoting if subscription ondemand deduction was successfully created

merchant_order_refstring

The unique Order reference generated by merchant

order_refstring

The unique transaction reference stored in PortOnes database

status_codestring

The status_code for API request execution result

statusstring

The status for the ondemand deduction result