POST
Create or cancel refund
Use this endpoint to submit a refund request for a successful payment, or cancel a submitted request before Onerway approves it. Refund availability and request time limits depend on the payment method.
Request
merchantNoMerchant number assigned by Onerway. See Setup for how to obtain it.
Example:
replace_with_merchant_norefundTypeRefund operation type: create a refund request or cancel a submitted request.
Example:
0Allowed values
0- Create a refund request.
1- Cancel a submitted refund request.
Constraints
- Rule
- Refund availability, support for partial or multiple refunds, and the refund request time limit depend on the payment method. Most payment methods support partial and multiple refunds.
- Rule
- Submit a cancellation before Onerway approves the refund request. After approval, Onerway submits the request to the payment channel or card issuer. A processing status alone does not mean that the refund request can still be cancelled.
merchantTxnIdMerchant transaction number for this refund, used for tracking and reconciliation.
Example:
refund_demo_202606210001Constraints
- Rule
- Onerway generates this identifier if it is omitted. Duplicate submissions are rejected.
originTransactionIdOriginal Onerway transaction number associated with this refund operation.
Example:
demo_payment_transaction_idConstraints
- Rule
- For
refundType=0, provide the transaction ID of the original payment. ForrefundType=1, provide the transaction ID of the refund request to cancel.
refundAmountAmount to refund.
Example:
20Constraints
- Consistency
- The refund amount is expressed in the original payment currency.
- Consistency
- The total amount refunded across all refunds must not exceed the payment amount.
signRequest signature string. See Request signing for how to generate it.
curl -X POST 'https://sandbox-acq.onerway.com/v1/txn/onlineRefund' \
-H 'Content-Type: application/json' \
--data-raw '{
"merchantNo": "demo_merchantNo",
"refundType": "0",
"merchantTxnId": "demo_refund_merchant_txn_id",
"originTransactionId": "demo_payment_transaction_id",
"refundAmount": "20",
"sign": "replace_with_signature"
}'Response
respCodeFor
refundType=0, 20000 means the refund request was accepted, not that the refund succeeded. Handle the Refund result webhook or Refund request rejection webhook; use Query refunds if no notification arrives. A successful cancellation (refundType=1) does not trigger a notification. Other response codes are listed in Response codes.Constraints
- Rule
- Most refunds are credited immediately. Other refunds can take up to 25 days.
respMsgHuman-readable message for the response code.
dataRefund transaction number.
Constraints
- Rule
- For
refundType=0, this is the newly created Onerway refund transaction number. For a successful cancellation (refundType=1), this equalsoriginTransactionIdin the request.
{
"respCode": "20000",
"respMsg": "Success",
"data": "demo_refund_transaction_id"
}No error responses are documented for this endpoint.