Refund a payment

Issues a refund against the payment identified by the path id. Omit amount to refund the full captured amount, or supply a positive integer (cents) for a partial refund. Pass an idempotency-key header to make the refund safe to retry; it is forwarded to the engine.

Authentication

x-api-keystring

A scoped MvsPayApiKey, e.g. mvspay_live_…. Mint and scope keys from the dashboard (Settings → API Keys).

Path parameters

idstringRequired

The payment id (Hyperswitch payment_intent id) to refund.

Headers

idempotency-keystringOptional

Client-supplied idempotency key; forwarded to the engine to make retries safe.

Request

This endpoint expects an object.
amountintegerOptional

Positive integer (cents) for a partial refund. Omit to refund the full captured amount.

reasonstringOptional

Free-text refund reason forwarded to the engine.

metadatamap from strings to anyOptional

Arbitrary key/value pairs forwarded to the engine.

Response

The created refund (returned under refund).

refundobject

A refund as modeled by the payments engine. Loosely typed; extra Hyperswitch fields pass through. All amount fields are minor units (cents).

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error
502
Bad Gateway Error