Overview
This API is used to issue a partial refund/adjustment to the patient after the Sunbit transaction has been completed. It should be used only when the refund amount is less than the total purchase amount.
Issue Refunds
Headers
| Attribute |
Required |
Type |
Description |
| sunbit-key |
yes |
text |
Provided to you by Sunbit |
| sunbit-secret |
yes |
text |
Provided to you by Sunbit |
Query Parameters
| Attribute |
Required |
Type |
Description |
| purchaseId |
yes |
text |
The purchase Id that is generated by Sunbit for successful Sunbit flow. This ID is returned in the webhook |
Body
| Attribute |
Required |
Type |
Description |
| transactionId |
yes |
text |
Your internal ID for the current transaction, should be the same as you provided during the initialization call |
| location |
yes |
text |
Your location ID as provided by Sunbit |
| reason |
yes |
text |
The reason for change should be PARTIAL_REFUND – when an adjustment of the purchase amount is needed or ERROR_CORRECTION when an issue occurs during billing |
| returnedAmount |
yes |
decimal |
Amount should be less than the total amount in the original purchase |
Response
| Attribute |
Type |
Description |
| purchaseId |
text |
Same purchase ID from request |
| changedAmount |
decimal |
Net purchase amount after refund deduction |
Example
Request
curl --request PUT \
--url "https://api-sandbox.sunbit.com/epay/api/v1/epay/changeAmount/{purchaseId}" \
--header "Content-Type: application/json" \
--header "accept: */*" \
--header "sunbit-key: YOUR_KEY" \
--header "sunbit-secret: YOUR_SECRET" \
--data '{
"transactionId": "23259d52f67fb8",
"purchaseId": "39325178",
"location": "retailer4"
}'
Response
{
"purchaseId": "39325178",
"changedAmount": 490
}