Skip to content

Create an order

Request

Authorize a new order for a customer.

Security
bearerAuth or basicAuth
Bodyapplication/json

Fields for creating a new order.

amountnumber, (double), >= 0required

Amount to authorize for the order in USD.

Example:1000
customer_idstringrequired

Unique identifier of the customer placing the order.

Example:"X50sgfRd"
line_itemsArray of objects, non-empty(OrderLineItem)required

Line items for the order. At least one item is required.

order_numberstring

Your internal order number.

Example:"5055"
po_numberstring

Purchase order number.

Example:"PO-555"
advance_requestedboolean

Whether to request an advance on this order.

Example:false
sourcestring

Source channel creating the order.

Example:"checkout"
metadataobject

Custom metadata to attach to the order.

Example:
{ "internal_ref": "ref-001" }
curl -i -X POST \
  https://docs.resolvepay.com/_mock/merchant-api/openapi/orders \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 1000,
    "customer_id": "X50sgfRd",
    "line_items": [
      {
        "name": "Widget A",
        "quantity": 2,
        "unit_price": 50,
        "sku": "ABC-123",
        "total_price": 100,
        "type": "product",
        "tax_amount": 8.5
      }
    ],
    "order_number": "5055",
    "po_number": "PO-555",
    "source": "checkout",
    "metadata": {
      "internal_ref": "ref-001"
    }
  }'

Responses

An object representing an order.

Bodyapplication/json
idstring

Unique identifier for the order.

Example:"ORDlaE5wbg0"
checkout_idstring

ID of the checkout session associated with this order.

Example:"CHKabc123"
numberstring

Order number identifier.

Example:"ord_100001"
po_numberstring

Purchase order number associated with the order.

Example:"PO-555"
advance_requestedboolean

Whether an advance was requested for this order.

Example:false
sourcestring

Source channel that created the order.

Example:"checkout"
statusstring

Current status of the order.

Example:"authorized"
amount_authorizednumber, (double)

Total authorized amount for the order in USD.

Example:1000
amount_capturednumber, (double)

Total captured amount for the order in USD.

Example:500
amount_cancelednumber, (double)

Total canceled amount for the order in USD.

Example:0
amount_remainingnumber, (double)

Remaining authorized amount available for capture in USD.

Example:500
first_captured_atstring or null, (date-time)

Timestamp of the first capture event.

Example:"2024-01-15T10:00:00.000Z"
line_itemsArray of objects(OrderLineItem)

Line items associated with the order.

authorization_expires_atstring, (date-time)

Timestamp when the authorization expires.

Example:"2024-02-15T10:00:00.000Z"
authorization_expiry_sourcestring

Source that determined the authorization expiry.

Example:"system"
capture_eventsArray of objects(OrderCaptureEvent)

List of capture events for this order.

authorized_atstring, (date-time)

Timestamp when the order was authorized.

Example:"2024-01-01T00:00:00.000Z"
updated_atstring, (date-time)

Timestamp when the order was last updated.

Example:"2024-01-15T10:00:00.000Z"
customerobject(OrderCustomer)
Response
{ "id": "ORDlaE5wbg0", "checkout_id": "CHKabc123", "number": "ord_100001", "po_number": "PO-555", "advance_requested": false, "source": "checkout", "status": "authorized", "amount_authorized": 1000, "amount_captured": 500, "amount_canceled": 0, "amount_remaining": 500, "first_captured_at": "2024-01-15T10:00:00.000Z", "line_items": [ { … } ], "authorization_expires_at": "2024-02-15T10:00:00.000Z", "authorization_expiry_source": "system", "capture_events": [ { … } ], "authorized_at": "2024-01-01T00:00:00.000Z", "updated_at": "2024-01-15T10:00:00.000Z", "customer": { "id": "X50sgfRd", "name": "Acme Corp", "remaining_credit": 5000 } }