---
title: "Create an order"
method: POST
path: "/orders"
tags: ["Orders"]
---

# Create an order

`POST /orders`

## Request

- Base URL: `https://app-sandbox.resolvepay.com/api`
- URL: `https://app-sandbox.resolvepay.com/api/orders`
- Auth: one of:
  - HTTP bearer
  - HTTP basic
- TypeScript: <https://skmtc.dev/resolvepay/apis/resolve-partners-api-reference/docs/orders/post.ts> (a function with typed inputs; its response is checked against the schema)

Authorize a new order for a customer of one of your sub-merchants. The order is placed with the sub-merchant the customer belongs to; a customer outside your partner account is rejected.

## Request body

- OrderCreateRequest
  - `amount` number, double, required: Amount to authorize for the order in USD.
  - `customer_id` string, required: Unique identifier of the customer placing the order. The order is placed with the sub-merchant this customer belongs to.
  - `line_items` OrderLineItem[], required: Line items for the order. At least one item is required.
    - `name` string: Name or description of the line item.
    - `quantity` number: Quantity of units.
    - `unit_price` number, double: Price per unit in USD.
    - `sku` string: SKU or product identifier.
    - `total_price` number, double: Total price for this line item in USD. Defaults to unit_price × quantity if omitted.
    - `type` string: Line item type. Common values: `product`, `shipping`, `subtotal`.
    - `tax_amount` number, double: Tax amount for this line item in USD.
  - `order_number` string: The sub-merchant's order number.
  - `po_number` string: Purchase order number.
  - `advance_requested` boolean: Whether to place the order on net terms against the customer's credit line. Defaults to `true`.
  - `source` string: Source channel creating the order. Defaults to `api`.
  - `metadata` object: Custom metadata to attach to the order.

## Response `200`

An object representing an order.

- Order
  - `id` string: Unique identifier for the order.
  - `merchant_id` string: ID of the sub-merchant this order belongs to.
  - `checkout_id` string, nullable: ID of the checkout session that produced this order when a buyer authorized it through the sub-merchant's Checkout SDK. `null` for orders created through the API.
  - `number` string, nullable: Order number identifier.
  - `po_number` string, nullable: Purchase order number associated with the order.
  - `advance_requested` boolean: Whether the order is placed on net terms against the customer's credit line.
  - `source` string: Channel that created the order, for example `checkout` for Checkout SDK orders or `api` for orders created through the API.
  - `status` 'authorized' | 'partially_captured' | 'fully_captured' | 'canceled': Current status of the order.
  - `amount_authorized` number, double: Total authorized amount for the order in USD.
  - `amount_captured` number, double: Total captured amount for the order in USD.
  - `amount_canceled` number, double: Total canceled amount for the order in USD.
  - `amount_remaining` number, double: Remaining authorized amount available for capture in USD.
  - `first_captured_at` string, date-time, nullable: Timestamp of the first capture event.
  - `line_items` OrderLineItem[], nullable: Line items associated with the order.
    - `name` string: Name or description of the line item.
    - `quantity` number: Quantity of units.
    - `unit_price` number, double: Price per unit in USD.
    - `sku` string: SKU or product identifier.
    - `total_price` number, double: Total price for this line item in USD. Defaults to unit_price × quantity if omitted.
    - `type` string: Line item type. Common values: `product`, `shipping`, `subtotal`.
    - `tax_amount` number, double: Tax amount for this line item in USD.
  - `authorization_expires_at` string, date-time, nullable: Timestamp when the authorization expires.
  - `authorization_expiry_source` string, nullable: Source that determined the authorization expiry.
  - `authorized_at` string, date-time: Timestamp when the order was authorized.
  - `updated_at` string, date-time: Timestamp when the order was last updated.
  - `customer` OrderCustomer
    - `id` string: Unique identifier of the customer.
    - `name` string: Business name of the customer.
    - `remaining_credit` number, double: Remaining available credit for the customer in USD.
  - `capture_events` OrderCaptureEvent[]: Capture events for this order. Present on single-order responses; omitted from list results.
    - `amount` number, double: Amount captured in this capture event in USD.
    - `idempotency_key` string: Idempotency key used for this capture.
    - `processed_at` string, date-time: Timestamp when this capture was processed.
    - `invoice_id` string: ID of the sub-merchant's invoice created by this capture.

## Other responses

- `400`: Bad request error
- `401`: Unauthorized error
- `403`: Forbidden error
- `429`: Rate limit error

---

[API](https://skmtc.dev/resolvepay/apis/resolve-partners-api-reference.md) - [All operations](https://skmtc.dev/resolvepay/apis/resolve-partners-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/resolvepay/apis/resolve-partners-api-reference/revisions/5a1c75b8b404?raw)
