Developers
Webhooks and errors
Set up and verify webhooks, and handle API errors.
How do I set up webhooks?
Send us your webhook endpoint and we'll set it up for you. You can't add or change endpoints yourself in the developer portal yet.
- Prepare an HTTPS endpoint that accepts POST requests and replies with a success status quickly.
- Email your endpoint URLs for the sandbox and for production to your PEXX contact, or to support@pexx.com.
- We set them up and share your signing secret with you over a secure channel.
The response time we expect and the full payload formats are in the webhooks guide.
How do I verify a webhook signature?
Recalculate the signature with your signing secret and compare it with the one in the X-Webhook-Signature header. Process the event only if they match.
- Take the X-Webhook-Timestamp header, a full stop and the raw request body, exactly as received.
- Calculate an HMAC of that text with your signing secret, using the algorithm in the webhooks guide.
- Compare your result with the value in X-Webhook-Signature using a constant-time comparison.
- Reject the request if the timestamp is too far from your server's time.
Use the raw body: if you parse and re-serialise the JSON first, the signature won't match. Details and code samples are in the webhooks guide.
Which webhook events will I receive?
You receive every event type we send for your account. Choosing individual events isn't available yet.
- payout.updated: a payout reached a final status: PAID, CANCELLED or REVERSED.
- deposit.created and deposit.updated: a deposit was detected, then received or cancelled. Deposit events are turned on per merchant, so ask your PEXX contact.
- rfi.requested and rfi.updated: a request for information was opened or changed.
After you receive a payout.updated event, confirm the status with the payout query endpoint. Payload details are in the API docs.
What if my endpoint misses a webhook, or gets the same one twice?
Query the API. If your endpoint is down or doesn't reply with a success status in time, we retry the event several times with growing gaps, then mark it as failed and stop. The payout query endpoint always has the current status.
- The same event can arrive more than once. Store each X-Webhook-Event-Id and skip events you've already handled.
- Events can arrive out of order. Use the occurred_at_ms field and never overwrite a final status with an older one.
- If you think you've missed events, query each open payout with the payout query endpoint and update your records from the response.
The exact retry schedule is in the webhooks guide.
Open as a page: What if my endpoint misses a webhook, or gets the same one twice?
What do API error codes mean?
Every response has a code, a msg and a data field. The code tells you whether the request succeeded; the full list of codes and their meanings is in the response and error codes reference.
- Branch your logic on the code, not on the msg text. The msg is for troubleshooting only.
- If the request is rejected with a client error, it didn't happen. Fix it and try again.
- If you get a server error or no response, the outcome is unknown. Query the payout before doing anything else.
- If the response says the system is under maintenance, the request wasn't carried out. Try again later.
When you contact support@pexx.com about an error, include the X-Trace-Id value from the response header, the endpoint and the time of the request.
Contact
Still stuck?
Talk to a person. We'll never ask for your passcode, one-time codes or full card details.
PEXX API
Start with the docs
Guides and the API reference are at docs.pexx.com. For your integration, email us with your business name and the request or payout reference.