- Guides
- API Reference
- Appendix
Refund a transaction
POST
https://test-api.star-saas.com/v1/refund
Merchant can also manually refund a transaction in Merchant Portal.
Request
Header Params
Content-Type
string
required
Example:
application/x-www-form-urlencoded
Body Params application/json
merchant_id
string
required
<= 7 characters
Example:
701001
account_id
string
required
<= 10 characters
Example:
701001010
encryption_data
string
required
encryption_data=sha256(merchant_id + account_id + transaction_id1 + transaction_id2 ...+ sign_key);
All encryption parameters need to remove spaces before encryption.
<= 64 characters
Example:
a290ea1fd6c69d69d578eb15921eb486e4b801c5b6a577df445aa8f6c592b66b
refund_orders
object
required
transaction_id
string
required
<= 50 characters
Example:
1667308950627942400
order_no
string
required
<= 50 characters
Example:
1591067778165
currency
string
required
<= 3 characters
Example:
GBP
amount
string
required
<= 15 characters
Example:
100.00
refund_amount
string
required
<= 15 characters
Example:
50.00
refund_reason
string
required
<= 50 characters
Example:
No stock
refund_reference
string
optional
<= 50 characters
Example:
PI-1252-234-1111
Example
{
"merchant_id": "{{merchant_id}}",
"account_id": "{{account_id}}",
"encryption_data": "e0570d4ba9730c85815363401fc6c0cd1501b3919c820a524529a40d0f1bfad7",
"refund_orders": [
{
"transaction_id": "1379868618653958144",
"order_no": "1731469069933",
"currency": "USD",
"amount": "10.36",
"refund_amount": "3.33",
"refund_reason": "Interface Test"
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://test-api.star-saas.com/v1/refund' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{
"merchant_id": "701001",
"account_id": "701001010",
"encryption_data": "e0570d4ba9730c85815363401fc6c0cd1501b3919c820a524529a40d0f1bfad7",
"refund_orders":[
{
"transaction_id": "1379868618653958144",
"order_no": "1731469069933",
"currency": "USD",
"amount": "10.36",
"refund_amount": "3.33",
"refund_reason": "Interface Test"
}
]
}'
Responses
🟢200Success
application/json
Body
account_id
string
required
refund_orders
array [object {10}]
required
amount
string
optional
currency
string
optional
order_no
string
optional
refund_amount
string
optional
refund_message
string
optional
refund_reason
string
optional
refund_reference
string
optional
refund_reference_id
string
optional
refund_status
string
optional
transaction_id
string
optional
return_message
string
required
return_status
string
required
encryption_data
string
required
merchant_id
string
required
Example
{
"account_id": "701001010",
"refund_orders": [
{
"amount": "10.36",
"currency": "USD",
"order_no": "1731469069933",
"refund_amount": "3.33",
"refund_message": "V0000:OK",
"refund_reason": "Interface Test",
"refund_reference": "",
"refund_reference_id": "1379868618653958144-01",
"refund_status": "1",
"transaction_id": "1379868618653958144"
}
],
"return_message": "OK",
"return_status": "1",
"encryption_data": "e0570d4ba9730c85815363401fc6c0cd1501b3919c820a524529a40d0f1bfad7",
"merchant_id": "701001"
}