Skip to content
DigiStamp Pay, home

Pay

Developers

Take DigiByte and DigiDollar payments on your own site: a hosted checkout, signed webhooks and a sandbox. Payments go straight to your wallet.

Quick start

Pay is noncustodial: your customer pays from their own wallet straight to your DigiByte or DigiDollar address. Pay creates the payment request, watches the DigiByte blockchain and tells your server when the payment is confirmed. It never holds the money and never has your keys.

  1. Get a sandbox key. In your Pay dashboard, open Developers, create an application, register your shop's domain (for example shop.example.com) and create a sandbox key (dstest_...). It is shown once: keep it in your server's configuration.
  2. Create a checkout session on your server when the customer checks out:

Create a checkout session (curl)

curl https://pay.digistamp.co/api/pay/v1/checkout/sessions \
  -H "Authorization: Bearer $DIGISTAMP_PAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: checkout-order-1001" \
  -d '{
    "amount": "19.99",
    "currency": "USD",
    "order_ref": "order-1001",
    "description": "Order 1001",
    "success_url": "https://shop.example.com/thanks",
    "cancel_url": "https://shop.example.com/cart"
  }'
  1. Redirect the customer to the session's url (https://pay.digistamp.co/c/cs_...). They choose DGB or DigiDollar and pay there.
  2. Receive the webhook. Register a TEST webhook endpoint in the dashboard; Pay posts checkout.completed (and payment.confirmed) when the payment has the confirmations it needs. Verify the signature on the raw body (see Webhooks).
  3. Verify through the API. Fetch the session with your key and check it against your order:

Check a session against your order (curl)

curl https://pay.digistamp.co/api/pay/v1/checkout/sessions/cs_4fJkW2mQx9Lr7TbV0pZs1yNd \
  -H "Authorization: Bearer $DIGISTAMP_PAY_API_KEY"
  1. Fulfil once. Mark the order paid only when the session is complete, its payment status is confirmed or overpaid, and amount, currency and order_ref match. Record the event id so a repeated delivery does nothing.

The redirect proves nothing

The customer returns to your success URL with ?session_id=cs_... once the payment is confirmed, but anyone can open that URL. Show a "we're confirming your payment" page and fulfil only from the verified webhook or your own API check.

In the sandbox nothing real moves: complete the payment with the simulator (Sandbox). When it works, create a live key (dslive_...) and a LIVE webhook endpoint, and switch.

Authentication

Every request carries your secret key: Authorization: Bearer dslive_... (or the header X-Api-Key). The API reads no cookies.

  • Live and sandbox. dslive_... keys act on real payments; dstest_... keys reach only the sandbox. A key never sees the other mode's objects.
  • Applications. Keys belong to an application of your payment page. Its registered domains decide where checkout may send customers back to.
  • Shown once. Only a hash of the key is stored; nobody, DigiStamp included, can show it again. Creating or rotating a key needs a fresh Digi-ID sign-in.
  • Rotation. Rotating a key gives a new one with the same mode and scopes; the old one keeps working for a grace period you choose (0 to 168 hours, default 24). Revoking stops a key at once.
  • Rate limit. 120 requests a minute per key unless set otherwise; every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Over the limit: 429 with Retry-After. Repeated invalid keys from one address are refused for a while.

Scopes

A key holds only the scopes you give it. No scope can move money, change your receiving addresses, approve a refund destination or settle fees.

Scopes
ScopeAllowsSandbox
payments:readRead payment requests, their transactions, and eventsyes
payments:writeCreate and cancel payment requests (and simulate, in the sandbox)yes
checkout:writeCreate, read and expire hosted checkout sessionsyes
invoices:readRead invoicesno
invoices:writeCreate, send and cancel invoicesno
links:writeCreate payment linksno
receipts:readRead receiptsno
reports:readRead merchant reportsno
refunds:writeRecord a refund request (you still approve and send it from your own wallet)no

API reference

Base URL: https://pay.digistamp.co/api/pay/v1. JSON in (Content-Type: application/json, at most 64 KB), JSON out.

  • Amounts are strings, never floats: in a request a decimal like "19.99" or "125.5"; in an answer {"value": "19.99", "minor": "1999"} (DGB has 8 decimals and minor units are satoshis; USD and DigiDollar have 2 and minor units are cents).
  • Lists return {"object": "list", "data": [...], "has_more", "next_cursor"}, newest first. Pass limit (1 to 100, default 20) and starting_after=<next_cursor> for the next page.
  • Idempotency. Send Idempotency-Key (8 to 128 letters, digits or _ . : -) on every POST you might retry. The same key with the same body returns the first answer for 24 hours (with Idempotent-Replayed: true); with a different body it is refused (409 idempotency_key_reused); while the first is still running, 409 idempotency_in_progress. A 5xx frees the key so you can retry.
  • Request ids. Every answer has an X-Request-Id; errors repeat it as request_id. Quote it when you ask for help.
  • Ownership. A key reaches only its own payment page's objects; anything else is 404.
