Customers & purchases

Keep the audience current from your store.

POST /customers

Creates or updates a contact, matched on email first and phone second. Send a purchase object with it and the purchase history, the lifetime value and every dynamic segment update immediately.

curl https://marketmind.skotechlabs.com/api/v1/customers \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nusrat Jahan",
    "email": "nusrat@example.com",
    "phone": "01898765432",
    "city": "Dhaka",
    "tags": ["vip"],
    "consent": { "email": true, "sms": true, "whatsapp": false },
    "purchase": { "amount": 3200, "product": "Merino Blend Sweater", "category": "Knitwear", "purchased_at": "2026-09-28" }
  }'

Consent matters. A contact with sms: false will never receive an SMS campaign, even if a segment includes them.

POST /purchases

Records a purchase against an existing contact, identified by customer_id, email or phone.

GET /customers and GET /customers/{id}

Search the list with ?q=.