Update Refund
Update the metadata or reason of an existing refund.
POST
https://api.uprails.com/refunds/:refund_idUpdates the specified refund by setting the values of the parameters passed. Only certain properties can be updated after a refund is created.
Limitations
You cannot update the
amount or payment_id of a refund after it has been created. To change the refund amount, cancel the existing refund and create a new one.Path Parameters
| Parameter | Type | Description |
|---|---|---|
refund_id | string | Required. The ID of the refund to update. |
Request Example
Update Refund
curl -X POST https://api.uprails.com/refunds/ref_1234567890abcdef \
-H "Content-Type: application/json" \
-H "api-key: snd_YOUR_API_KEY" \
-d '{
"reason": "duplicate",
"metadata": {
"order_id": "12345",
"updated_reason": "Duplicate charge identified"
}
}'Request Body
reasonstringUpdated reason for the refund
Enum:
requested_by_customerduplicatefraudulentmetadataobjectSet of key-value pairs for storing additional information
Response
200OK
{
"refund_id": "ref_1234567890abcdef",
"payment_id": "pay_abcdef1234567890",
"merchant_id": "mer_xyz789",
"status": "pending",
"amount": 500,
"currency": "USD",
"reason": "duplicate",
"metadata": {
"order_id": "12345",
"updated_reason": "Duplicate charge identified"
},
"created": "2024-01-15T14:30:00Z",
"updated": "2024-01-15T15:00:00Z"
}