GET/v1

The key's application, mode and scopes. Use it to check a key works.

scope: any keylive and sandboxreturns 200: api
POST/v1/payments

A payment request (an address and an exact amount to pay), without a hosted checkout. With a sandbox key it is a test payment (id test_...).

scope: payments:writelive and sandboxreturns 201: payment
currency
Required. "DGB" or "DD" (DigiDollar).
amount
In the currency, as a decimal string ("125.5" DGB, "19.99" DD). Give exactly one of amount and amount_usd.
amount_usd
A US dollar amount ("19.99"), converted to DGB at the current price (DigiDollar: at face value).
description
Shown to the payer (plain text, up to 140 characters).
order_ref
Your reference, up to 120 characters. Never shown to the payer.
metadata
Up to 20 keys (letters, digits, _ . -; 40 characters) with text values of up to 500 characters. Never shown to the payer.
expires_in_minutes
10 to 10080.
customer_email
Optional; private to you.
GET/v1/payments

Your payments, newest first.

scope: payments:readlive and sandboxreturns 200: list of payments
limit
1 to 100 (default 20).
starting_after
The id of the last object of the previous page (its next_cursor).
status
awaiting_payment, detected, confirming, partially_paid, confirmed (includes overpaid), overpaid, expired (includes underpaid), reorged, needs_review or canceled.
order_ref
Only the payments with this reference.
GET/v1/payments/{id}

One payment, with its transactions and confirmation counts.

scope: payments:readlive and sandboxreturns 200: payment
GET/v1/payments/{id}/transactions

The payment's on-chain outputs (txid, vout, amount, state, confirmations).

scope: payments:readlive and sandboxreturns 200: list of transactions
GET/v1/payments/{id}/receipt

The receipt of a confirmed payment (404 receipt_not_issued before that).

scope: receipts:readlive keys onlyreturns 200: receipt
POST/v1/payments/{id}/cancel

Cancels a payment request that has received nothing.

scope: payments:writelive and sandboxreturns 200: payment
POST/v1/payments/{id}/simulate

Sandbox only: plays one simulated chain step on a test payment and emits the same events as a real one.

scope: payments:writesandbox keys onlyreturns 200: payment
action
Required. detect, confirm, partial, overpay, expire or reorg.
POST/v1/checkout/sessions

A hosted checkout session. Send the customer to its url.

scope: checkout:writelive and sandboxreturns 201: checkout.session
amount
Required. A decimal string in amount's currency. At least $1.00 for USD and DD.
currency
Required. "USD" (paid in DGB at the current price, or in DigiDollar at face value), "DGB" (paid in DGB only) or "DD" (paid in DigiDollar only).
accept
Optional list of "DGB" and/or "DD" the customer may pay with. Default for USD: both while DigiDollar is offered, else DGB.
success_url
Required. https, on one of your application's registered domains (or a subdomain of one). The customer returns here with ?session_id=cs_... once the payment is confirmed. Sandbox keys may also use http://localhost.
cancel_url
Optional, same rules. Also receives ?session_id=.
order_ref
Your order reference, up to 120 characters. Shown on the hosted page with the description.
description
Up to 300 characters, shown to the customer.
customer_email
Optional; private to you, never shown on the hosted page.
metadata
As for payments. Never shown to the customer.
expires_in_minutes
10 to 1440 (default 60). A USD amount paid in DGB is quoted for at most 30 minutes at a time.
GET/v1/checkout/sessions

Your checkout sessions of this mode, newest first.

scope: checkout:write or payments:readlive and sandboxreturns 200: list of checkout.session
limit
1 to 100 (default 20).
starting_after
The id of the last object of the previous page (its next_cursor).
order_ref
Only the sessions with this reference.
GET/v1/checkout/sessions/{id}

One session with its payment (the paid one, else the latest). This is the call to verify an order with.

scope: checkout:write or payments:readlive and sandboxreturns 200: checkout.session
POST/v1/checkout/sessions/{id}/expire

Ends an open session now. Refused (409 pay_payment_underway) once a payment for it has been seen.

scope: checkout:writelive and sandboxreturns 200: checkout.session
POST/v1/invoices

An invoice (a draft unless send is true).

