---
title: "Create Ondemand Deduction"
method: POST
path: "/api/subscription/createDeduction"
tags: ["Subscription APIs"]
---

# Create Ondemand Deduction

`POST /api/subscription/createDeduction`

## Request

- Base URL: `https://api.portone.cloud`
- URL: `https://api.portone.cloud/api/subscription/createDeduction`
- Auth: none declared

Use this API for Creating Ondemand Deduction.

## Headers

- `Content-Type` string
- `X-Portone-Client-Key` string
- `Authorization` string

## Request body

- object
  - `portone_key` string, required: The unique PortOne key for merchant
  - `signature_hash` string, 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_ref` string, required: The unique merchant order reference generated by the merchant
  - `subscription_order_ref` string, required: The unique subscription order reference of the subscription link
  - `description` string: Product name for the customer's subscription purchase
  - `source` 'api' | 'checkout', required: default, api or checkout -- The Source of creation.
  - `amount` number, double, required: The amount of deduction, can be a floating-point number
  - `currency` string, required: The currency of the subscription
  - `environment` 'live' | 'sandbox', required: The environment of transacation either live OR sandbox

## Response `200`

Successful response

- object
  - `is_success` boolean: The boolean flag denoting if subscription ondemand deduction was successfully created
  - `merchant_order_ref` string: The unique Order reference generated by merchant
  - `order_ref` string: The unique transaction reference stored in PortOnes database
  - `status_code` string: The status_code for API request execution result
  - `status` string: The status for the ondemand deduction result

## Other responses

- `400`: Failure response

---

[API](https://skmtc.dev/portone/apis/subscription-apis.md) - [All operations](https://skmtc.dev/portone/apis/subscription-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/portone/apis/subscription-apis/revisions/c78029b23b1e?raw)
