> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sp3ndpay.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Cart

> Generate checkout cart with pricing

## Endpoint

```http theme={null}
POST /v1/carts
```

## Request

```bash theme={null}
curl -X POST https://api.sp3ndpay.shop/v1/carts \
  -H "Authorization: Bearer sp3ndpay_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [{"product_url": "https://www.amazon.com/dp/B0CDEMO123", "quantity": 1}],
    "ship_to_country": "US",
    "ship_to_postal_code": "10001"
  }'
```

## Parameters

| Parameter             | Type    | Required |
| --------------------- | ------- | -------- |
| `items`               | array   | Yes      |
| `items[].product_url` | string  | Yes      |
| `items[].quantity`    | integer | Yes      |
| `ship_to_country`     | string  | Yes      |
| `ship_to_postal_code` | string  | No       |

## Response

```json theme={null}
{
  "cart": {
    "id": "cart_7K2pQ9xM",
    "status": "ready",
    "currency": "USD",
    "subtotal": 89.99,
    "shipping": 8.95,
    "tax": 7.65,
    "service_fee": 2.68,
    "total": 109.27,
    "expires_at": "2026-05-04T18:30:00Z",
    "items": [...]
  }
}
```

## Cart Expiration

<Warning>
  Carts expire after 30 minutes. Create new cart if expired.
</Warning>

## Errors

**Product Unavailable:**

```json theme={null}
{
  "error": {
    "code": "product_unavailable",
    "message": "One or more products unavailable"
  }
}
```

**Shipping Unavailable:**

```json theme={null}
{
  "error": {
    "code": "shipping_unavailable",
    "message": "Cannot ship to destination"
  }
}
```

<Card title="Create Order" icon="file-invoice" href="/api-reference/create-order">
  Next: Create order
</Card>