scope: invoices:writelive keys onlyreturns 201: invoice
currency
"USD", "DGB" or "DD" (default: your profile's).
items
Lines: {description, quantity, unit_price, tax_rate_id}.
customer
{name, email, company, address}; an existing customer with the same e-mail is reused.
issue_date, due_date
YYYY-MM-DD.
terms, notes, instructions
Plain text.
discount_kind, discount_value
"amount" or "percent", and its value.
shipping
An amount in the invoice currency.
allow_partial, accept_dgb, accept_dd
true or false.
send, send_email
send: true issues it at once; send_email: false skips the e-mail to the customer.
GET/v1/invoices

Your invoices.

scope: invoices:readlive keys onlyreturns 200: list of invoices
limit
1 to 100 (default 20).
starting_after
The id of the last object of the previous page (its next_cursor).
status
all, draft, open, overdue, paid or canceled.
GET/v1/invoices/{id}

One invoice with its lines and the ids of its payments (payments).

scope: invoices:readlive keys onlyreturns 200: invoice
POST/v1/invoices/{id}/send

Issues a draft (and e-mails the customer unless send_email is false).

scope: invoices:writelive keys onlyreturns 200: invoice
send_email
false: no e-mail.
POST/v1/invoices/{id}/cancel

Cancels an invoice.

scope: invoices:writelive keys onlyreturns 200: invoice
POST/v1/links

A payment link (pay.digistamp.co/p/<id>).

scope: links:writelive keys onlyreturns 201: payment_link
title
Required.
currencies
Required: ["DGB"], ["DD"] or both.
amount_mode
"fixed" or "open" (default open).
fixed_dgb, fixed_dd
The amounts when fixed (DigiDollar at least $1.00).
description, single_use, expires_at, reference
reference is private to you.
GET/v1/receipts/{id}

A receipt, with its document and the public verify_url.

scope: receipts:readlive keys onlyreturns 200: receipt
GET/v1/reports

Totals, sources, daily figures, refunds, fees, outstanding invoices, links and campaigns for a date range. format=csv returns CSV.

scope: reports:readlive keys onlyreturns 200: report (or CSV)
from, to
YYYY-MM-DD (default today; at most ten years).
format
csv for a CSV file.
POST/v1/refunds

Records a refund request. It moves nothing: send claim_url to the payer, then approve and send the refund from your own wallet in the dashboard.

scope: refunds:writelive keys onlyreturns 201: refund
payment
Required. The payment id.
amount
Optional, in the payment's currency (default: the whole payment).
reason
Optional.
destination / address
Refused (400 destination_not_allowed): a refund address is never taken through the API.
GET/v1/events

Events of this mode, newest first: the same objects your webhooks receive.

scope: payments:readlive and sandboxreturns 200: list of events
limit
1 to 100 (default 20).
starting_after
The id of the last object of the previous page (its next_cursor).
type
One event type.
object
Only the events of this object id.
GET/v1/events/{id}

One event.

scope: payments:readlive and sandboxreturns 200: event

Example objects

Abridged where marked. Payer names, e-mails and messages are never in an API object (you see them in the dashboard).

payment (GET /v1/payments/{id})

{
  "id": "Xb3kP0qN7vR2sT9wY1zA4c",
  "object": "payment",
  "livemode": true,
  "status": "confirmed",
  "paid": true,
  "currency": "DGB",
  "amount": {
    "value": "1580.25000000",
    "minor": "158025000000"
  },
  "amount_due": {
    "value": "1580.25000000",
    "minor": "158025000000"
  },
  "fee": {
    "value": "7.90125000",
    "minor": "790125000"
  },
  "fee_paid_by": "merchant",
  "merchant_net": {
    "value": "1572.34875000",
    "minor": "157234875000"
  },
  "received": {
    "confirmed": {
      "value": "1580.25000000",
      "minor": "158025000000"
    },
    "pending": {
      "value": "0.00000000",
      "minor": "0"
    }
  },
  "usd_estimate_cents": "1999",
  "address": "dgb1qexampleaddressxxxxxxxxxxxxxxxxxxxxxxx",
  "attribution": "unique_address",
  "confirmations_required": 6,
  "late": false,
  "description": "Order 1001",
  "order_ref": "order-1001",
  "metadata": {
    "order_id": "order-1001"
  },
  "checkout_session": "cs_4fJkW2mQx9Lr7TbV0pZs1yNd",
  "invoice": null,
  "link": null,
  "receipt": "Kp7Ys1Ue9Wi3Oa5Ss7Dd9g",
  "hosted_url": "https://pay.digistamp.co/r/Xb3kP0qN7vR2sT9wY1zA4c",
  "expires_at": "2026-11-26T15:30:00.000Z",
  "first_seen_at": "2026-11-26T15:02:11.000Z",
  "paid_at": "2026-11-26T15:04:03.000Z",
  "created_at": "2026-11-26T15:00:00.000Z",
  "transactions": [
    {
      "txid": "9f2c...64 hex characters...e1a0",
      "vout": 0,
      "amount": {
        "value": "1580.25000000",
        "minor": "158025000000"
      },
      "state": "confirmed",
      "block_height": 21004321,
      "confirmations": 6,
      "late": false,
      "first_seen_at": "2026-11-26T15:02:11.000Z"
    }
  ]
}

checkout.session (GET /v1/checkout/sessions/{id})

{
  "id": "cs_4fJkW2mQx9Lr7TbV0pZs1yNd",
  "object": "checkout.session",
  "livemode": true,
  "status": "complete",
  "url": "https://pay.digistamp.co/c/cs_4fJkW2mQx9Lr7TbV0pZs1yNd",
  "order_ref": "order-1001",
  "description": "Order 1001",
  "amount": {
    "value": "19.99",
    "minor": "1999"
  },
  "amount_currency": "USD",
  "currencies": [
    "DD",
    "DGB"
  ],
  "success_url": "https://shop.example.com/thanks",
  "cancel_url": "https://shop.example.com/cart",
  "metadata": {
    "order_id": "order-1001"
  },
  "payment": "{ ...the payment object above... }",
  "expires_at": "2026-11-26T16:00:00.000Z",
  "completed_at": "2026-11-26T15:04:03.000Z",
  "created_at": "2026-11-26T15:00:00.000Z"
}

event (GET /v1/events/{id}, and every webhook body)

{
  "id": "evt_Wq3m9ZpL0xT7cB2nV5kR8sYd1f",
  "object": "event",
  "type": "checkout.completed",
  "api_version": "2026-11-26",
  "created": "2026-11-26T15:04:03.000Z",
  "livemode": true,
  "data": {
    "object": "{ ...the checkout.session, with its payment... }"
  }
}

list

{
  "object": "list",
  "data": [
    "{ ...objects, newest first... }"
  ],
  "has_more": true,
  "next_cursor": "Xb3kP0qN7vR2sT9wY1zA4c"
}

api (GET /v1)

{
  "object": "api",
  "version": "v1",
  "livemode": false,
  "application": {
    "id": "0b5c6f0e-...",
    "name": "My shop",
    "domains": [
      "shop.example.com"
    ]
  },
  "scopes": [
    "checkout:write",
    "payments:read",
    "payments:write"
  ]
}

payment_link (POST /v1/links)

{
  "id": "Ln5Bv7Cx9Zq1Wr3Et5Yu7i",
  "object": "payment_link",
  "livemode": true,
  "url": "https://pay.digistamp.co/p/Ln5Bv7Cx9Zq1Wr3Et5Yu7i",
  "title": "Sticker pack",
  "description": null,
  "currencies": [
    "DGB"
  ],
  "amount_mode": "fixed",
  "fixed_amount": {
    "DGB": {
      "value": "250.00000000",
      "minor": "25000000000"
    },
    "DD": null
  },
  "single_use": false,
  "uses": 0,
  "status": "active",
  "reference": "sku-42",
  "expires_at": null,
  "created_at": "2026-11-26T15:00:00.000Z"
}

receipt (GET /v1/receipts/{id})

{
  "id": "Kp7Ys1Ue9Wi3Oa5Ss7Dd9g",
  "object": "receipt",
  "livemode": true,
  "number": "R-000123",
  "status": "valid",
  "payment": "Xb3kP0qN7vR2sT9wY1zA4c",
  "document": "{ ...the receipt document... }",
  "document_hash": "5e1f...64 hex characters...",
  "verify_url": "https://pay.digistamp.co/v/Kp7Ys1Ue9Wi3Oa5Ss7Dd9g",
  "created_at": "2026-11-26T15:04:03.000Z"
}

refund (POST /v1/refunds)

{
  "id": "Rf4Tg6Yh8Uj0Ik2Ol4Pm6n",
  "object": "refund",
  "livemode": true,
  "payment": "Xb3kP0qN7vR2sT9wY1zA4c",
  "status": "awaiting_destination",
  "currency": "DGB",
  "amount": "158025000000",
  "claim_url": "https://pay.digistamp.co/refund/<private token>",
  "next_steps": "Send the claim_url to the payer privately so they can give a refund address, then approve and send the refund from your own wallet in the Pay dashboard."
}

error

{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_invalid",
    "message": "limit is 1 to 100.",
    "param": "limit",
    "request_id": "req_3nV8kQ1mZ7xW5pL2"
  }
}

