Download OpenAPI specification:Download
OrderService API spec (Default Adapter)
API documentation for OrderService default adapter.
{- "status": "ok",
- "packageInfo": {
- "gitCommitHash": "82fc145",
- "sdkVersion": "3.2.0",
- "serviceAdapterAPIVersion": "^3.5.0",
- "serviceName": "@basaldev/blocks-order-service",
- "serviceVersion": "2.14.1"
}
}
Retrieves a list of orders across all users and organizations.
This operation requires user is
- a system admin
$skip | integer Example: $skip=100 The maximum number of the items to skip (The Default value is 0). | ||||||||||||||||||||||||||||||||||||
$nextToken | string Example: $nextToken=token A unique token to get next batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$previousToken | string Example: $previousToken=token A unique token to get previous batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$filter | string Return only items which matches to a condition (The operators below are listed in order of precedence from highest to lowest).
Examples:Apply $filter to a property inside a expanded resource
| ||||||||||||||||||||||||||||||||||||
$orderBy | string Return sorted items based on property values. It can contains a comma-separated list of expressions. The expression may include the suffix "asc" for ascending or "desc" for descending, separated from the property name by one or more spaces. If "asc" or "desc" is not specified, the service MUST order by the specified property in ascending order. The sort order is the inherent order for the type of the property. Examples:Return all orders sorted by closedAt in descending order and a secondary sort order of updatedAt in ascending order.
| ||||||||||||||||||||||||||||||||||||
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
]
}
Retrieves a list of orders for a user by queries.
This operation requires user is
- a system admin
- or the userId in the token matches the userId in the path
userId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for a user. |
$skip | integer Example: $skip=100 The maximum number of the items to skip (The Default value is 0). | ||||||||||||||||||||||||||||||||||||
$nextToken | string Example: $nextToken=token A unique token to get next batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$previousToken | string Example: $previousToken=token A unique token to get previous batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$filter | string Return only items which matches to a condition (The operators below are listed in order of precedence from highest to lowest).
Examples:Apply $filter to a property inside a expanded resource
| ||||||||||||||||||||||||||||||||||||
$orderBy | string Return sorted items based on property values. It can contains a comma-separated list of expressions. The expression may include the suffix "asc" for ascending or "desc" for descending, separated from the property name by one or more spaces. If "asc" or "desc" is not specified, the service MUST order by the specified property in ascending order. The sort order is the inherent order for the type of the property. Examples:Return all orders sorted by closedAt in descending order and a secondary sort order of updatedAt in ascending order.
| ||||||||||||||||||||||||||||||||||||
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
]
}
Retrieves a list of orders for an organization by queries.
This operation requires user is
- a system admin
- or have owner/admin role in the organization
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
$skip | integer Example: $skip=100 The maximum number of the items to skip (The Default value is 0). | ||||||||||||||||||||||||||||||||||||
$nextToken | string Example: $nextToken=token A unique token to get next batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$previousToken | string Example: $previousToken=token A unique token to get previous batch of data. (base64 format) | ||||||||||||||||||||||||||||||||||||
$filter | string Return only items which matches to a condition (The operators below are listed in order of precedence from highest to lowest).
Examples:Apply $filter to a property inside a expanded resource
| ||||||||||||||||||||||||||||||||||||
$orderBy | string Return sorted items based on property values. It can contains a comma-separated list of expressions. The expression may include the suffix "asc" for ascending or "desc" for descending, separated from the property name by one or more spaces. If "asc" or "desc" is not specified, the service MUST order by the specified property in ascending order. The sort order is the inherent order for the type of the property. Examples:Return all orders sorted by closedAt in descending order and a secondary sort order of updatedAt in ascending order.
| ||||||||||||||||||||||||||||||||||||
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
]
}
Create a new order for an organization.
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
Post an order request body.
cartId | string or null (nullableObjectId.field) ^[0-9a-z]{24}$ A 24 character hexadecimal string value. |
checkoutId | string or null (nullableObjectId.field) ^[0-9a-z]{24}$ A 24 character hexadecimal string value. |
required | Array of objects |
required | object |
status | string (orderStatus.field) Enum: "PENDING" "ACCEPTED" "PROCESSING" "CLOSED" "CANCELED" The status of the order. If omitted, status is set to
|
customFields | object (customFields.field) Custom fields added to the |
{- "items": [
- {
- "variantId": "0123456789ab0123456789ab",
- "productId": "0123456789ab0123456789ab",
- "quantity": 1
}
], - "customer": {
- "name": "Basal Taro",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "Tokyo",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}
}
{- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
Retrieve a single order by id.
This operation requires user is
- a system admin
- or have owner/admin role in the organization
- or user created this order
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
orderId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an order. |
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
{- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
Update a single order by id partially. This operation allows for updating certain fields on the customer, or for updating the status of the order (including updates to CANCELLED or CLOSED).
See the request body below for information about which fields can be updated.
This operation requires user is
- a system admin
- or have owner/admin role in the organization
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
orderId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an order. |
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
Update an order request body.
canceledAt | string or null <date-time> (orderCanceledAt.field) The date and time (ISO 8601 format) when the order was canceled. Returns null if the order isn't canceled. |
cancelReason | string or null (orderCancelReason.field) Enum: null "CUSTOMER" "INVENTORY" "DECLINED" "OTHER" The reason why the order was canceled:
|
closedAt | string or null <date-time> (orderCanceledAt.field) The date and time (ISO 8601 format) when the order was canceled. Returns null if the order isn't canceled. |
customFields | object (customFields.field) Custom fields added to the |
object | |
status | string (orderStatus.field) Enum: "PENDING" "ACCEPTED" "PROCESSING" "CLOSED" "CANCELED" The status of the order:
|
{- "customer": {
- "phone": "03-1111-1111"
}
}
{- "id": "0123456789ab0123456789ab",
- "organization": "0123456789ab0123456789ab",
- "cart": { },
- "checkout": { },
- "lineItems": [
- {
- "product": "0123456789ab0123456789ab",
- "productName": "Product A",
- "variant": "0123456789ab0123456789ab",
- "variantTitle": "This is a title of Product variant A.",
- "sku": "SKU123ABC",
- "price": {
- "amount": 1000000,
- "taxable": true
}, - "quantity": 1
}
], - "currency": "JPY",
- "subtotalPrice": 1000000,
- "totalTax": 1000000,
- "totalPrice": 1000000,
- "customer": {
- "user": { },
- "name": "Adam Basal",
- "nameKana": "ベーザル タロウ",
- "addressLine1": "東京都",
- "addressLine2": "渋谷区代々木区1-1-1",
- "addressLine3": "ABCビル 1F",
- "phone": "03-0000-0000",
- "email": "abc@example.com",
- "age": 40,
- "preferredContactMethod": "phone",
- "preferredTimeToContact": "During 10am - 12pm, Monday"
}, - "status": "PENDING",
- "cancelReason": null,
- "closedAt": "2022-01-01T00:00:000Z",
- "canceledAt": "2022-01-01T00:00:000Z",
- "customFields": {
- "pointsAwarded": 100
}, - "createdAt": "2022-01-01T00:00:000Z",
- "updatedAt": "2022-01-01T00:00:000Z"
}
Delete a single order by id.
This operation requires user is
- a system admin
- or have owner/admin role in the organization
Only orders in a pending status can be deleted.
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
orderId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an order. |
{- "code": "string",
- "message": "string",
- "target": "string",
- "details": [
- { }
], - "innererror": {
- "code": "string",
- "innererror": { }
}
}
Retrieves statistics for order counts aggregated for products on an organization. Returns the total count of orders for each product.
This operation requires user is
- a system admin
- or have owner/admin role in the organization
orgId required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier for an organization. |
productIds required | string^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab Comma delimited unique ids of products to filter by. |
{- "organization": "0123456789ab0123456789ab",
- "productId": "0123456789ab0123456789ab",
- "count": 10
}