Skip to content

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

GET/v1/payments/{id}/refund

Returns 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.

  • dataobject
    • eligibleboolean
    • remainingCentsinteger≥ 0
    • refundedCentsinteger≥ 0
    • requestobjectcan be null
      • idstring <uuid>
      • amountCentsinteger≥ 1
      • statusstring

        One ofsubmittingunknownpendingsucceededfailedcanceledrequires_action

      • createdAtstring <date-time>

See errors and idempotency for how to handle each error code.

Request
curl "https://api.wegopay.tech/v1/payments/7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55/refund" \
  -H "Authorization: Bearer $WEGOPAY_API_KEY"
Response
{
  "data": {
    "eligible": true,
    "remainingCents": 1500,
    "refundedCents": 0,
    "request": null
  }
}

Create a refund

POST/v1/payments/{id}/refund

Refunds 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 application/json

  • expectedAmountCentsrequiredinteger1–100000000

    Verified remaining balance shown at confirmation; used as a duplicate and stale-state guard.

  • amountCentsinteger1–100000000

    Amount 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.

  • dataobject
    • eligibleboolean
    • remainingCentsinteger≥ 0
    • refundedCentsinteger≥ 0
    • requestobjectcan be null
      • idstring <uuid>
      • amountCentsinteger≥ 1
      • statusstring

        One ofsubmittingunknownpendingsucceededfailedcanceledrequires_action

      • createdAtstring <date-time>

See errors and idempotency for how to handle each error code.

Request
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
  }'
Response
{
  "data": {
    "eligible": true,
    "remainingCents": 1500,
    "refundedCents": 0,
    "request": {
      "id": "40000000-0000-4000-8000-000000000001",
      "amountCents": 500,
      "status": "pending",
      "createdAt": "2026-10-11T13:00:00Z"
    }
  }
}