> ## 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 Order

> Generate order with delivery and payment

## Endpoint

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

## Request

```bash theme={null}
curl -X POST https://api.sp3ndpay.shop/v1/orders \
  -H "Authorization: Bearer sp3ndpay_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "cart_id": "cart_7K2pQ9xM",
    "customer_email": "customer@example.com",
    "payment_asset": "USDC",
    "shipping_address": {
      "name": "Alex Johnson",
      "phone": "+1 555 123 4567",
      "line1": "123 Market St",
      "city": "New York",
      "region": "NY",
      "postal_code": "10001",
      "country": "US"
    }
  }'
```

## Parameters

| Parameter          | Type   | Required |
| ------------------ | ------ | -------- |
| `cart_id`          | string | Yes      |
| `customer_email`   | string | Yes      |
| `payment_asset`    | string | Yes      |
| `shipping_address` | object | Yes      |

## Response

```json theme={null}
{
  "order": {
    "id": "ord_8nJ42rA",
    "number": "SP3ND-184920",
    "status": "created",
    "total": 109.27,
    "payment_asset": "USDC",
    "payment_amount": "109.27",
    "payment_address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "payment_memo": "SP3ND-184920",
    "payment_expires_at": "2026-05-04T18:45:00Z",
    "tracking_url": "https://sp3ndpay.shop/track?order=SP3ND-184920"
  }
}
```

## Payment Instructions

User must:

1. Send `payment_amount` of `payment_asset` to `payment_address`
2. Include `payment_memo` in transaction
3. Complete before `payment_expires_at`

<Warning>
  Payment memo is required to match transaction to order.
</Warning>

## Order Status

Created → Paid → Ordered → Shipped → Delivered

## Errors

**Cart Not Found:**

```json theme={null}
{
  "error": {
    "code": "cart_not_found",
    "message": "Cart does not exist or expired"
  }
}
```

**Invalid Address:**

```json theme={null}
{
  "error": {
    "code": "invalid_address",
    "message": "Shipping address invalid or incomplete"
  }
}
```

<Card title="Get Order" icon="truck-fast" href="/api-reference/get-order">
  Next: Track order
</Card>
