Skip to main content
Verification is the step that turns “something happened” into “this order is paid”. Webhooks and browser callbacks tell you to look. Verify is the authoritative answer. It is a single authenticated GET from your server that returns the current state of one payment as Vestrapay records it. Never fulfil an order from a callback URL, a webhook body or a client-side result alone. Always call verify with your secret key and decide from its response.

The request

Look up a payment by the reference that initialise returned, which has the form VPY_TXN_….
Authorization: Bearer with the same secret key also works. Use the key and host of the environment where the payment was created. A sandbox reference cannot be verified on live, and the reverse, and returns transaction.not_found.

The response

Payment statuses

Only success means paid. Treat anything else as not paid, and do not guess from the channel or from timing.

The fulfilment decision

Fulfil when both conditions hold:
  1. data.status is success.
  2. data.amount equals the amount you expected for that order.
If the status is success but the amount differs, do not fulfil. Hold the order and investigate, because the payment may belong to a different order or to a tampered request. Compare amounts as strings or decimals, never as binary floats.

Idempotent fulfilment

Webhooks are retried and customers reload callback pages. Your fulfilment code will run more than once for the same payment. Design for that.
  1. Load the order by reference.
  2. If it is already marked paid, return HTTP 200 and stop.
  3. Call verify. If the payment is success and the amount matches, mark the order paid and fulfil in a single atomic step, using a database transaction, a conditional update or a unique constraint.
Return a 2xx to the webhook as soon as the signal is queued. Do the verify and fulfilment in the worker, not in the request handler.

Splits on verify

When the payment was initialised with a distribution, verify includes a split object once the payment has been allocated. Allocation follows success by a short moment, so a verify call made in the first instant after payment may not yet include it. The payment is still success and safe to fulfil.
The allocation rules are explained on Distribution.

Errors and retries

If a payment stays pending or processing for longer than you expect, keep it in a waiting state rather than failing the order. Webhooks and later verify calls will reflect the final outcome. For anything that looks stuck, contact tech@vestrapay.com with the reference.

Checkout helpers

The access-code endpoints GET /v1/payment/checkout/status, GET /v1/payment/checkout/verify and GET /v1/payment/checkout/events are for pay screens that want to show progress. They are not a substitute for your server’s secret-key verify before fulfilling.