Getting started

Quickstart

Place a test order, follow it to delivery and receive its webhooks — all in the sandbox, where nothing ships and no money moves.

Create a sandbox key

In the dropshipping dashboard → Integrations, add a Custom API connection and create a key in Test mode. Copy its key id (mk_test_…) and secret (sk_test_…) now — the secret is shown once.

.env (server side only)
MARKITMALL_API_KEY=mk_test_XXXX
MARKITMALL_API_SECRET=sk_test_XXXX

Check the connection

curl "https://backend.markitmall.com/dropship/v1/me" \
  -H "Authorization: Bearer mk_test_XXXX:sk_test_XXXX"

You get your brand and "mode": "test". A 401 invalid_key means the key was copied incompletely.

Pick a product

curl "https://backend.markitmall.com/dropship/v1/catalog/products?inStock=true&limit=5" \
  -H "Authorization: Bearer mk_test_XXXX:sk_test_XXXX"

Each product has variants. Note a variants[].id — that is what you order — and its minResalePrice: you may sell at any price at or above it.

Send an order

curl -X POST "https://backend.markitmall.com/dropship/v1/orders" \
  -H "Authorization: Bearer mk_test_XXXX:sk_test_XXXX" \
  -H "Idempotency-Key: 1042" \
  -H "Content-Type: application/json" \
  -d '{
  "externalOrderId": "1042",
  "externalOrderName": "#1042",
  "paymentMode": "COD",
  "customer": {
    "name": "Ali Raza",
    "phone": "03001234567",
    "address": "House 12, Street 4, DHA Phase 5",
    "city": "Lahore"
  },
  "items": [
    {
      "variantId": "<variants[].id from step 3>",
      "quantity": 1,
      "resalePrice": 1500
    }
  ],
  "shippingCharged": 200
}'

The courier will collect resalePrice × quantity + shippingCharged = Rs 1,700. The response shows expectedMargin — what you keep after wholesale and our shipping. Keep the returned id.

Use your own order id as the Idempotency-Key. If your request times out and you retry, you get the first result back instead of a second order.

Listen for webhooks

Point us at an HTTPS endpoint on your server (for a first try, a free inbox from webhook.site works):

curl -X PUT "https://backend.markitmall.com/dropship/v1/webhooks" \
  -H "Authorization: Bearer mk_test_XXXX:sk_test_XXXX" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/markitmall/webhook",
  "events": []
}'

The response contains secret — store it; it signs every event. An empty events list subscribes to all of them. See Webhooks for verifying signatures.

Walk the order through its life

In the sandbox you move the order yourself. Each step sends the matching webhook, marked "mode": "test":

curl -X POST "https://backend.markitmall.com/dropship/v1/orders/{id}/simulate" \
  -H "Authorization: Bearer mk_test_XXXX:sk_test_XXXX" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "SHIPPED"
}'

Try CONFIRMED, SHIPPED (adds a tracking number), DELIVERED (margin becomes pending) and, on another order, RETURNED (a refused parcel and its shipping charge).

Go live

Once your dropshipper account is approved, create a Live key on the same connection and swap it in. The code does not change. Live orders are confirmed with the customer by phone before they are packed, and real money moves on your wallet — read Orders & money first.