Skip to content

Fetch Promo Ads

Description

This API retrieves a list of customers filtered by email, name and paginated using a cursor.

Endpoint

  • URL: /v1/customers
  • Method: GET
  • sortFieldParam: CREATED_AT, NAME, EMAIL

Query Parameters:

ParameterTypeDescription
sortDirectionParamStringSorting direction (ASC or DESC). Default: ASC.
sortFieldParamStringField to sort results by (e.g., NAME). Default: NAME.
nameStringFilter customers by name.
emailStringFilter customers by email.
cursorStringNo
limitIntegerYes

Required Headers

json
{
  "Authorization": "Bearer JWT_TOKEN", 
  "X-MerchantApiKey": "MERCHANT_API_KEY", //optional
  "Content-Type": "application/json"
}

Example API Call (Using Fetch)

javascript
fetch("https://api.shopsynch.com/v1/customers", {
  method: "GET",
  headers: {
    "Authorization": "Bearer JWT_TOKEN",
    "X-MerchantApiKey": "MERCHANT_API_KEY",
    "Content-Type": "application/json"
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));

✅ Sample 200 Response (Success)

json
{
    "data": {
        "data": [
            {
                "id": "67b20a5edd84ed390426c09f",
                "email": "customer@yopmail.com",
                "fullName": null,
                "phoneNumber": null,
                "address": null,
                "createdAt": "2025-02-16T16:55:10.289",
                "updatedAt": "2025-02-16T16:55:10.289"
            }
        ],
        "nextCursor": null
    },
    "message": "Customers retrieved successfully",
    "status": true
}

Next Steps

Build with joy