Refunds: Create
Request
POST https://api.univapay.com/stores/{storeId}/charges/{chargeId}/refunds
Parameters:
Parameters | |
amount | number [Required] The amount to refund. Must be less than or equal to the amount that was charged. |
currency | string (ISO-4217) [Required] Currency of the refund. |
reason | string The reason of its refund request. Must be one of fraud , duplicate , or customer_request . |
message | string Further information for why the refund was made. |
metadata | json Any metadata to associate with the refund. |
Headers:
Content-Type: application/json
Authorization: Bearer {secret}.{jwt}
Body:
curl --request POST \
--url https://api.univapay.com/stores/f1054498-18f3-11e7-93ff-bb609c8f3ef7/charges/f96eeb3e-18f3-11e7-93ff-1fbf78b8196b/refunds \
--header 'Authorization: Bearer {secret}.{jwt}' \
--header 'content-type: application/json' \
--data '{
"amount": 250,
"currency": "USD",
"reason": "customer_request",
"message": "15 percent off",
"metadata": {
"coupon": "VIP007"
}
}'
Response
Code: 201
Headers:
Content-Type: application/json
Body:
{
"id": "72491cc0-1906-11e7-82f4-230e1180f31c",
"charge_id": "f96eeb3e-18f3-11e7-93ff-1fbf78b8196b",
"status": "pending",
"amount": 250,
"currency": "USD",
"amount_formatted": 2.5,
"reason": "customer_request",
"message": "15 percent off",
"error": null,
"metadata": {
"coupon": "VIP007"
},
"mode": "test",
"created_on": "2018-07-13T02:55:00.07367Z"
}