> ## Documentation Index
> Fetch the complete documentation index at: https://rushly-82799ffa.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Order

> Create a same-day delivery order for a customer

Creates a delivery order, then automatically attempts to dispatch it to the nearest eligible driver. See [Authentication](/authentication) for how to get a key, and [Order Lifecycle](/order-lifecycle) for what happens after this call.

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer rk_your_api_key` — see [Authentication](/authentication).
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body

<ParamField body="retailer_id" type="string" required>
  Your store's Rushly ID, given to you alongside your API key.
</ParamField>

<ParamField body="customer" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="name" type="string" required>
      Customer's full name.
    </ParamField>

    <ParamField body="email" type="string" required>
      Customer's email.
    </ParamField>

    <ParamField body="phone" type="string" required>
      Customer's phone number, E.164 format (e.g. `+19495550192`). Used to
      send the order-confirmed text and tracking link.
    </ParamField>

    <ParamField body="sms_opt_in" type="boolean" default="false">
      Whether the customer consented to receive SMS updates. If `false`, the
      order is still created and dispatched normally — the customer just
      won't be texted a tracking link, so make sure your own confirmation
      page or email surfaces it instead.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="pickup_address" type="string" required>
  Your store's address, as a single formatted string (e.g. `"123 Fashion
      Ave, Irvine, CA 92614"`).
</ParamField>

<ParamField body="dropoff_address" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="line1" type="string" required />

    <ParamField body="line2" type="string" />

    <ParamField body="city" type="string" required />

    <ParamField body="state" type="string" required>
      Two-letter state code (e.g. `"CA"`).
    </ParamField>

    <ParamField body="zip" type="string" required />
  </Expandable>
</ParamField>

<ParamField body="delivery_tier" type="string" default="standard">
  One of `standard`, `priority`, or `scheduled`. See [Delivery
  Tiers](/delivery-tiers) for pricing and what each means for dispatch.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://rushly-backend-660939316816.us-west2.run.app/orders/create \
    -H "Authorization: Bearer rk_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "retailer_id": "your-retailer-id",
      "customer": {
        "name": "Sarah Chen",
        "email": "sarah@example.com",
        "phone": "+19495550192",
        "sms_opt_in": true
      },
      "pickup_address": "123 Fashion Ave, Irvine, CA 92614",
      "dropoff_address": {
        "line1": "456 Oak Street",
        "line2": "Apt 2B",
        "city": "Irvine",
        "state": "CA",
        "zip": "92618"
      },
      "delivery_tier": "standard"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "success": true,
    "message": "Order created successfully",
    "order": {
      "id": "1bebe287-c9da-49f9-8db7-20c77cd427c1",
      "status": "driver_assigned",
      "delivery_tier": "standard",
      "delivery_fee": 2500,
      "payment_status": "succeeded",
      "tracking_token": "ce0470cf-08ea-40e3-b935-5243c99e60b8",
      "created_at": "2026-08-08T02:56:00.725Z"
    }
  }
  ```
</ResponseExample>

## Response

<ResponseField name="order.id" type="string">
  The order's ID. Not needed for anything client-facing — use
  `tracking_token` for that — but useful for your own records.
</ResponseField>

<ResponseField name="order.status" type="string">
  `pending_dispatch` if no driver was immediately available, `driver_assigned` if dispatch succeeded synchronously. See [Order Lifecycle](/order-lifecycle) for the full set of values and how status changes after this point.
</ResponseField>

<ResponseField name="order.delivery_tier" type="string">
  Echoes back the tier that was used (defaults to `standard` if you didn't send one).
</ResponseField>

<ResponseField name="order.delivery_fee" type="integer">
  The price charged for this delivery, in cents. Always derived server-side from `delivery_tier` — see [Delivery Tiers](/delivery-tiers).
</ResponseField>

<ResponseField name="order.payment_status" type="string">
  Whether your store's card on file was successfully charged. See [Order Lifecycle](/order-lifecycle#billing).
</ResponseField>

<ResponseField name="order.tracking_token" type="string">
  The token in the customer's tracking link: `https://rushly.us/track/{tracking_token}`.
</ResponseField>

<Note>
  A few other fields are present on `order` (`customer_id`, `driver_id`,
  `dropoff_address_id`, `stripe_charge_id`, timestamps, and some
  driver-payout bookkeeping fields) — they're internal and safe to ignore.
</Note>

## Errors

<ResponseField name="400 Bad Request" type="object">
  `delivery_tier` was set to something other than `standard`, `priority`, or `scheduled`.
</ResponseField>

<ResponseField name="401 Unauthorized" type="object">
  The API key is missing or wrong, doesn't match the `retailer_id` you sent, or your store's status isn't `active` yet. Double-check both values are exactly what you were given — see [Authentication](/authentication#testing-your-key).
</ResponseField>

<ResponseField name="500 Internal Server Error" type="object">
  Something went wrong on Rushly's end. Safe to retry; contact [support@rushly.us](mailto:support@rushly.us) if it persists.
</ResponseField>
