Shopper API CRUD endpoints (Beta)

Introduction


Gatsby’s Shopper API exposes the following endpoints:

  • Create a Shopper
  • Get a Shopper by ID
  • Update a Shopper by ID
  • Delete a Shopper by ID
  • Search for a Shopper by email, phone number, or username

All requests must include the brand’s Gatsby API key in the Authorization header:


Authorization: pk_gatsby_api_key_here


If you are working in the development environment change the host name from gatsby.tech to dev.gatsby.tech


POST and PATCH methods take a body of the form:


{

    "channel": {

        "instagram": {

            "email": string

            "phone": string - must include a 10-digit phone number with country code

            "fullName": string

            "firstName": "string

            "lastName": string

            "userName": string

        },

"tiktok":{

            "email": string

            "fullName": string

            "firstName": "string

            "lastName": string

            "userName": string

        }

    },

    "integrations": {

        "zinrelo": {

            "partner_id": "string"

            "member_id": "string"

            "user_id": "string"

            "environment": "string"

        }

    }

}


At least one of email, phone, userName must be provided.


GET methods will return a body of the form:



{

    "_id": string,

    "channel": {

        "instagram": {

            "email": string

            "phone": string - must include a 10-digit phone number with country code

            "fullName": string

            "firstName": "string

            "lastName": string

            "userName": string

            "isVerified": boolean

        }

"tiktok":{

            "email": string

            "fullName": string

            "firstName": "string

            "lastName": string

            "userName": string

        }

    },

    "integrations": {

        "zinrelo": {

            "partner_id": "string",

            "member_id": "string",

            "user_id": "string",

            "environment": "string"

        }

    },

    "keywords": Array<"string">

}


Any query strings must be URL encoded.


Shopper Endpoints

Create

The URI for the Shopper create endpoint is:

POST https://gatsby.tech/public/shopper

Get

The URI for the Shopper get endpoint is:

GET https://gatsby.tech/public/shopper/{id}


Where {id} is the _id of the shopper you are fetching.

Search

The URI for the Shopper search endpoint is:

GET https://gatsby.tech/public/shopper?{querystring}


Where {querystring} is a URL encoded query string containing one of email, phone, username.


If the header version: 1.1 is included in the request this endpoint will return an array of all matching shoppers.

Update

The URI for the Shopper update endpoint is:

PATCH https://gatsby.tech/public/shopper/{id}


Where {id} is the _id of the shopper you are updating.

Delete

The URI for the Shopper delete endpoint is:

DELETE https://gatsby.tech/public/shopper/{id}


Where {id} is the _id of the shopper you are deleting.


Please note that shoppers can only be updated or deleted by ID. If you do not have the ID of the shopper you wish to update or delete, use the search endpoint to find it using email, phone, or userName.


Version

This document is accurate as of January 22nd, 2025.