Skip to main content
This quickstart guide will walk you through creating your first escrow transaction using the DHMAD API.

Prerequisites

  • A DHMAD developer account with an approved application
  • An API key (see Getting Started)
  • Your developer account associated with a user account
  • The associated user account must have email verification completed (phone verification is only required when the buyer accepts and pays, not at escrow creation)
  • Basic knowledge of REST APIs

Step 1: Check Your Balance

First, let’s verify your account and check your balance:

Step 2: Create an Escrow

Now let’s create an escrow transaction. This represents a secure transaction between a buyer and seller:
If the buyer email corresponds to an existing user, they will receive a notification. If not, they will receive an invitation email with a registration link.
This example creates a standard mode escrow (default). For product sales without a contract, use mode: "quick". For in-app digital goods where you are the seller, use mode: "instant". See Escrow Modes.

Step 3: Get Escrow Details

Retrieve the details of the escrow you just created:

Step 4: List Your Escrows

Get a list of all your escrows with optional filters:

Complete Example

Here’s a complete JavaScript example:

Step 5: Set Up Webhooks (Optional)

To receive real-time notifications when escrow status changes, set up a webhook:
  1. Go to the Developer Dashboard
  2. Navigate to the “Webhooks” section
  3. Create a webhook with your endpoint URL
  4. Verify webhook signatures in your handler
See the Webhooks Guide for detailed setup instructions.

Next Steps


All amounts are in TND (Tunisian Dinar). The escrow fee is automatically calculated based on the transaction amount.