Abandoned Carts API

The Abandoned Carts API lets you retrieve carts that customers started but never completed (status InProgress). Requests are authenticated with your secret API key, sent as the HTTP Basic username with an empty password. With curl: -u {API_KEY}:. See Authentication for details. Every request must send Accept: application/json.

These endpoints share the carts/{status} route family with completed carts; for abandoned carts the {status} segment is always abandoned. Access requires the Abandoned Carts feature to be enabled on your account.

Table of contents

GET /carts/abandoned

Returns a paged list of abandoned carts for your account. Results are paged with a default limit of 20 per page. Paging is cursor-based: each response includes a hasMoreResults boolean and, when more results exist, a continuationToken to pass on the next request.

Resource URL

GET https://app.snipcart.com/api/carts/abandoned

Headers

Name Required Description
Accept Yes Must be application/json. Our API only serves JSON.

Query Parameters

Name Required Type Description
limit No long Maximum number of carts to return per page. Defaults to 20.
continuationToken No string Cursor returned by a previous request (in the continuationToken field). Pass it to fetch the next page of the same query.
timeRange No string Restricts results to carts abandoned within a window. One of Anytime, LessThan4Hours, LessThanADay, LessThanAWeek, LessThanAMonth.
minimalValue No decimal Excludes carts whose total is below this value.
email No string Returns only carts associated with this email address.
productId No string Returns only carts containing the product with this ID.
campaignId No string Returns only carts associated with this recovery campaign.

⚠️ Important: Paging is cursor-based, not offset-based. There is no offset parameter — use continuationToken to walk through pages.

Example request

curl -H "Accept: application/json" \
    "https://app.snipcart.com/api/carts/abandoned?limit=50&timeRange=LessThan4Hours" \
    -u {API_KEY}:

Example response

{
  "continuationToken": "Cart|9rZW4iOiIrUklEOkVsaG1BTjRFel...",
  "hasMoreResults": true,
  "items": [
    {
      "id": "5e6e8393-c02c-4a44-a054-6dc8356bab66",
      "token": "5e6e8393-c02c-4a44-a054-6dc8356bab66",
      "mode": "Test",
      "email": "customer@example.com",
      "status": "InProgress",
      "creationDate": "2016-11-08T17:10:00Z",
      "modificationDate": "2016-11-08T17:15:12Z",
      "shipToBillingAddress": true,
      "billingAddress": {
        "fullName": "Jane Doe",
        "firstName": "Jane",
        "name": "Doe",
        "company": "Snipcart",
        "address1": "226 Rue Saint-Joseph Est",
        "address2": "",
        "city": "Québec",
        "country": "CA",
        "postalCode": "G1K3A9",
        "province": "QC",
        "phone": "(555) 555-5555"
      },
      "shippingAddress": {
        "fullName": "Jane Doe",
        "name": "Doe",
        "address1": "226 Rue Saint-Joseph Est",
        "city": "Québec",
        "country": "CA",
        "postalCode": "G1K3A9",
        "province": "QC"
      },
      "completionDate": null,
      "shippingInformation": {
        "fees": 10,
        "method": "Fast custom shipping"
      },
      "summary": {
        "subtotal": 20,
        "taxableTotal": 20,
        "total": 30,
        "payableNow": 30,
        "paymentMethod": null,
        "taxes": []
      },
      "items": [
        {
          "uniqueId": "0fe3b1d4-3334-4d34-9722-a4d59f529190",
          "token": "5e6e8393-c02c-4a44-a054-6dc8356bab66",
          "id": "42",
          "name": "The Geek Shirt",
          "price": 20,
          "description": "Be the coolest geek in town with this awesome shirt.",
          "url": "https://example.com/products/geek-shirt",
          "image": "https://example.com/images/geek-shirt.png",
          "quantity": 1,
          "stackable": true,
          "shippable": true,
          "taxable": true,
          "taxes": [],
          "customFields": [],
          "duplicatable": false,
          "alternatePrices": {},
          "dimensions": {
            "weight": 20
          },
          "unitPrice": 20,
          "totalPrice": 20,
          "addedOn": "2016-11-08T17:15:13Z"
        },
        ...
      ],
      "discounts": [],
      "customFields": [],
      "refunds": [],
      "currency": "cad",
      "totalWeight": 20,
      "itemsTotal": 20,
      "total": 30
    },
    ...
  ]
}

GET /carts/abandoned/{token}

Returns a single abandoned cart by its token. The cart must still be abandoned (status InProgress); requesting a token that has since been completed returns 404 Not Found.

Resource URL

GET https://app.snipcart.com/api/carts/abandoned/{token}

Headers

Name Required Description
Accept Yes Must be application/json. Our API only serves JSON.

Path Parameters

Name Required Type Description
token Yes guid The unique token of the cart to retrieve.

Example request

curl -H "Accept: application/json" \
    https://app.snipcart.com/api/carts/abandoned/35cb24c1-00d5-4b26-a16d-4a99bcde8ea3 \
    -u {API_KEY}:

Example response

{
  "id": "35cb24c1-00d5-4b26-a16d-4a99bcde8ea3",
  "token": "35cb24c1-00d5-4b26-a16d-4a99bcde8ea3",
  "mode": "Test",
  "email": "customer@example.com",
  "status": "InProgress",
  "creationDate": "2016-11-08T17:40:00Z",
  "modificationDate": "2016-11-08T17:48:23Z",
  "shipToBillingAddress": true,
  "billingAddress": {
    "fullName": "Jane Doe",
    "firstName": "Jane",
    "name": "Doe",
    "company": "Snipcart",
    "address1": "226 Rue Saint-Joseph Est",
    "address2": "",
    "city": "Québec",
    "country": "CA",
    "postalCode": "G1K3A9",
    "province": "QC",
    "phone": "(555) 555-5555"
  },
  "shippingAddress": {
    "fullName": "Jane Doe",
    "name": "Doe",
    "address1": "226 Rue Saint-Joseph Est",
    "city": "Québec",
    "country": "CA",
    "postalCode": "G1K3A9",
    "province": "QC"
  },
  "completionDate": null,
  "shippingInformation": {
    "fees": 10,
    "method": "Fast custom shipping"
  },
  "summary": {
    "subtotal": 20,
    "taxableTotal": 20,
    "total": 30,
    "payableNow": 30,
    "paymentMethod": null,
    "taxes": []
  },
  "items": [
    {
      "uniqueId": "27ab2f3e-1a03-4b23-9407-65d940b182ea",
      "token": "35cb24c1-00d5-4b26-a16d-4a99bcde8ea3",
      "id": "42",
      "name": "The Geek Shirt",
      "price": 20,
      "description": "Be the coolest geek in town with this awesome shirt.",
      "url": "https://example.com/products/geek-shirt",
      "image": "https://example.com/images/geek-shirt.png",
      "quantity": 1,
      "stackable": true,
      "shippable": true,
      "taxable": true,
      "taxes": [],
      "customFields": [],
      "duplicatable": false,
      "alternatePrices": {},
      "dimensions": {
        "weight": 20
      },
      "unitPrice": 20,
      "totalPrice": 20,
      "addedOn": "2016-11-08T17:48:25Z"
    },
    ...
  ],
  "discounts": [],
  "customFields": [],
  "refunds": [],
  "currency": "cad",
  "totalWeight": 20,
  "itemsTotal": 20,
  "total": 30
}

Was this article helpful?