Invoices follow the invoice view of the dashboard: number, status (draft, open, overdue, paid, canceled), currency, subtotal, discount, tax, shipping, total, amount_paid, amount_remaining, accepts, dates, bill_to, hosted_url and lines. Reports carry range, totals, bySource, daily, refunds, fees, outstandingInvoices, links and campaigns, and say plainly that they are operational records, not an accounting or tax record.

Hosted checkout

  1. Your server creates a session (POST /v1/checkout/sessions): the amount in USD, DGB or DigiDollar, the currencies offered, your order_ref, and success and cancel URLs on one of your application's registered domains.
  2. You redirect the customer to https://pay.digistamp.co/c/<session id>. The page shows your business name, the order and the amount.
  3. The customer chooses DGB or DigiDollar. Pay creates a payment request to your own address. A USD amount paid in DGB gets a price quote valid for at most 30 minutes; after that a new quote is made.
  4. The customer pays from their wallet. The page follows the payment: detected, confirming, confirmed.
  5. When the payment has its confirmations, the session becomes complete in the same database transaction that emits payment.confirmed and checkout.completed. Other unpaid requests of the session are cancelled, so nobody is asked to pay twice.
  6. The page sends the customer to your success_url with ?session_id=cs_.... Your server verifies (webhook or API) and fulfils.
  • A session is open, then complete or expired (after expires_in_minutes, or POST .../expire). A payment that arrives for an expired session still completes it: the money arrived.
  • A session with a payment under way (seen but not yet confirmed) is not expired automatically and cannot be expired by hand.
  • For a live session, each accepted currency needs an active receiving address in your dashboard, or the API answers pay_currency_not_accepted.
  • The hosted page never shows your metadata or the customer's e-mail.

