API reference
Card capture
Endpoints for merchant-owned card checkout. They require activation for your merchant and environment; hosted checkout does not use them.
Prepare card capture
/v1/payments/{id}/captureReturns short-lived, write-only access to capture one card for this payment directly at the card vault. Preparation never charges. Payments without card capture enabled return 404.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Responses
Merchant and environment scoped custom checkout state and capture coordinates.
dataobjectpaymentIdstring <uuid>amountCentsinteger500–100000000currencystringAlways
USDreferencestring1–255 charsstatusstringOne of
openprocessingrequiresActionpaidfailed_retryableexpiredexpiresAtstring <date-time>attemptsLeftinteger0–5environmentstringImmutable 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
sandboxlivepciConfigobjectproviderstringAlways
pciVaultcaptureUrlstring <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.
vaultIdstring1–31 charsRandom payment-scoped capture reference; never your order reference. The server-owned dedicated vault key establishes payment isolation.
allowedOriginstring <uri>iframeUrlstring <uri>optional1–2048 charsPresent only with a hosted form configured for the merchant checkout origin. Direct capture credentials are returned by POST capture.
terminalReasonstringoptionalWhy a checkout closed. A provider failure is not a local link timeout.
One of
checkout_expiredattempts_exhaustedprovider_failedactionUrlstring <uri>optional1–2048 charsOpen in the customer browser only when payment requiresAction; existing checkout resumes the challenge without card collection.
captureobjectoptionalurlstring <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.
secretstring16–4096 charsWrite-only capture secret. Keep on your backend; never log.
referencestring1–31 charsexpiresAtstring <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
Checkout can no longer accept payment work.
Error codescheckout_expiredattempts_exhausted
errorobjectcodestringOne of
checkout_expiredattempts_exhaustedmessagestring
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/capture" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": {
"paymentId": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"amountCents": 1500,
"currency": "USD",
"reference": "order-1042",
"status": "open",
"expiresAt": "2026-10-11T12:30:00Z",
"attemptsLeft": 5,
"environment": "sandbox",
"capture": {
"url": "https://capture.example/v1/capture/example",
"secret": "<capture secret, keep server-side>",
"reference": "cap_9fQx2LwM",
"expiresAt": "2026-10-11T12:10:00Z"
},
"pciConfig": {
"provider": "pciVault",
"captureUrl": "https://capture.example/v1/capture/example",
"vaultId": "cap_9fQx2LwM",
"allowedOrigin": "https://shop.example.com"
}
}
}Retrieve the card checkout
/v1/payments/{id}/checkoutReturns the card checkout of a capture payment: amount, status, attempts left, and the actionUrl to open in the customer’s browser when an action is required.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Responses
Merchant and environment scoped custom checkout state and capture coordinates.
dataobjectpaymentIdstring <uuid>amountCentsinteger500–100000000currencystringAlways
USDreferencestring1–255 charsstatusstringOne of
openprocessingrequiresActionpaidfailed_retryableexpiredexpiresAtstring <date-time>attemptsLeftinteger0–5environmentstringImmutable 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
sandboxlivepciConfigobjectproviderstringAlways
pciVaultcaptureUrlstring <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.
vaultIdstring1–31 charsRandom payment-scoped capture reference; never your order reference. The server-owned dedicated vault key establishes payment isolation.
allowedOriginstring <uri>iframeUrlstring <uri>optional1–2048 charsPresent only with a hosted form configured for the merchant checkout origin. Direct capture credentials are returned by POST capture.
terminalReasonstringoptionalWhy a checkout closed. A provider failure is not a local link timeout.
One of
checkout_expiredattempts_exhaustedprovider_failedactionUrlstring <uri>optional1–2048 charsOpen in the customer browser only when payment requiresAction; existing checkout resumes the challenge without card collection.
captureobjectoptionalurlstring <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.
secretstring16–4096 charsWrite-only capture secret. Keep on your backend; never log.
referencestring1–31 charsexpiresAtstring <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/checkout" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": {
"paymentId": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"amountCents": 1500,
"currency": "USD",
"reference": "order-1042",
"status": "open",
"terminalReason": "checkout_expired",
"expiresAt": "2026-10-11T12:00:00Z",
"attemptsLeft": 5,
"environment": "sandbox",
"actionUrl": "https://wegopay.tech/c/wgp_chk_example",
"capture": {
"url": "https://shop.example.com",
"secret": "string",
"reference": "order-1042",
"expiresAt": "2026-10-11T12:00:00Z"
},
"pciConfig": {
"provider": "pciVault",
"captureUrl": "https://shop.example.com",
"vaultId": "string",
"allowedOrigin": "https://shop.example.com",
"iframeUrl": "https://shop.example.com"
}
}
}Submit a card token
/v1/payments/{id}/paySubmits the token and reference returned by the card vault. The response is the result of this attempt: paid, requiresAction or failed. A 409 or 503 can mean the attempt is still processing; poll the status before doing anything else.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Request body
cardTokenrequiredstring16–4096 charscaptureReferencerequiredstring1–31 charsMust equal the server-issued payment capture reference and the vault capture result reference.
Responses
Paid, repeated customer action, or definitive retryable failure.
dataone ofVariant
paidstatusstringAlways
paidpaymentIdstring <uuid>
Variant
requiresActionstatusstringAlways
requiresActionpaymentIdstring <uuid>clientSecretstring1–2048 charspublishableKeystring1–255 chars
Variant
failedstatusstringAlways
failedpaymentIdstring <uuid>failureCodestring1–128 charsmessagestring1–500 charsattemptsLeftinteger0–5
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
Checkout can no longer accept payment work.
Error codescheckout_expiredattempts_exhausted
errorobjectcodestringOne of
checkout_expiredattempts_exhaustedmessagestring
The hosted-fields provider rejected or cannot use the opaque token.
Error codescard_token_rejected
errorobjectcodestringAlways
card_token_rejectedmessagestring
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/pay" \
-H "Authorization: Bearer $WEGOPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cardToken": "EXAMPLE_CARD_TOKEN_FROM_CAPTURE",
"captureReference": "cap_9fQx2LwM"
}'{
"data": {
"status": "requiresAction",
"paymentId": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55"
}
}Confirm a customer action
/v1/payments/{id}/confirmConfirms the current customer action after the customer completes it. Only for approved custom action handling; the page at actionUrl already does this.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Request body
object
Responses
Paid, repeated customer action, or definitive retryable failure.
dataone ofVariant
paidstatusstringAlways
paidpaymentIdstring <uuid>
Variant
requiresActionstatusstringAlways
requiresActionpaymentIdstring <uuid>clientSecretstring1–2048 charspublishableKeystring1–255 chars
Variant
failedstatusstringAlways
failedpaymentIdstring <uuid>failureCodestring1–128 charsmessagestring1–500 charsattemptsLeftinteger0–5
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
No confirmable action or existing confirmation/result fence.
Error codesconfirmation_not_requiredconfirmation_in_progressresult_pending
errorobjectcodestringOne of
confirmation_not_requiredconfirmation_in_progressresult_pendingmessagestring
Checkout can no longer accept payment work.
Error codescheckout_expiredattempts_exhausted
errorobjectcodestringOne of
checkout_expiredattempts_exhaustedmessagestring
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/confirm" \
-H "Authorization: Bearer $WEGOPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'{
"data": {
"status": "paid",
"paymentId": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55"
}
}Retrieve checkout status
/v1/payments/{id}/statusReturns the checkout state, attempts left and any pending customer action. Poll it with backoff while a capture payment is processing.
Auth Secret API key as Authorization: Bearer. Call from your server only.
Path parameters
idrequiredstring <uuid>
Responses
Exact durable checkout status.
dataobjectpaymentIdstring <uuid>statusstringOne of
openprocessingrequiresActionpaidfailed_retryableexpiredattemptsLeftinteger0–5expiresAtstring <date-time>actionone ofcan be nullPresent only while status is requiresAction; null for every other status.
Variant
threeDSkindstringAlways
threeDSclientSecretstring1–2048 charsDecrypted only for the current requiresAction fence so a checkout can resume after reload.
publishableKeystring1–255 chars
Variant
walletkindstringAlways
walletcheckoutUrlstring <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>
terminalReasonstringoptionalWhy a checkout closed. A provider failure is not a local link timeout.
One of
checkout_expiredattempts_exhaustedprovider_failed
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/status" \
-H "Authorization: Bearer $WEGOPAY_API_KEY"{
"data": {
"paymentId": "7d5c2f1e-4b8a-4c3e-9f21-6a0b8e4d1c55",
"status": "processing",
"attemptsLeft": 4,
"expiresAt": "2026-10-11T12:30:00Z",
"action": null
}
}