Docs/API/Cart

Cart

Create, list, search, update, and delete carts — and the products inside them. Used by the hosted Simple Payments checkout and the JavaScript cart service.

The Cart API has two halves — carts themselves, and the products associated with them. A cart is a reusable checkout configuration: a named set of products, a layout, optional success/cancel URLs, and payment method settings. Products are the line items that can be added to carts.

Carts

Get a single cart

GET /merchant/{merchant_id}/cart/{cart_id}
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "d0doh5fsvrvasm390u6g",
    "merchant_id": "testmerchant12345678",
    "card_processor_id": "",
    "ach_processor_id": "",
    "name": "initiatives",
    "description": "sample cart description",
    "type": "normal",
    "custom_fields_group": "default",
    "products": [
      {
        "id": "d0doh5fsvrvasm390u30",
        "public_hash": "fe254495-bca4-4d2b-9960-da166ae5f36f",
        "merchant_id": "testmerchant12345678",
        "sku": "dbb3fd7a-31f0-4431-8a55-1a1935844c64",
        "name": "bleeding-edge",
        "img": "https://picsum.photos/250/159",
        "price": 233,
        "local_tax": 225,
        "national_tax": 210,
        "fixed_amount": true,
        "fixed_qty": false,
        "description": "sample product description",
        "created_at": "2025-05-07T16:21:42Z",
        "updated_at": "2025-05-07T16:21:42Z"
      }
    ],
    "show_available_products": true,
    "require_shipping_details": false,
    "email_receipt": false,
    "payments": ["card", "ach"],
    "success_url": "https://yoursite.com/thanks",
    "cancel_url": "https://yoursite.com/checkout",
    "settings": {
      "product_subtitle_verbiage": "Products",
      "save_customer_vault": "none"
    }
  }
}

Search carts

POST /merchant/{merchant_id}/cart/search

The body uses the gateway's query-object syntax — each filterable field maps to an object with operator (=, !=, and for numeric fields < or >) and value.

FieldTypeDescription
idQuerySearchStringFilter by cart ID.
nameQuerySearchStringFilter by cart name.
productQuerySearchStringFilter by the name of a product inside the cart.
created_at / updated_at / deleted_atQueryDateRangeDate-range filters.
limitintegerMaximum records, 0–100.
offsetintegerRecords to skip.

Get all carts

GET /merchant/{merchant_id}/cart

Create a cart

POST /merchant/{merchant_id}/cart
FieldTypeRequiredDescription
typestringrequirednormal or donation.
namestringrequired1–100 characters.
descriptionstringoptionalFree-text description.
custom_fields_groupstringoptionalFewer than 255 characters. References a custom-field group name.
card_processor_idstringoptionalOverride default card processor. Matches ^[0-9a-v]{20}$.
ach_processor_idstringoptionalOverride default ACH processor. Matches ^[0-9a-v]{20}$.
success_urlstringoptionalRedirect URL on successful checkout.
cancel_urlstringoptionalRedirect URL on cancellation.
show_available_productsbooleanoptionalShow the full catalog of products on the hosted page.
require_shipping_detailsbooleanoptionalForce collection of a shipping address.
email_receiptbooleanoptionalAutomatically email a receipt on success.

Update a cart

POST /merchant/{merchant_id}/cart/{cart_id}
{
  "name": "initiatives",
  "description": "sample description",
  "type": "normal",
  "custom_fields_group": "default",
  "payments": ["card", "ach"],
  "products": ["product1", "product2", "product3", "product4"],
  "show_available_products": false,
  "require_shipping_details": false,
  "email_receipt": false,
  "success_url": "",
  "cancel_url": "",
  "settings": null
}

Delete a cart

DELETE /merchant/{merchant_id}/cart/{cart_id}

Products

Get a single product

GET /api/merchant/{merchant_id}/product/{product_id}
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "d0ecs87svrvfjfvijd70",
    "public_hash": "f164740d-1005-4f9a-b958-111e4704840f",
    "merchant_id": "testmerchant12345678",
    "sku": "acdfd73e-9fae-45ab-8c5e-c6a6920aff30",
    "name": "applications",
    "img": "https://picsum.photos/244/223",
    "price": 708,
    "local_tax": 388,
    "national_tax": 444,
    "fixed_amount": true,
    "fixed_qty": false,
    "description": "sample description"
  }
}

Search products

POST /api/merchant/{merchant_id}/product/search
FieldTypeDescription
idQuerySearchStringFilter by product ID.
nameQuerySearchStringFilter by product name.
priceQuerySearchIntFilter by price (supports <, > in addition to =, !=).
created_at / updated_at / deleted_atQueryDateRangeDate-range filters.
limitinteger0–100.
offsetintegerRecords to skip.

Get all products

GET /api/merchant/{merchant_id}/product

Create a product

POST /api/merchant/{merchant_id}/product
FieldTypeRequiredDescription
skustringrequiredProduct SKU. Regex [0-9a-z]{0-20}.
namestringrequiredDisplay name. Regex [0-9a-z -]{0-100}.
imgstringoptionalProduct image, base64-encoded.
priceunsigned intrequiredUnit price in cents.
fixed_amountbooleanrequiredWhen true, the amount is locked. When false, the shopper can enter their own.
fixed_qtybooleanrequiredWhen true, the quantity is locked.
descriptionstringrequiredUp to 254 characters.

Update a product

POST /api/merchant/{merchant_id}/product/{product_id}

Delete a product

DELETE /api/merchant/{merchant_id}/product/{product_id}