RefundServiceoperates on a specific payment ID — pass the payment ID when callingcreate.
Methods
| Method | Description |
|---|---|
create(paymentId, refund) | Refund a payment |
Create a refund
Full refund
Omitamount to refund the full payment:
Partial refund
Passamount to refund a specific amount:
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | No | Amount to refund. Omit for a full refund. |
metadata | Record<string, any> | No | Custom metadata attached to the refund |
Response data
| Field | Type | Description |
|---|---|---|
id | string | Refund ID |
status | string | Refund status (e.g., "created") |
type | "refund" | Always "refund" |
amount | number | Refunded amount |
provider | string | Provider that processed the refund |