Delivery tokens for digital goods
Redeem the single-use delivery token from your backend before unlocking a digital product, so delivery is proven automatically if the buyer disputes.
For digital products (licences, downloads, credits), the strongest proof of delivery is that your backend unlocked the product in exchange for a token only the paying buyer had. This is Flow A.
How it works
- When the buyer pays, the checkout generates a delivery token (
dt_and 43 characters) and appends it to yoursuccess_urlasarbiro_delivery_token. - Your success page sends the token to your backend together with
arbiro_payment_id. - Your backend calls
POST /v1/evidence/redeem-tokenbefore unlocking the product. Only a successful redemption proves access. - If the buyer later claims they did not receive it, the redemption is the evidence. Arbiro stores only the SHA-256 of the token.
Redeem the token
import { Arbiro, ArbiroError } from "@arbiro/sdk";
const arbiro = new Arbiro({ apiKey: process.env.ARBIRO_API_KEY! });
export async function unlock(paymentId: `0x${string}`, deliveryToken: string, orderId: string) {
try {
const redemption = await arbiro.deliveries.redeemToken({
payment_id: paymentId,
delivery_token: deliveryToken,
delivery_reference: `licence-${orderId}`, // what you unlocked
});
if (redemption.redeemed) await grantLicence(orderId);
} catch (error) {
if (error instanceof ArbiroError && error.status === 409) {
// The token belongs to another payment or the payment is not redeemable: do not unlock.
return;
}
throw error;
}
}
import os
import httpx
def unlock(payment_id: str, delivery_token: str, order_id: str) -> None:
response = httpx.post(
"https://arbiro.com/v1/evidence/redeem-token",
headers={
"Authorization": f"Bearer {os.environ['ARBIRO_API_KEY']}",
"Idempotency-Key": f"redeem-{order_id}",
},
json={
"payment_id": payment_id,
"delivery_token": delivery_token,
"delivery_reference": f"licence-{order_id}",
},
)
if response.status_code == 409:
return # not redeemable: do not unlock
response.raise_for_status()
if response.json()["redeemed"]:
grant_licence(order_id)
curl https://arbiro.com/v1/evidence/redeem-token \
-H "Authorization: Bearer $ARBIRO_API_KEY" \
-H "Idempotency-Key: redeem-order_1042" \
-H "Content-Type: application/json" \
-d '{"payment_id":"0x...","delivery_token":"dt_...","delivery_reference":"licence-order_1042"}'
Rules
- Redeeming is idempotent: calling it again with the same token returns
already_redeemed: trueand the original time. - A token works only for its own payment. Any other combination returns
409. - Unlock the product only after a successful response. A redirect to your success page is not proof of payment.
- Keep the
delivery_reference: it links the redemption to what you delivered and appears in the dispute file.
B2B services
For services delivered over weeks (Flow C), fix the scope before the payment with scope_document_sha256 on the payment link, and in a dispute upload the signed delivery documents as evidence (PDF, original .eml emails or a ZIP). Screenshots are not accepted as proof. See Disputes and evidence.
Updated