Payment buttons

A button is a link to a hosted Pay page: a payment link (/p/<id>), your payment page (/<handle>), a campaign (/<handle>/<campaign>) or a checkout session your server created. No API key is involved, so a button is safe on any page, including a static site.

Pay with DigiBytePay with DigiDollarDonate with DigiByteSupport this projectBuy now

Plain HTML (no script)

Copy, replace the link id or handle, done.

HTML buttons

<!-- A payment link (fixed or open amount): pay.digistamp.co/p/<link id> -->
<a href="https://pay.digistamp.co/p/YOUR_LINK_ID"
   style="display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;max-width:100%;padding:10px 20px;border-radius:10px;font:600 16px/1.2 system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;text-decoration:none;text-align:center;border:2px solid #0b4f9c;background:#0b4f9c;color:#ffffff">Pay with DigiByte</a>

<!-- Your payment page: pay.digistamp.co/<handle> -->
<a href="https://pay.digistamp.co/yourname"
   style="display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;max-width:100%;padding:10px 20px;border-radius:10px;font:600 16px/1.2 system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;text-decoration:none;text-align:center;border:2px solid #c9d6e8;background:#ffffff;color:#0b3a73">Support this project</a>

<!-- A campaign: pay.digistamp.co/<handle>/<campaign> -->
<a href="https://pay.digistamp.co/yourname/new-roof"
   style="display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;max-width:100%;padding:10px 20px;border-radius:10px;font:600 16px/1.2 system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;text-decoration:none;text-align:center;border:2px solid #0b4f9c;background:#0b4f9c;color:#ffffff">Donate with DigiByte</a>

The buttons script

https://pay.digistamp.co/sdk/v1/pay.js has no dependencies, loads no fonts or stylesheets, reads no cookies and makes no requests. It styles <a data-digistamp-pay> links (they keep working as plain links without it) and defines window.DigiStampPay with button(elementOrSelector, options), upgrade(root), urlFor(options) and redirectToCheckout(sessionUrl). Options: one of href (an https://pay.digistamp.co/ address), link, handle or campaign ("handle/slug"), plus label (pay-dgb, pay-dd, donate, support, buy, or your own text), variant (dark, light, outline) and newTab.

Using the script

<script src="https://pay.digistamp.co/sdk/v1/pay.js" defer></script>

<!-- 1. Upgrade a plain link: it works as a link even if the script never loads. -->
<a data-digistamp-pay data-link="YOUR_LINK_ID" data-label="pay-dgb" data-variant="dark"
   href="https://pay.digistamp.co/p/YOUR_LINK_ID">Pay with DigiByte</a>

<!-- data-handle="yourname", data-campaign="yourname/new-roof" and data-href="https://pay.digistamp.co/..."
     work the same way. data-label: pay-dgb, pay-dd, donate, support, buy (or your own text).
     data-variant: dark, light, outline. data-new-tab="true" opens the page in a new tab. -->

<!-- 2. Render a button from code. -->
<div id="donate"></div>
<script>
  window.addEventListener('DOMContentLoaded', function () {
    DigiStampPay.button('#donate', { campaign: 'yourname/new-roof', label: 'donate', variant: 'light' });
  });
</script>

For a cart, your server creates the checkout session; the browser only goes there. redirectToCheckout accepts nothing but a https://pay.digistamp.co/c/cs_... URL.

Redirect to a checkout your server created

// In the browser: ask YOUR server to create the session (it holds the API key), then go there.
document.querySelector('#checkout').addEventListener('click', async function () {
  const res = await fetch('/create-digistamp-checkout', { method: 'POST' });   // your own endpoint
  const { url } = await res.json();
  DigiStampPay.redirectToCheckout(url);   // accepts only https://pay.digistamp.co/c/cs_...
});

If your site has a Content Security Policy, allow the script: script-src https://pay.digistamp.co. The v1 path stays compatible; fixes ship under it (cached for an hour), and a breaking change would get a new path.

Webhooks

Register an https endpoint in your dashboard (Developers), for live or sandbox events, for every event type or a chosen list. Its signing secret (whsec_...) is shown once. Pay posts each event to each matching endpoint of the same mode. An event is written in the same database transaction as the change it reports, so it exists exactly when the change happened.

