Customers

Retrieve all orders for a customer

get/customers/{id}/orders

Path parameters

idinteger required

The SamCart ID for the customer

Query parameters

created_at_minstring date-time

Filter by created at date/time at or after given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 00:00:00 UTC.

created_at_maxstring date-time

Filter by created at date/time at or before given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 23:59:59 UTC.

test_modeboolean

Filter by test mode

Response

Successful operation. Response will return an array of 0 or more orders

idinteger

The SamCart ID of the order

customer_idinteger

The SamCart ID of the customer

affiliate_idinteger nullable

The SamCart ID of the affiliate credited for the order

funnel_idinteger nullable

The funnel ID associated with this order. Null if the order was not placed through a funnel.

upsell_idinteger nullable

The upsell ID if this order contains upsell purchases. Null if the order has no upsell items. For orders with multiple upsells, returns the first upsell ID.

test_modeboolean

Indicates whether the transaction was done while the product was in test mode

order_datestring date-time

The UTC date and time for when the order was created

subtotalinteger

The total price of the order (in cents) excluding discount, shipping and tax fees

discountinteger

The total discount (in cents) on the order

taxesinteger

The total of tax fees (in cents) of the order

shippinginteger

The total of shipping fees (in cents) of the order

totalinteger

The total price of the order (in cents) including discount, shipping and tax fees

card_usedstring nullable

The last 4 digits of the card that was used. PayPal charges will have a null value.

processor_name'Stripe' | 'Braintree' | 'Authorize.net' | 'PayPal'

The name of the processor for the order

upsell_custom_fieldsobject

Optional custom fields applied to the upsells for the order

Example response

[
  {
    "id": 1337,
    "customer_id": 1234,
    "affiliate_id": 1001,
    "funnel_id": 12345,
    "upsell_id": 5678,
    "test_mode": true,
    "order_date": "2021-03-08 00:18:35",
    "cart_items": [
      {
        "id": 1234,
        "product_id": 1234,
        "subscription_id": 1234,
        "upsell_id": 5678,
        "sku": "sku1234",
        "internal_product_name": "internal-book-product",
        "product_name": "Book",
        "charge_id": 1234,
        "pricing_type": "one_time",
        "processor_transaction_id": "01234ABCD",
        "currency": "USD",
        "quantity": 2,
        "status": "charged",
        "upgraded": true,
        "initial_price": {
          "subtotal": 10000,
          "taxes": 500,
          "shipping": 300,
          "total": 9800
        },
        "recurring_price": {
          "subtotal": 10000,
          "taxes": 500,
          "shipping": 300,
          "total": 10800
        },
        "coupon": {
          "charge_instance": "one_time",
          "code": "summersale",
          "type": "flat_rate",
          "discount_percentage": 10
        }
      }
    ],
    "subtotal": 10000,
    "discount": 1000,
    "taxes": 500,
    "shipping": 300,
    "shipping_address": {
      "type": "shipping",
      "street": "221B Baker Street",
      "postal_code": "1234",
      "city": "Austin",
      "state": "TX",
      "region": "Quebec",
      "country": "United States"
    },
    "total": 9800,
    "card_used": "0123",
    "processor_name": "Stripe",
    "custom_fields": {
      "Name": {
        "value": "Blue",
        "slug": "custom_zL6FLFM3"
      }
    }
  }
]

Changes

No recorded changes to this endpoint across all 1 revision of this API.