Create refund for payment
Creates a refund against an existing captured payment. The paymentId is taken from the URL path. Omit amount to refund the full remaining capturable amount, or specify a partial amount when the routed provider supports partial refunds. Provider capabilities apply: Ecommpay currently permits one lifetime full refund per payment and rejects partial or subsequent refunds. Pass an Idempotency-Key header to safely retry without double-refunding.
Authorization
bearer In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://<api-host>/v1/payments/string/refund" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
"livemode": true,
"paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7",
"status": "pending",
"amount": {
"currency": "string",
"valueMinor": 9007199254740991
},
"reason": "string",
"merchantReference": "string",
"statusReason": "string",
"items": [
{
"id": "string",
"productId": "string",
"label": "string",
"description": "string",
"imageUrl": "string",
"unitAmount": {
"currency": "string",
"valueMinor": 9007199254740991
},
"quantity": 1,
"taxRate": 0,
"taxAmount": {
"currency": "string",
"valueMinor": 9007199254740991
},
"metadata": {
"property1": "string",
"property2": "string"
}
}
],
"metadata": {
"property1": "string",
"property2": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
}Resolve a payment amount mismatch
Idempotently accepts the provider-confirmed amount or retains the originally requested amount, then atomically finalizes the already provider-succeeded payment. Cross-currency reviews can only retain the requested amount. Operator/owner permission only.
Get refund by ID
Returns details for a single refund, including its current lifecycle status and link back to the originating payment. Soft-deleted refunds are not returned.