Contacts

Explanation of how to manage your contacts through the Carts Guru API.

Get Contact

GET https://api.carts.guru/contacts

This endpoint allows you to get the information for single contact.

Query Parameters

Name
Type
Description

siteId

string

Your site ID (provided at integration).

accountId

string

The contact's ID in your website.

Headers

Name
Type
Description

x-auth-key

string

Personal token to access Carts Guru API (provided at integration).

{
    "data": [{
        "_id": "Contact's id",
        "siteId": "Your site id",
        "firstName": "Contacts first name"
        "lastName": "Contacts last name",
        "addresses": [{
            "title": "Residence type",
            "line1": "",
            "line2": "",
            "postcode": "Contacts zipcode",
            "city": "Contacts city",
            "country": "Contacts Country"
        }],
        "phoneNumbers": [{
            "title": "type",
            "phoneNumber": "Contacts phone number"
        }],
        "emails": ["Contacts email"],
        "communicationPreferences": {
            "sms": "Default",
            "call": "Optin",
            "email": "Optout"
        }
    }]
}

Update Contact's Opt-in Status

POST https://api.carts.guru/contacts/:id

This endpoint allows you to change the contacts Opt-in status.

Path Parameters

Name
Type
Description

id

string

The contact's _id from the Carts Guru document (see get method).

Query Parameters

Name
Type
Description

siteId

string

Your site ID (provided at integration).

Headers

Name
Type
Description

x-auth-key

string

Personal token to access Carts Guru API (provided at integration).

Request Body

Name
Type
Description

allowCall

boolean

True: customer will receive calls. False: customer will not receive calls.

allowSms

boolean

True: customer will receive sms. False: customer will not receive sms.

allowEmail

boolean

True: customer will receive email. False: customer will not receive email.


{        "data": [{            "_id": "Contact's id",            "siteId": "Your site id",                    "firstName": "Contacts first name"                    "lastName": "Contacts last name",                    "addresses": [{                                "title": "Residence type",                                "line1": "",                                "line2": "",                                "postcode": "Contacts zipcode",                                "city": "Contacts city",                                "country": "Contacts Country"                    }],                            "phoneNumbers": [{                                "title": "type",                                "phoneNumber": "Contacts phone number"                    }],                    "emails": ["Contacts email"],                    "communicationPreferences": {                                "sms": "Default",                                "call": "Optin",                                "email": "Optout"                    }        }] }

Anonymize Contact

PUT https://api.carts.guru/contacts/:id

Allows you to delete all the identifying properties of your contacts on Carts Guru database

Path Parameters

Name
Type
Description

id

string

The contacts _id from the Carts Guru document (see get method).

Query Parameters

Name
Type
Description

cg_action

string

Describes the action you want the Carts Guru API to perform on your contact ('anonymize' is the only one allowed).

siteId

string

Your site ID (provided at integration)

Headers

Name
Type
Description

x-auth-key

string

Personal token to access Carts Guru API (provided at integration).

{
    "data": [{
        "_id": "Contact's id",
        "siteId": "Your site id",
        "firstName": "undefined"
        "lastName": "undefined",
        "addresses": "undefined",
        "phoneNumbers": "undefined",
        "emails": "undefined",
        "communicationPreferences": {
            "sms": "Default",
            "call": "Optin",
            "email": "Optout"
        }
    }]
}
curl -XGET https://api.carts.guru/contacts.csv?siteId=0000000-0000-0000-0000-0000000000 \
  --header 'x-auth-key: 00000000000000000' 

Import CSV File

PUT https://api.carts.guru/contacts.csv

Allows you to import a CSV File which contains a list of all the emails/phone-numbers of your current contacts in the Carts Guru database. These contacts Opt-in status will be updated to Opt-out for the type specified in the file. The CSV file format: 'mutipart/form-data' File key name: 'file'

Query Parameters

Name
Type
Description

siteId

string

Your site ID (provided at integration).

Headers

Name
Type
Description

x-auth-key

string

Personal token to access Carts Guru API (provided at integration).

{
    status: "success"
}
curl -XPUT https://api.carts.guru/contacts.csv?siteId=0000000-0000-0000-0000-000000 \
  --header 'x-auth-key: 00000000000000000' \
  --form "file=@valid.csv;type=application/csv"

Import Requirements:

Last updated