API reference
Refunds
Refund all or part of a paid payment from your server. Each refund is guarded by the verified remaining balance you reviewed.
Retrieve refund status
/v1/payments/{id}/refundReturns refund eligibility, the verified refunded and remaining amounts, and the latest refund request (null before the first refund).
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Responses
Merchant-safe refund request state; provider identifiers and credentials are never returned.
dataobjecteligiblebooleanremainingCentsinteger≥ 0refundedCentsinteger≥ 0requestobjectcan be nullidstring <uuid>amountCentsinteger≥ 1statusstringOne of
submittingunknownpendingsucceededfailedcanceledrequires_actioncreatedAtstring <date-time>
Malformed path, header, or strict JSON request.
Error codesinvalid_request
errorobjectcodestringAlways
invalid_requestmessagestring
Missing, malformed, unknown, revoked, or disabled-merchant API key.
Error codesunauthorized
HeadersWWW-Authenticate
errorobjectcodestringAlways
unauthorizedmessagestring
Unknown or unauthorized resource/token, without existence disclosure.
Error codesnot_found
errorobjectcodestringAlways
not_foundmessagestring
Rate limit exceeded without starting payment work.
Error codesrate_limited
HeadersRetry-After
errorobjectcodestringAlways
rate_limitedmessagestring
Required persistence, encryption, hosted-fields, or payment processing dependency unavailable.
Error codesservice_unavailable
errorobjectcodestringAlways
service_unavailablemessagestring
See errors and idempotency for how to handle each error code.
curl "https://api.wegopay.tech/v1/payments/7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55/refund" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": {
"eligible": true,
"remainingCents": 1500,
"refundedCents": 0,
"request": null
}
}Create a refund
/v1/payments/{id}/refundRefunds all or part of the remaining paid amount. Send expectedAmountCents equal to the remainingCents you reviewed. Repeating the same balance and amount returns the same request; a different amount or an outdated balance returns 409.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Request body
expectedAmountCentsrequiredinteger1–100000000Verified remaining balance shown at confirmation; used as a duplicate and stale-state guard.
amountCentsinteger1–100000000Amount to refund, at most expectedAmountCents. Omit to refund the full remaining balance.
Responses
Merchant-safe refund request state; provider identifiers and credentials are never returned.
dataobjecteligiblebooleanremainingCentsinteger≥ 0refundedCentsinteger≥ 0requestobjectcan be nullidstring <uuid>amountCentsinteger≥ 1statusstringOne of
submittingunknownpendingsucceededfailedcanceledrequires_actioncreatedAtstring <date-time>
Malformed path, header, or strict JSON request.
Error codesinvalid_request
errorobjectcodestringAlways
invalid_requestmessagestring
Missing, malformed, unknown, revoked, or disabled-merchant API key.
Error codesunauthorized
HeadersWWW-Authenticate
errorobjectcodestringAlways
unauthorizedmessagestring
Unknown or unauthorized resource/token, without existence disclosure.
Error codesnot_found
errorobjectcodestringAlways
not_foundmessagestring
Existing checkout fence prevents another charge attempt.
Error codespayment_in_progressaction_requiredresult_pending
errorobjectcodestringOne of
payment_in_progressaction_requiredresult_pendingmessagestring
Rate limit exceeded without starting payment work.
Error codesrate_limited
HeadersRetry-After
errorobjectcodestringAlways
rate_limitedmessagestring
Required persistence, encryption, hosted-fields, or payment processing dependency unavailable.
Error codesservice_unavailable
errorobjectcodestringAlways
service_unavailablemessagestring
See errors and idempotency for how to handle each error code.
curl -X POST "https://api.wegopay.tech/v1/payments/7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55/refund" \
-H "Authorization: Bearer $WEGOPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expectedAmountCents": 1500,
"amountCents": 500
}'{
"data": {
"eligible": true,
"remainingCents": 1500,
"refundedCents": 0,
"request": {
"id": "40000000-0000-4000-8000-000000000001",
"amountCents": 500,
"status": "pending",
"createdAt": "2026-10-11T13:00:00Z"
}
}
}