Onerway
POST

Cancel subscription contract

Use this endpoint to cancel an existing subscription contract by contractId and choose when the cancellation takes effect.

Request

merchantNo
Merchant number assigned by Onerway. See Setup for how to obtain it.
Example:
contractId
Subscription contract number to cancel. It normally comes from the initial subscription response, webhook, or Query subscription details.
Example:
expireMode
How the subscription cancellation takes effect. When both expireMode and expireDate are omitted, the subscription is canceled at the end of the current billing cycle.
Example:
Allowed values
1
Cancel immediately. The subscription cancellation notification is sent immediately; Onerway-managed subscriptions also send an email notification to the customer.
2
Cancel at the end of the current billing cycle.
3
Cancel on a specified date. Submit expireDate; the cancellation notification is sent when the cancellation takes effect.
expireDate
Condition: Required when expireMode=3, cancel on a specified date.
Date when cancellation takes effect, in yyyy-MM-dd format.
Example:
sign
Request signature string. See Request signing for how to generate it.

Request example

curl -X POST 'https://sandbox-acq.onerway.com/v1/txn/sub/cancel' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "contractId": "sub_contract_demo_202606210001",
  "expireMode": "1",
  "merchantNo": "replace_with_merchant_no",
  "sign": "{{SIGN}}"
}'

Response

respCode
20000 means the cancellation request was processed successfully. Other values are error codes. See Response codes.
respMsg
Human-readable message for the response code.
data
Subscription contract status after cancellation. The successful cancellation example returns 3.
Allowed values
0
Processing.
1
Effective.
2
Ineffective.

Response example

Example code is unavailable.

No error responses are documented for this endpoint.