json icon

Create Order

v1.0.0commands

Command to create a new order from a checked-out cart.

1{
2  "$schema": "http://json-schema.org/draft-07/schema#",
3  "title": "CreateOrder",
4  "description": "Command to create a new order from a checked-out cart",
5  "type": "object",
6  "properties": {
7    "cartId": {
8      "description": "Identifier of the cart this order was created from",
9      "type": "string",
10      "format": "uuid"
11    },
12    "customerId": {
13      "description": "Identifier of the customer placing the order",
14      "type": "string",
15      "format": "uuid"
16    },
17    "items": {
18      "description": "The items in the order",
19      "type": "array",
20      "items": {
21        "type": "object",
22        "properties": {
23          "productId": {
24            "type": "string",
25            "format": "uuid"
26          },
27          "quantity": {
28            "type": "integer",
29            "minimum": 1
30          },
31          "unitPrice": {
32            "type": "integer",
33            "description": "Price per unit in minor units (e.g. cents)"
34          }
35        },
36        "required": ["productId", "quantity", "unitPrice"]
37      }
38    },
39    "total": {
40      "description": "Order total in minor units (e.g. cents)",
41      "type": "integer",
42      "minimum": 0
43    },
44    "currency": {
45      "description": "ISO 4217 currency code",
46      "type": "string",
47      "pattern": "^[A-Z]{3}$"
48    },
49    "paymentAuthorizationId": {
50      "description": "Identifier of the payment authorization for this order",
51      "type": "string"
52    }
53  },
54  "required": ["cartId", "customerId", "items", "total", "currency"]
55}
56

Details

Format
JSON Schema
Resource
commands
Filename
schema.json

Versions