API reference
Payments
Create a payment with a hosted checkout session, then read its verified state. These are the only endpoints a standard hosted-checkout integration needs.
Create a payment
/v1/paymentsCreates a pending payment and its hosted checkout session. The session allows five card attempts and lasts about 30 minutes. Repeating a request with the same Idempotency-Key and body returns the original response instead of creating another payment.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Headers
Idempotency-Keyrequiredstring16–255 chars16 to 255 visible ASCII characters. Scope is authenticated merchant plus operation. Records are retained for twenty-four hours.
Request body
amountCentsrequiredinteger500–100000000currencyrequiredstringAlways
USDreferencerequiredstring1–255 charssuccessUrlrequiredstring <uri>1–2048 charsAbsolute URL parsed by a standards-compliant URL parser. Production permits HTTPS only. HTTP is accepted only when the hostname is exactly localhost, 127.0.0.1, or ::1 in development. Credentials and fragments are forbidden; hostnames are canonicalized before validation.
cancelUrlrequiredstring <uri>1–2048 charsAbsolute URL parsed by a standards-compliant URL parser. Production permits HTTPS only. HTTP is accepted only when the hostname is exactly localhost, 127.0.0.1, or ::1 in development. Credentials and fragments are forbidden; hostnames are canonicalized before validation.
paymentMethodstringOptional checkout restriction. Opens only this method and prevents switching. Must be enabled by the effective API-key and merchant settings, otherwise creation returns 422 validation_failed for paymentMethod. Omit to offer all configured methods. Custom card capture supports card only.
One of
cardwalletcheckoutModestringDefaults to hosted. Custom requires an enabled merchant capture integration. Prepare scoped access with POST capture, submit a token and captureReference, and open actionUrl in the customer browser when required.
One of
hostedcustomembeddingOriginstring1–255 charsExact approved website to embed this checkout. Required for embedding when the effective allowlist exceeds 20 sites. Omission preserves legacy embedding for lists up to 20 and otherwise permits hosted checkout only.
localestringWegopay checkout language. Omission on creation selects English. Provider-hosted content is controlled separately.
One of
enesptenvironmentstringImmutable provider account selection derived from the API key. Omit environment on creation or provide the same environment as the key; a mismatch is rejected. Test keys can only access sandbox payments and live keys can only access live payments.
One of
sandboxlivedisplayCurrencyobjectOptional price shown to the customer in another currency. The payment is still charged, refunded and settled in USD; checkout always states the USD charge. Wegopay computes the displayed amount once at creation, rounding half up to the currency's minor unit, and returns it with the number of decimals used; it never changes. Provider-hosted wallet pages may show their own conversion.
currencyrequiredstringActive ISO 4217 code other than USD. Unknown codes return 422 validation_failed for displayCurrency.currency.
raterequiredstringUnits of the display currency per 1 USD, as a decimal string, for example "5.42" to show USD 100.00 as BRL 542.00. Must be from 0.000001 to 1000000 and give a displayed amount of at least one minor unit.
customerobjectidstring1–191 charsYour stable identifier for this customer. Send the same value on every payment of the same customer. Payments are grouped into one customer profile by this ID, or by email when it is omitted, for the Customers page and customer block lists.
emailstring <email>≤ 320 charsnamestring1–255 charsdocumentNumberstringPayer document number for server-side wallet initiation.
phonestringPayer phone number for server-side wallet initiation.
metadataobject (free-form)≤ 100 keysMerchant-defined JSON object. The server measures canonical UTF-8 JSON, including keys and structural bytes, and rejects values over 16384 bytes. The limit is applied before persistence and is part of idempotency hashing.
Responses
Payment and checkout session created, or exact idempotent replay.
dataobjectidstring <uuid>statusstringAlways
pendingcheckoutUrlstring <uri>1–2048 charsAbsolute URL parsed by a standards-compliant URL parser. Production permits HTTPS only. HTTP is accepted only when the hostname is exactly localhost, 127.0.0.1, or ::1 in development. Credentials and fragments are forbidden; hostnames are canonicalized before validation.
expiresAtstring <date-time>environmentstringoptionalImmutable provider account selection derived from the API key. Omit environment on creation or provide the same environment as the key; a mismatch is rejected. Test keys can only access sandbox payments and live keys can only access live payments.
One of
sandboxlive
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
Idempotency key conflict or matching request still fenced.
Error codesidempotency_key_reusedidempotency_in_progress
errorobjectcodestringOne of
idempotency_key_reusedidempotency_in_progressmessagestring
Semantically invalid payment creation field, named in `field` with the broken rule in `message`. Without `field`, the merchant account cannot create this payment yet.
Error codesvalidation_failedvalidation_failed
errorobjectcodestringAlways
validation_failedmessagestringfieldstringoptional
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" \
-H "Authorization: Bearer $WEGOPAY_API_KEY" \
-H "Idempotency-Key: order-1042-create" \
-H "Content-Type: application/json" \
-d '{
"amountCents": 1500,
"currency": "USD",
"reference": "order-1042",
"successUrl": "https://shop.example.com/orders/1042",
"cancelUrl": "https://shop.example.com/cart",
"customer": {
"email": "jane@example.com",
"name": "Jane Doe"
},
"metadata": {
"orderId": "order-1042"
}
}'{
"data": {
"environment": "sandbox",
"id": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"status": "pending",
"checkoutUrl": "https://wegopay.tech/c/wgp_chk_example",
"expiresAt": "2026-10-11T12:30:00Z"
}
}Retrieve a payment
/v1/payments/{id}Retrieves a payment. This is the source of truth before you fulfill an order. Unknown IDs and payments of another merchant or environment return the same 404.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Responses
Merchant-scoped payment.
dataobjectidstring <uuid>referencestringstatusstringOne of
pendingrequiresActionpaidfailedrefundedpartiallyRefundeddisputeddisputeWondisputeLostmethodstringcan be nullOne of
cardwalletpixamountCentsinteger500–100000000refundedCentsinteger0–100000000netCentsinteger0–100000000currencystringAlways
USDcustomerobjectemailstring <email>can be null≤ 320 charsnamestringcan be null≤ 255 chars
metadataobject (free-form)≤ 100 keysMerchant-defined JSON object. The server measures canonical UTF-8 JSON, including keys and structural bytes, and rejects values over 16384 bytes. The limit is applied before persistence and is part of idempotency hashing.
checkoutUrlstring <uri>can be null1–2048 charsAbsolute URL parsed by a standards-compliant URL parser. Production permits HTTPS only. HTTP is accepted only when the hostname is exactly localhost, 127.0.0.1, or ::1 in development. Credentials and fragments are forbidden; hostnames are canonicalized before validation.
expiresAtstring <date-time>cardBinstringcan be nullIssuer prefix from authenticated PCI Vault capture matched to the verified attempt. Null when unavailable.
cardIssuerobjectcan be nullbankstringcan be null≤ 128 charscountryCodestringcan be nullcountryNamestringcan be null≤ 128 charstypestringcan be null≤ 128 charslevelstringcan be null≤ 128 charscategorystringcan be null≤ 128 charsregulatedstringcan be null≤ 128 chars
cardBrandstringcan be nullCard brand from verified provider status; also included in signed payment webhook data. Null when unavailable.
cardLast4stringcan be nullLast four card digits from verified provider status as a string preserving leading zeros; also included in signed payment webhook data. Null when unavailable. This is not a BIN/IIN; BIN/issuer metadata is separately available in cardBin and cardIssuer when PCI Vault capture metadata is configured.
failureCodestringcan be nullfailureMessagestringcan be nullcreatedAtstring <date-time>paidAtstring <date-time>can be nullrefundedAtstring <date-time>can be nullenvironmentstringoptionalImmutable provider account selection derived from the API key. Omit environment on creation or provide the same environment as the key; a mismatch is rejected. Test keys can only access sandbox payments and live keys can only access live payments.
One of
sandboxlivedisplayCurrencyobjectoptionalPresent only when the payment was created with a display currency.
currencystringratestringUnits of the display currency per 1 USD, exactly as supplied.
amountMinorinteger≥ 1Displayed amount in minor units; divide by 10^minorUnits for the major-unit value.
minorUnitsinteger0–4Decimal places Wegopay used for this currency, fixed at creation (for example 2 for BRL, 0 for CLP). Format the amount with exactly this many decimals.
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" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": {
"environment": "sandbox",
"id": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"reference": "order-1042",
"status": "paid",
"method": "card",
"amountCents": 1500,
"refundedCents": 0,
"netCents": 1500,
"currency": "USD",
"customer": {
"email": "jane@example.com",
"name": "Jane Doe"
},
"metadata": {
"orderId": "order-1042"
},
"checkoutUrl": "https://wegopay.tech/c/wgp_chk_example",
"expiresAt": "2026-10-11T12:30:00Z",
"cardBrand": "visa",
"cardBin": "424242",
"cardIssuer": null,
"cardLast4": "4242",
"failureCode": null,
"failureMessage": null,
"createdAt": "2026-10-11T12:00:00Z",
"paidAt": "2026-10-11T12:01:12Z",
"refundedAt": null
}
}List payments
/v1/paymentsLists the payments of your key’s merchant and environment, newest first. Date filters apply to createdAt as inclusive UTC dates. A page past the end returns an empty list.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Query parameters
statusstringOne of
pendingrequiresActionpaidfailedrefundedpartiallyRefundeddisputeddisputeWondisputeLostfromstring <date>Inclusive UTC createdAt date. Must not be after to.
tostring <date>Inclusive UTC createdAt date. Must not be before from.
pageinteger≥ 1Default
1perPageinteger1–100Default
20
Responses
Merchant-scoped payment page.
dataarray of objectidstring <uuid>referencestringstatusstringOne of
pendingrequiresActionpaidfailedrefundedpartiallyRefundeddisputeddisputeWondisputeLostmethodstringcan be nullOne of
cardwalletpixamountCentsinteger500–100000000refundedCentsinteger0–100000000netCentsinteger0–100000000currencystringAlways
USDcustomerobjectemailstring <email>can be null≤ 320 charsnamestringcan be null≤ 255 chars
metadataobject (free-form)≤ 100 keysMerchant-defined JSON object. The server measures canonical UTF-8 JSON, including keys and structural bytes, and rejects values over 16384 bytes. The limit is applied before persistence and is part of idempotency hashing.
checkoutUrlstring <uri>can be null1–2048 charsAbsolute URL parsed by a standards-compliant URL parser. Production permits HTTPS only. HTTP is accepted only when the hostname is exactly localhost, 127.0.0.1, or ::1 in development. Credentials and fragments are forbidden; hostnames are canonicalized before validation.
expiresAtstring <date-time>cardBinstringcan be nullIssuer prefix from authenticated PCI Vault capture matched to the verified attempt. Null when unavailable.
cardIssuerobjectcan be nullbankstringcan be null≤ 128 charscountryCodestringcan be nullcountryNamestringcan be null≤ 128 charstypestringcan be null≤ 128 charslevelstringcan be null≤ 128 charscategorystringcan be null≤ 128 charsregulatedstringcan be null≤ 128 chars
cardBrandstringcan be nullCard brand from verified provider status; also included in signed payment webhook data. Null when unavailable.
cardLast4stringcan be nullLast four card digits from verified provider status as a string preserving leading zeros; also included in signed payment webhook data. Null when unavailable. This is not a BIN/IIN; BIN/issuer metadata is separately available in cardBin and cardIssuer when PCI Vault capture metadata is configured.
failureCodestringcan be nullfailureMessagestringcan be nullcreatedAtstring <date-time>paidAtstring <date-time>can be nullrefundedAtstring <date-time>can be nullenvironmentstringoptionalImmutable provider account selection derived from the API key. Omit environment on creation or provide the same environment as the key; a mismatch is rejected. Test keys can only access sandbox payments and live keys can only access live payments.
One of
sandboxlivedisplayCurrencyobjectoptionalPresent only when the payment was created with a display currency.
currencystringratestringUnits of the display currency per 1 USD, exactly as supplied.
amountMinorinteger≥ 1Displayed amount in minor units; divide by 10^minorUnits for the major-unit value.
minorUnitsinteger0–4Decimal places Wegopay used for this currency, fixed at creation (for example 2 for BRL, 0 for CLP). Format the amount with exactly this many decimals.
metaobjectpageinteger≥ 1perPageinteger1–100totalinteger≥ 0
Invalid date, pagination, status, or from/to relation.
Error codesinvalid_query
errorobjectcodestringAlways
invalid_querymessagestring
Missing, malformed, unknown, revoked, or disabled-merchant API key.
Error codesunauthorized
HeadersWWW-Authenticate
errorobjectcodestringAlways
unauthorizedmessagestring
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?status=paid&page=1&perPage=20" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": [
{
"environment": "sandbox",
"id": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"reference": "order-1042",
"status": "paid",
"method": "card",
"amountCents": 1500,
"refundedCents": 0,
"netCents": 1500,
"currency": "USD",
"customer": {
"email": "jane@example.com",
"name": "Jane Doe"
},
"metadata": {
"orderId": "order-1042"
},
"checkoutUrl": "https://wegopay.tech/c/wgp_chk_example",
"expiresAt": "2026-10-11T12:30:00Z",
"cardBrand": "visa",
"cardBin": "424242",
"cardIssuer": null,
"cardLast4": "4242",
"failureCode": null,
"failureMessage": null,
"createdAt": "2026-10-11T12:00:00Z",
"paidAt": "2026-10-11T12:01:12Z",
"refundedAt": null
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}