What is fulfillmentPolicy?
fulfillmentPolicy is an optional object on create escrow (POST /api/v1/escrows). It is only valid when mode is "quick". Set:
| Field | Description |
|---|---|
type | Must be purchase_proof_required to enable the proof gate. |
proofUploadDeadlineHours | Hours for the seller to upload after funding (must be within platform bounds, default 6–72h; 400 if out of range; 24h if omitted). |
buyerReviewDeadlineHours | Hours for the buyer to review (same bounds; auto-accept if they do nothing). |
allowedProofTypes | Optional UI hints for your app (receipt, order_confirmation, product_photo, tracking_proof, other). DHMAD does not reject uploads based on this list. |
status stays paid. Track the proof lifecycle with proofInfo.phase and proof webhooks — not with status changes.
In the API Explorer, expand POST /v1/escrows, click Try it out, and select the Quick mode with purchase proof request example.
Proof lifecycle
Afteraccepted or accepted_by_timeout, the escrow continues through the normal paid → delivered → completed flow. The seller’s deliver call returns 409 (PROOF_NOT_ACCEPTED) until proof is accepted.
Step-by-step integration
1. Create the escrow (server-side)
Never expose your API key in the browser.2. Buyer funds the escrow
Redirect the buyer with anaccept_pay checkout session. Once funded, proofInfo.phase becomes waiting_seller_proof and you receive escrow.proof.required.
3. Seller uploads proof
Create a checkout session withaction: "submit_proof" and redirect the seller:
submitted_waiting_buyer_review and you receive escrow.proof.submitted.
4. Buyer reviews proof
Create areview_proof session for the buyer:
escrow.proof.needs_review). If the buyer does nothing before the deadline, proof is auto-accepted (escrow.proof.accepted_by_timeout).
5. Show proof on your site
Call GET /api/v1/escrows/:id/proof to fetch proof metadata and time-limitedviewUrl links you can embed in your UI. Raw storage keys are never returned.
Proof webhooks also include viewUrl on each attachment, plus checkoutActions suggesting the next checkout session to create.
6. Handle proof webhooks
Subscribe to proof events in the Developer Dashboard (or handle them in your webhook handler):| Event | When |
|---|---|
escrow.proof.required | Buyer funded; seller must upload |
escrow.proof.submitted | Seller uploaded; buyer should review |
escrow.proof.correction_requested | Buyer wants better proof |
escrow.proof.accepted | Buyer accepted; delivery unlocked |
escrow.proof.accepted_by_timeout | Review deadline passed; delivery unlocked |
escrow.proof.needs_review | Escalated to DHMAD |
escrow.proof.expired | No proof in time; cancelled + refunded |
Tips
- Use sandbox keys and
sandbox.dhmad.tnfor development. - Prefer webhooks for state; use
GET /proofwhen you need to render attachments. - Accepting proof unlocks delivery — it does not certify goods; disputes remain available.
GET /api/v1/escrows/:idreturnsfulfillmentPolicyand sanitizedproofInfo(phase, deadlines) but not file URLs — useGET /proofor webhooks forviewUrl.