create-pos-order
Method: POST
Path: /pos/orders
Tags: POS
Summary
Create order
Description
Creates a new order from a POS device.
TypeScript Definition
typescript
"create-pos-order": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
cart_id: string;
/** @description Optional. if provided, this device will be used for the payment of this order. Otherwise, already claimed device will be used for the payment purpose. */
device_id?: string;
} & (components["schemas"]["PayWithCash"] | components["schemas"]["PayWithUpi"] | components["schemas"]["PayWithCard"] | components["schemas"]["PayWithPaymentGateway"]);
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
order: components["schemas"]["Order"];
/** @description true if to_be_paid > 0, otherwise false for zero value order. */
payment_required: boolean;
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["PayWithCash"] | PayWithCash |
components["schemas"]["PayWithUpi"] | PayWithUpi |
components["schemas"]["PayWithCard"] | PayWithCard |
components["schemas"]["PayWithPaymentGateway"] | PayWithPaymentGateway |
components["schemas"]["Order"] | Order |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Not authorized for given operation on the Resource
OpenAPI Definition
json
{
"tags": [
"POS"
],
"operationId": "create-pos-order",
"summary": "Create order",
"description": "Creates a new order from a POS device.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/create-pos-order",
"description": "API reference for the create-pos-order operation"
},
"parameters": [],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"required": [
"cart_id"
],
"properties": {
"cart_id": {
"type": "string"
},
"device_id": {
"description": "Optional. if provided, this device will be used for the payment of this order. Otherwise, already claimed device will be used for the payment purpose.",
"type": "string"
}
}
},
{
"oneOf": [
{
"$ref": "#/components/schemas/PayWithCash"
},
{
"$ref": "#/components/schemas/PayWithUpi"
},
{
"$ref": "#/components/schemas/PayWithCard"
},
{
"$ref": "#/components/schemas/PayWithPaymentGateway"
}
]
}
]
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"order": {
"$ref": "#/components/schemas/Order"
},
"payment_required": {
"description": "true if to_be_paid > 0, otherwise false for zero value order.",
"type": "boolean"
}
},
"required": [
"order",
"payment_required"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "pos",
"x-speakeasy-ignore": true,
"x-speakeasy-name-override": "createPosOrder"
}Auto-generated from OpenAPI spec and TypeScript definitions