Overview
This guide covers the Superpayments server-to-server integration with DekoPay for Newpay. It includes authentication, checkout creation, status retrieval, cancellation, refunds and webhook notifications.
See the API reference for request and response schemas, examples and the webhook contract.
All DekoPay examples use the preproduction base URL https://api.preprod.deko.dekopay.com. Use the preproduction merchant credentials supplied during onboarding. Keep credentials and bearer tokens on your server.
Integration flow
- Call
POST /authwith yourclient_idandclient_secret. Cache the returned access token for itsexpires_inlifetime. - Call
POST /transactionwith your bearer token, a UUIDIdempotency-Key, a unique merchantreference,product: newpay, the basket and your HTTPScallbackUri. Reuse the idempotency key only when retrying the same creation request. - Keep your merchant reference and the returned checkout self link. Creating a transaction returns checkout details, not a standalone transaction ID field. The final segment of
_links.self.hrefis the Deko order UUID. - Receive status updates at your
callbackUri, then retrieve the latest state usingGET /transaction/{reference}. - To cancel or refund, use
PATCH /transaction/{reference}/{action}. Actions use PATCH, not POST, and depend on the checkout’s state and merchant permissions. A refund request usesactionType: REFUNDandoptions.refundAmountin pence.
Retrieval and actions use your merchant reference, not the Deko order UUID. URL-encode the reference as a path segment. A successful HTTP response to creation does not mean payment has completed.
This integration manages checkouts; it does not replace the consumer’s Newpay credit application journey. Agree that journey as part of onboarding before relying on an API-only management integration.
Supported channels
channelName accepts the following case-sensitive values. The aliases select the same channel as their canonical value; they are not additional channel types.
| Canonical value | Accepted alias | initialisedBy required |
|---|---|---|
UNASSISTED |
ONLINE |
No |
ASSISTED |
INSTORE |
Yes, as an email identifier |
BROKER |
None | Yes, as an email identifier |
If channelName is omitted, the API uses UNASSISTED. All five strings above are supported by the API.
Checkout status webhook
DekoPay sends an HTTP POST with Content-Type: application/json to the callbackUri supplied when you create the checkout. This endpoint is hosted by Superpayments, not DekoPay. For example, your callback destination might be https://superpayments.example/deko/callback.
The API reference defines this notification in its OpenAPI 3.1 webhooks section and links the same definition to POST /transaction using the callbackUri callback expression.
Example successful checkout notification:
{
"id": "d81fc604-f089-455e-b7c4-43b43399f211",
"reference": "SP-CHECKOUT-100001",
"productType": "NEWPAY",
"status": "SUCCESSFUL",
"reason": null,
"statusLastUpdated": "2026-11-04T15:15:00Z",
"receipt": "SIGNED_DEKO_RECEIPT_JWT"
}| Field | Meaning |
|---|---|
id |
Deko order UUID. |
reference |
Your merchant reference supplied at creation. |
productType |
NEWPAY for this integration. |
status |
Uppercase order state, such as PENDING, SUCCESSFUL, FAILED, PART_REFUNDED or FULL_REFUNDED. This is not an exhaustive list. |
reason |
Optional reason derived from the application’s sub-status; may be absent or null. |
statusLastUpdated |
ISO 8601 timestamp of the order status update. |
receipt |
Compact signed JWT containing the application receipt; the example is a placeholder, not a usable token. |
Callback order states differ from the public checkout status returned by transaction retrieval. For example, a callback may report FULL_REFUNDED, while retrieval reports fully refunded. The signed receipt has its own status vocabulary. Use authenticated retrieval to confirm the latest checkout state.
Acknowledgement and recovery
Return a 2xx response promptly after safely accepting a notification; no response body is required. Failed deliveries are retried. Handle duplicate and out-of-order notifications idempotently and compare statusLastUpdated timestamps.
Reconcile missed updates with GET /transaction/{reference}. Do not blindly retry a cancellation or refund after an ambiguous timeout: retrieve the transaction and reconcile first. The creation idempotency contract does not apply to actions.
Receipt verification
DekoPay includes the signed JWT in receipt; it does not send your merchant bearer token or a Deko-Signature header with this webhook. Decoding the receipt is not signature verification.
Use the Deko public signing key matching the JWT header’s kid, obtained through the key-distribution mechanism agreed during onboarding. Validate the signature, approved algorithm, issuer, audience, expiry and merchant subject. The outer JSON fields are not themselves covered by the receipt signature. Confirm the current state through authenticated transaction retrieval before updating a checkout or releasing goods.