POST
Cancel subscription contract
Use this endpoint to cancel an existing subscription contract by
contractId and choose when the cancellation takes effect.Request
merchantNoMerchant number assigned by Onerway. See Setup for how to obtain it.
Example:
replace_with_merchant_nocontractIdSubscription contract number to cancel. It normally comes from the initial subscription response, webhook, or Query subscription details.
Example:
sub_contract_demo_202606210001expireModeHow 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:
1Allowed 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.
expireDateCondition: Required when
Date when cancellation takes effect, in expireMode=3, cancel on a specified date.yyyy-MM-dd format.Example:
2026-07-31signRequest signature string. See Request signing for how to generate it.
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
respCode20000 means the cancellation request was processed successfully. Other values are error codes. See Response codes.respMsgHuman-readable message for the response code.
dataSubscription 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.