Create Refund

Description

This endpoint will help merchants to create a refund transaction.

Endpoint

  • REST API: POST https://live.cpayapi.com/openapi/v1/refund

Parameters

Name
Type
Mandatory
Description

Content-Type

string

application/json

Body

Name
Type
Mandatory
Description

mid

int64

yes

unique id generated by us

orderID

string(64)

yes

unique order id generated by cpay

amount

string(32)

yes

refund amount, 0 < amount <= payment amount

sign

string(128)

yes

Response

Name
Type
Description

code

int64

msg

string

description of code

traceid

string

unique request id generated by cpay

data.orderID

string

unique order id generated by cpay

data.orderStatus

int

10: in processing 20: refund completed and successful 30: refund failed

data.refundAmount

string

refund amount

data.remark

string

if orderStatus is 30, this field returns the error message

Example

  • Request

curl -X POST 'https://live.cpayapi.com/openapi/v2/refund' \
-H 'Content-Type: application/json' \
-d `{
	"mid": 206051,
	"orderID": "NO202305261652",
	"amount": "1.05",
	"sign": "b02c7d2fd87e1b00dd7efe7069"
}`
  • Response

Successful response example, transaction status is PROCESSING.


{
    "code": 0,
    "msg": "success",
    "data": {
        "orderID": "240424172131139895037",
        "orderStatus": 10,
        "refundAmount": "200",
        "remark": ""
    },
    "traceid": "240425171627X7893092"
}

Last updated