Event types
TypeMeaning
payment.createdA payment request was created (by the API, a checkout, a link or your page).
payment.detectedThe full amount is seen on the network, not yet in a block.
payment.confirmingThe full amount is in a block, below the confirmation depth.
payment.partialLess than the amount has been seen (fresh-address payments only).
payment.confirmedPaid at its confirmation depth: the event to fulfil on. Also sent for an overpayment, and again if a payment confirms again after a reorganization.
payment.overpaidConfirmed with more than asked (after or with payment.confirmed).
payment.expiredExpired unpaid, or with less than the amount.
payment.reorgedA confirmed payment was reorganized out of the chain: hold or undo what you fulfilled until it confirms again.
payment.canceledCancelled by you, or an unused request of a completed checkout.
payment.refundedA refund you sent is confirmed on chain.
invoice.paidAn invoice is paid in full.
invoice.overdueAn invoice is past its due date, unpaid (sent once).
fee.settledA fee settlement you paid is verified on chain.
checkout.completedA checkout session's payment is confirmed. data.object is the session with its payment.
checkout.expiredA checkout session expired unpaid.
webhook.testSent only by "Send test event" in the dashboard, to check your receiver.

The request

  • POST to your URL with Content-Type: application/json; the body is the event object (below), the same as GET /v1/events/{id}.
  • DigiStamp-Signature: t=<unix seconds>,v1=<hex>: HMAC-SHA256 with your signing secret (the whole string, whsec_ included, as the key) over <t>.<raw body>. During a secret rotation a second v1 (from the previous secret) is sent; either may match.
  • DigiStamp-Event-Id (evt_...), DigiStamp-Event-Type, DigiStamp-Delivery-Id (one per endpoint and event), DigiStamp-Api-Version (2026-11-26).

Event body

{
  "id": "evt_Wq3m9ZpL0xT7cB2nV5kR8sYd1f",
  "object": "event",
  "type": "checkout.completed",
  "api_version": "2026-11-26",
  "created": "2026-11-26T15:04:03.000Z",
  "livemode": true,
  "data": {
    "object": "{ ...the checkout.session, with its payment... }"
  }
}

Verify every delivery

  1. Read the raw body bytes before any JSON parsing (Express: express.raw({ type: 'application/json' }); PHP: file_get_contents('php://input')). A re-serialized body will not match.
  2. Split the header on ,; take t and every v1.
  3. Refuse it if t is more than 300 seconds from your clock (either way). Keep your server's clock synchronized.
  4. Compute HMAC-SHA256(secret, t + "." + raw body) as hex and compare it with each v1 in constant time.
  5. Only then parse the JSON.

Verify a webhook signature (Shell (openssl))

#!/usr/bin/env bash
# Verifies a DigiStamp Pay webhook signature with openssl (exit 0: valid, 1: invalid, 2: usage).
#   DIGISTAMP_WEBHOOK_SECRET=whsec_... ./verify-webhook.sh <raw-body-file> "<DigiStamp-Signature header>"
# DigiStamp-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>"> (two v1 values during a rotation).
set -f
body_file="$1"
header="$2"
secret="$DIGISTAMP_WEBHOOK_SECRET"
tolerance=300
if [ -z "$body_file" ] || [ -z "$header" ] || [ -z "$secret" ]; then
  echo 'Usage: DIGISTAMP_WEBHOOK_SECRET=whsec_... ./verify-webhook.sh <raw-body-file> "<DigiStamp-Signature>"' >&2
  exit 2
fi
t=""
sigs=""
for part in $(printf '%s' "$header" | tr ',' ' '); do
  key=$(printf '%s' "$part" | cut -d= -f1)
  val=$(printf '%s' "$part" | cut -d= -f2)
  if [ "$key" = "t" ] && printf '%s' "$val" | grep -Eq '^[0-9]{1,12}$'; then t="$val"; fi
  if [ "$key" = "v1" ] && printf '%s' "$val" | grep -Eq '^[0-9a-f]{64}$'; then sigs="$sigs $val"; fi
