API: customers

GET /customers

This method returns the list of all your existing customers.

Resource URL

GET https://app.snipcart.com/api/customers

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.

Parameters

Name Required? Type Description
offset Yes int Number of results to skip. Default is 0.
limit Yes int Number of results to fetch. Default is 20.
status No string The status of your customers, Confirmed means that the customers have created an account and Unconfirmed are those who checked out as guests.
email No string The email of the customer who placed the order.
name No string The name of the customer who placed the order.
from No datetime returns only the customers created after this date.
to No datetime returns only the customers created before this date.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/customers?offset=0&limit=50&status=confirmed \
    -u {API_KEY}:

Example response

{
    totalItems: 10,
    offset: 0,
    limit: 50,
    items: [
        {
            "id": "c8de947a-2483-4e36-9052-031e2aa3f0ac",
            "email": "geeks@snipcart.com",
            "billingAddressName": "Geeks Snipcart",
            "billingAddressCompanyName": "Snipcart",
            "billingAddressAddress1": "4885 1ere Avenue",
            "billingAddressAddress2": null,
            "billingAddressCity": "Québec",
            "billingAddressCountry": "CA",
            "billingAddressProvince": "QC",
            "billingAddressPostalCode": "G1H2T5",
            "billingAddressPhone": "",
            "shippingAddressName": "Geeks Snipcart",
            "shippingAddressCompanyName": "Snipcart",
            "shippingAddressAddress1": "4885 1ere Avenue",
            "shippingAddressAddress2": null,
            "shippingAddressCity": "Québec",
            "shippingAddressCountry": "CA",
            "shippingAddressProvince": "QC",
            "shippingAddressPostalCode": "G1H2T5",
            "shippingAddressPhone": "",
            "shippingAddressSameAsBilling": true,
            "sessionToken": null,
            "status": "Confirmed",
            "statistics": {
                "ordersCount": 10,
                "ordersAmount": 1000.00
            }
        },
        ...
    ]
}

GET /customers/{id}

This method returns a specific customer

Resource URL

GET https://app.snipcart.com/api/customers/{id}

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.

Parameters

Name Required? Type Description
id Yes Guid The customer unique ID.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/customers/c8de947a-2483-4e36-9052-031e2aa3f0ac \
    -u {API_KEY}:

Example response

{
    "id": "c8de947a-2483-4e36-9052-031e2aa3f0ac",
    "email": "geeks@snipcart.com",
    "billingAddressName": "Geeks Snipcart",
    "billingAddressCompanyName": "Snipcart",
    "billingAddressAddress1": "4885 1ere Avenue",
    "billingAddressAddress2": null,
    "billingAddressCity": "Québec",
    "billingAddressCountry": "CA",
    "billingAddressProvince": "QC",
    "billingAddressPostalCode": "G1H2T5",
    "billingAddressPhone": "",
    "shippingAddressName": "Geeks Snipcart",
    "shippingAddressCompanyName": "Snipcart",
    "shippingAddressAddress1": "4885 1ere Avenue",
    "shippingAddressAddress2": null,
    "shippingAddressCity": "Québec",
    "shippingAddressCountry": "CA",
    "shippingAddressProvince": "QC",
    "shippingAddressPostalCode": "G1H2T5",
    "shippingAddressPhone": "",
    "shippingAddressSameAsBilling": true,
    "sessionToken": null,
    "status": "Unconfirmed"
    "statistics": {
        "ordersCount": 10,
        "ordersAmount": 1000.00
    }
}

GET /customers/{id}/orders

This methods returns a list of orders

Resource URL

GET https://app.snipcart.com/api/customers/{id}

Headers

Name Value Required? Description
Accept application/json Yes Our API only accepts application/json content type, so you must always specify Accept: application/json header in each request you make.

Parameters

Name Required? Type Description
id Yes Guid The customer unique ID.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/customers/c8de947a-2483-4e36-9052-031e2aa3f0ac/orders \
    -u {API_KEY}:

Example response

[
    {
        "token": "d16e2f60-39f1-4a4c-b1c3-8a2e166d3f70",
        "creationDate": "2013-10-21T20:36:26.46Z",
        "modificationDate": "2013-10-21T20:36:26.46Z",
        "status": "Processed",
        "paymentMethod": "CreditCard",
        "invoiceNumber": "SNIP-0001",
        "email": "geeks@snipcart.com",
        "cardHolderName": "Geeks Snipcart",
        "creditCardLast4Digits": "4242",
        "billingAddressName": "Geeks Snipcart",
        "billingAddressCompanyName": "Snipcart",
        "billingAddressAddress1": "4885 1ere Avenue",
        "billingAddressAddress2": "",
        "billingAddressCity": "Québec",
        "billingAddressCountry": "CA",
        "billingAddressProvince": "QC",
        "billingAddressPostalCode": "G1H2T5",
        "billingAddressPhone": "1-877-301-4813",
        "notes": null,
        "shippingAddressName": "Geeks Snipcart",
        "shippingAddressCompanyName": "Snipcart",
        "shippingAddressAddress1": "4885 1ere Avenue",
        "shippingAddressAddress2": "",
        "shippingAddressCity": "Québec",
        "shippingAddressCountry": "CA",
        "shippingAddressProvince": "QC",
        "shippingAddressPostalCode": "G1H2T5",
        "shippingAddressPhone": "1-877-301-4813",
        "shippingAddressSameAsBilling": true,
        "finalGrandTotal": 443,
        "shippingFees": 0,
        "shippingMethod": "Free shipping",
        "items": [],
        "taxes": [],
        "promocodes": [],
        "willBePaidLater": false,
        "customFieldsJson": "[]",
        "paymentTransactionId": "gateway_payment_id",
    },
    ...
]

Was this article helpful?