Sign in

Create an order

documented

Creates a new platform order.

POST /api/v2/platform/ordersOrdersno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://demo.spreecommerce.org/api/v2/platform/orders" \
  -X POST \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.api+json" \
  -d '{
  "order": {
    "email": "{{$email}}",
    "currency": "{{$currency}}",
    "special_instructions": "{{$special_instructions}}",
    "item_total": {{$item_total}},
    "total": {{$total}},
    "state": "{{$state}}",
    "shipment_total": {{$shipment_total}},
    "payment_total": {{$payment_total}}
  },
  "ship_address_attributes": {
    "address": {
      "address1": "{{$ship_address1}}",
      "city": "{{$ship_city}}",
      "country_id": "{{$ship_country_id}}",
      "state_id": "{{$ship_state_id}}",
      "zipcode": "{{$ship_zip}}",
      "firstname": "{{$ship_firstname}}",
      "lastname": "{{$ship_lastname}}",
      "phone": "{{$ship_phone}}"
    }
  },
  "bill_address_attributes": {
    "address": {
      "address1": "{{$bill_address1}}",
      "city": "{{$bill_city}}",
      "country_id": "{{$bill_country_id}}",
      "state_id": "{{$bill_state_id}}",
      "zipcode": "{{$bill_zip}}"
    }
  },
  "line_items_attributes": [
    {
      "line_item": {
        "variant_id": "{{$variant_id}}",
        "quantity": {{$quantity}}
      }
    }
  ]
}'
Create an order · Spree Commerce · OpenIntegrations