done
if [ -z "$t" ] || [ -z "$sigs" ]; then echo "invalid: malformed"; exit 1; fi
now=$(date +%s)
age=$((now - 10#$t))
if [ "$age" -lt 0 ]; then age=$((0 - age)); fi
if [ "$age" -gt "$tolerance" ]; then echo "invalid: timestamp"; exit 1; fi
# The HMAC key is the whole secret string, "whsec_" included; the message is "<t>." followed by the raw body bytes.
expected=$({ printf '%s.' "$t"; cat "$body_file"; } | openssl dgst -sha256 -hmac "$secret" -r | cut -d' ' -f1)
# Constant-time comparison: compare HMACs of both values under a random one-time key.
nonce=$(openssl rand -hex 32)
want=$(printf '%s' "$expected" | openssl dgst -sha256 -hmac "$nonce" -r | cut -d' ' -f1)
for s in $sigs; do
  got=$(printf '%s' "$s" | openssl dgst -sha256 -hmac "$nonce" -r | cut -d' ' -f1)
  if [ "$got" = "$want" ]; then echo "valid"; exit 0; fi
done
echo "invalid: signature"
exit 1

Replay protection and idempotent processing

  • The timestamp check stops an old delivery being replayed later; the event id stops a replay inside the window. Store the ids you processed (a table with a unique id) and acknowledge a known id with 2xx without doing anything.
  • The same event can arrive more than once (a retry after a timeout, a manual redelivery), and events can arrive out of order. Make fulfilment idempotent: "mark order 1001 paid if not already".
  • Do not trust the body alone for money decisions: re-fetch the session or payment with your key (as in the quick start) and check amount, currency and order_ref against your own order.

Retries, dead letters and redelivery

  • Success is a 2xx answer within 10 seconds. Answer quickly and do slow work afterwards (from a queue). Redirects are not followed (a 3xx is a failure); at most 4 KB of your answer is read.
  • A failure is retried after about 1 minute, 5 minutes, 15 minutes, 1 hour, 3, 6, 12 and 24 hours (a little random spread), 9 attempts over about two days. Then the delivery is dead-lettered: kept, visible, and redeliverable.
  • In the dashboard you see every attempt with its status code and error, can redeliver one delivery, redeliver every dead delivery of an endpoint, and send a webhook.test event.
  • An endpoint that fails 100 times in a row is disabled (you are told in the dashboard). Fix the receiver, enable it, then redeliver.
  • Your URL must be public https (port 443 or 1024 to 65535). Pay refuses private, loopback and link-local addresses on every delivery. For local development, use a tunnel to your machine.
  • Missed something? GET /v1/events lists the same events; process them through the same idempotent code.

List events (curl)

curl "https://pay.digistamp.co/api/pay/v1/events?type=payment.confirmed&limit=50" \
  -H "Authorization: Bearer $DIGISTAMP_PAY_API_KEY"

# the next page: starting_after = the previous answer's next_cursor
curl "https://pay.digistamp.co/api/pay/v1/events?limit=50&starting_after=evt_Qm9yZXN0aW5nRXZlbnRJZEhlcmU" \
  -H "Authorization: Bearer $DIGISTAMP_PAY_API_KEY"

Rotating the signing secret

Rotate in the dashboard (fresh Digi-ID sign-in). The new secret is shown once; the old one keeps signing alongside it for a grace period you choose (0 to 72 hours, default 24), so deploy the new secret within that time.

Errors

Errors are {"error": {"type", "code", "message", "param"?, "request_id"}} with an HTTP status. Branch on the status and type; log code and request_id; show message only to yourself. Codes from Pay's own rules start with pay_; new codes may be added, so treat an unknown code by its status.

Error types and codes
Statustypecode
400invalid_request_errorparameter_invalid (see param), invalid_json, idempotency_key_invalid, destination_not_allowed, pay_invalid_input, pay_invalid_amount, pay_invalid_url, pay_currency_not_accepted
401authentication_errormissing_api_key, invalid_api_key (unknown, revoked or expired, or the application is disabled)
403permission_errormissing_scope, live_mode_only, test_mode_only, pay_page_suspended
404invalid_request_errorunknown_endpoint, resource_missing (also for another page's objects), receipt_not_issued
405invalid_request_errormethod_not_allowed
409idempotency_erroridempotency_key_reused, idempotency_in_progress
409invalid_request_errora state conflict, for example pay_checkout_closed, pay_payment_underway, pay_not_cancelable
413invalid_request_errorbody_too_large (64 KB)
415invalid_request_errorunsupported_media_type (send JSON)
429rate_limit_errorrate_limited (wait for Retry-After), too_many_failed_attempts, pay_busy (sandbox: 1,000 test payments an hour)
500api_errorinternal_error: safe to retry with the same Idempotency-Key
503api_errorunavailable: Pay is temporarily unavailable; retry later

Two answers come from the platform in front of the API and have a simpler shape: 429 {"error": "RATE_LIMITED"} when one address sends too many requests, and 403 {"error": "CROSS_ORIGIN_REFUSED"} for a write sent from a browser page of another site. Call the API from your server.

Payment states

Pay's chain watcher is the only authority for a payment's status; it never trusts a browser or a transaction id typed by a payer. A payment counts as paid after confirmations_required confirmations (6 by default; DigiByte makes a block about every 15 seconds).

Payment status values
statusMeaning
awaiting_paymentOpen, nothing seen yet.
detectedThe full amount is seen, unconfirmed. Do not fulfil.
confirmingThe full amount is in a block, below the confirmation depth. Do not fulfil.
partially_paidSome of the amount is seen (fresh-address payments only); the payer can send the rest.
confirmedPaid at the confirmation depth. Fulfil (paid: true).
overpaidPaid with more than asked, at depth. Fulfil (paid: true); settle the difference with the payer yourself.
expiredExpired with nothing received.
underpaidExpired with less than the amount.
reorgedA confirmed payment's block was replaced; waiting to confirm again. Hold fulfilment.
needs_reviewA confirmed payment was reorganized out and not seen again (or is held for review). Hold fulfilment.
canceledCancelled before anything was received.

What to fulfil on

The payment.confirmed or checkout.completed event, or a payment whose status is confirmed or overpaid (the API's paid field is true exactly then), after checking amount, currency and order_ref. On payment.reorged, put the order on hold; a later payment.confirmed for the same payment releases it.

A transaction in transactions is mempool, confirmed, reorged or dropped (left the network unconfirmed). A payment after expiry to its own fresh address still counts within a late window and is marked late.

DGB and DigiDollar wallets

  • Your own wallet. You add receiving information in the dashboard; Pay stores only public information and never a private key, seed or xprv (they are refused). Changing it needs a fresh Digi-ID sign-in, and no API key can change it.
  • DGB with an xpub (recommended). Give your wallet's extended public key (xpub, ypub or zpub). Each payment gets a fresh address of yours (attribution: unique_address), so partial payments and several transactions add up correctly.
  • DGB with one address. Each payment then has its own exact amount (sometimes with a tiny extra so two payments can be told apart; attribution: exact_amount). The payer must send exactly that amount; anything else is held for review.
  • DigiDollar needs a DigiDollar-capable wallet (DigiByte Core 9.26 or newer) and one DigiDollar address. DigiDollar payments always use exact amounts, and the smallest is $1.00. DigiDollar is not offered for live payments yet: a live request for it answers pay_currency_not_accepted. The sandbox already accepts it.
  • The payer pays from their own wallet. Pay shows the address, a QR code of the address only, and the amount as text to type in. The QR code never carries the amount.

Fees

  • DigiStamp's fee is 0.5% of each payment. Every payment object carries its exact fee, fee_paid_by (merchant or customer, your page setting) and merchant_net.
  • The API, webhooks, hosted checkout, buttons and sandbox are included. No subscription, no plan, no charge per API call. Sandbox payments are never charged.
  • The fee is not taken out of the payment: the whole payment goes to your wallet. Fees accrue on your account when a payment confirms, and you settle them yourself from the dashboard, as one payment from your wallet to DigiStamp, verified on chain (fee.settled). No API key can settle fees.

Sandbox

  • Use a dstest_... key and a TEST webhook endpoint. Sandbox keys can hold payments:read, payments:write and checkout:write; invoices, links, receipts, reports and refunds are live only.
  • Test payments have ids starting test_ and livemode: false. Their addresses are DigiByte testnet-form addresses that a mainnet wallet refuses, made from a key nobody holds. No real money can be sent, no fee accrues, and no report counts them. Hosted pages show them under a TEST banner.
  • Checkout success and cancel URLs may use http://localhost with a sandbox key.
  • Complete a payment with the simulator: POST /v1/payments/{id}/simulate with action detect, confirm, partial, overpay, expire or reorg. Each step uses the same status rules as real payments and sends the same events to your TEST endpoints. For a checkout, the customer first chooses a currency on the hosted page; the session's payment.id is then the test payment.
  • When no live price is available, the sandbox converts USD at a labelled $0.01 per DGB.

Simulate a payment (curl)

# 1. a sandbox payment without a checkout (or take session.payment.id after choosing a currency on /c/cs_...)
curl https://pay.digistamp.co/api/pay/v1/payments \
  -H "Authorization: Bearer $DIGISTAMP_PAY_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"currency": "DGB", "amount_usd": "19.99", "order_ref": "order-1001"}'

# 2. play the chain: detect, then confirm (also: partial, overpay, expire, reorg)
curl https://pay.digistamp.co/api/pay/v1/payments/test_q8Wn3vB5kT0cR7yL2sXf4a/simulate \
  -H "Authorization: Bearer $DIGISTAMP_PAY_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "confirm"}'

Security checklist

  • Keep API keys and the webhook secret on your server (environment or secret store), never in a browser, an app or a repository. Give each key only the scopes it needs.
  • Verify every webhook signature on the raw body, with the 5-minute tolerance, and store processed event ids.
  • Check amount, currency and order_ref of the session or payment against your own order before fulfilling. Re-fetch it with your key rather than trusting a request body.
  • Never fulfil from the redirect to your success URL.
  • Send an Idempotency-Key with every POST you might retry.
  • Rotate keys and secrets when people leave or a secret may have leaked (with a grace period), and revoke what you do not use.
  • Register only your real domains on the application: checkout will return customers to nothing else.
  • Use https everywhere, keep your clock synchronized, and log request ids, never keys, secrets or webhook bodies with customer data.

Shop platforms: integration opportunities

Pay has no published plugin for any shop platform yet. A WooCommerce gateway is being prepared but has not been tested in a live shop. The platforms below are opportunities, not products: none of these integrations exists today.

Any of them would work the same way, with what is documented on this page:

  1. At checkout, the shop's server creates a checkout session with the order id as order_ref and an Idempotency-Key, and redirects the customer.
  2. A webhook receiver verifies the signature, re-fetches the session, checks it against the order and marks the order paid, once.
  3. payment.reorged puts the order on hold.
  • Shopify: would need an approved payments app (Shopify controls who may add payment methods).
  • Magento (Adobe Commerce), PrestaShop, Easy Digital Downloads, Ecwid: a payment module or extension doing the three steps above.
  • Custom carts: the quick start above is the whole integration.