Skip to content
gist.link ↗

refundPayment

Mutation Pay API — POST https://pay.api.gist.link/graphql

Refund a succeeded payment (fully when amount is omitted). Idempotent: pass the same idempotencyKey to retry safely. ROLE_ADMIN or ROLE_PAY_MANAGER.

pay:mutation:refundPayment

The calling IAM key must hold this permission (or a wildcard that covers it: pay:mutation:* or pay:*) and the access token must have been minted with audience=pay. See Permissions.

type Mutation {
refundPayment(paymentId: String!, amount: Int, reason: String, idempotencyKey: String): Refund!
}
Argument Type Required Description
paymentId String! Yes —
amount Int No —
reason String No —
idempotencyKey String No —

Refund! — see the Pay types reference.

Terminal window
curl https://pay.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation RefundPayment($paymentId: String!, $amount: Int, $reason: String, $idempotencyKey: String) { refundPayment(paymentId: $paymentId, amount: $amount, reason: $reason, idempotencyKey: $idempotencyKey) { id uuid amount currency status created_at updated_at } }",
"variables": {
"paymentId": "example",
"amount": 10,
"reason": "example",
"idempotencyKey": "example"
}
}
JSON