Methods
- order.create
- order.bulk_create
- order.edit
- order.search
- order.info
- order.hold
- order.unhold
- order.cancel
- order.comment
Entity Properties
- Order Properties
- Order Item Properties
- Address Properties
- Package Properties
- Tracking Number Properties
- Status History
- Serial Number Properties
- Packing instruction Confirmation Properties
- Order Custom Field
Order States and Statuses
Order received and inventory reserved.
Valid statuses:
new
, partial_backorder
, backordered
Shipments created and assigned to a picking batch.
Valid statuses:
processing
, partial_backorder
Entire order has been packaged and labeled for shipping.
Valid statuses:
complete
Order has been canceled.
Valid statuses:
canceled
Order is on hold.
Valid statuses:
holded
, delayed_shipment
, unresolved
order.create
order.create (string|null $storeCode, object|array $items, object $address, object $info, object $flags = [])
Create a new order. This operation will only be successful if the inventory is available and the unique_id is unique (if specified).
Parameters
Store code. If not specified will default to the configured default store. Merchants with multiple stores may specify which store the order belongs to.
Order Items. Three possible formats:
Shipping Address (see Shipping Address Properties)
Order Additional Data (see Order Additional Data)
Order Flags (see Order Flags)
Order Items Data
Use to specify the SKU of the item being ordered.
Use to specify the Barcode of the item being ordered as an alternative to using a SKU. The fields
sku
, barcode
, and vendor_sku
will be evaluated in that order, and the first matching product found will be selected.Use to specify the Vendor SKU of the item being ordered as an alternative to using a SKU or Barcode. The fields
sku
, barcode
, and vendor_sku
will be evaluated in that order, and the first matching product found will be selected. As Vendor SKUs are not unique, if the value matches multiple products then an error will be thrown.Use to specify the quantity being ordered of a particular item.
If required by your integration you may specify a reference to an external order item id.
Specify a declared unit value. Specifying the unit declared value is preferred over specifying only the entire order declared value so that an accurate amount can be computed for partial fulfillments. If a value is specified for an order item, then
"declared_value_service": true
will need to be sent in with the $info object section.Specify the declared unit value currency. Must be a valid ISO 4217 alphabetic code.
Specify a customs unit value. Specifying the unit customs value is preferred over specifying only the entire order customs value so that an accurate amount can be computed for partial fulfillments.
Specify the customs unit value currency. Must be a valid ISO 4217 alphabetic code.
The number of eaches per inner container. Must be a positive whole number. If no BOM is found, individual units will be added.
The number of inner containers, or number of eaches if there are no inner containers, per outer container. Must be a positive whole number. If no BOM is found, individual units will be added.
Order Additional Data
This field is optional and if not specified an auto-incrementing number will be assigned. Uniqueness based on this field is enforced so an error will be given if an order with the same unique_id already exists. This ‘unique_id’ is the id used for other API calls such as “order.info”.
This field is optional and if not specified will be left blank. Uniqueness based on this field is not enforced (two orders may have the same order_ref value). If specified, this number will appear on packing slips in place of the unique_id.
See the Shipping Methods document for a reference. Is not optional.
If specified will override the configured Packing Slip default greeting. Allowing the addition of a Packing Slip Custom Greeting.
The “Note” adds a status history to the order that only you and the warehouse staff may see. Adding a note will not affect the way the order is picked and packed and is not required.
Values can be
none
, any
, adult
, indirect
, or default
.
*Supported by FedEx.none
— No signature requirement.any
— The package(s) will be shipped with the “Direct” signature required (recipient of any age).adult
— The package(s) will be shipped with the Adult Signature Required option (21 years or older).indirect
— The package(s) will be shipped with theindirect
signature required (Ifindirect
is not supported by the carrier, this option will fall back toany
).default
— May be used to defer to the default based on the carrier service type (Ifdefault
is not supported by the carrier, this option will fall back tonone
). If the signature requirement is not specified it will fall back todefault
for HazMat orders ornone
for all others.
Saturday delivery option. If not specified will default to ‘false’.
Reason for export. Values can be
sold
, not_sold
, gift
, sample
, repair_return
, personal_effects
. If not specified will default to sold
. Only applicable to international orders.If ‘true’ then the order or the package(s) will be shipped with declared_value_service requested. Only the unit_declared_value must be specified for at least one SKU or declared_value for the order, but not both. If not specified will default to ‘false’.
Needs to be set if
"declared_value_service": true
and "unit_declared_value"
is not set on any individual product SKU being ordered. e.g. "declared_value": "40.50"
The currency of
declared_value
. Must be a valid ISO 4217 alphabetic code.Only the unit_customs_value must be specified for at least one SKU or customs_value for the order, but not both. e.g.
"customs_value": "30.25"
The currency of
customs_value
. Must be a valid ISO 4217 alphabetic code.Request overbox option. If not specified will default to ‘false’.
If specified, sets this order’s backorder policy. Order will use specified policy instead of store’s default policy. Values can be
default
, all_or_nothing
, as_available
, or up_to_X
. If not specified will default to "default"
.all_or_nothing
- Accept order but do not ship anything until all items are in stock.as_available
- No limit to number or frequency of additional shipments.up_to_X
shipments - Same as “As Available”, but changes to All or Nothing before shipping Xth shipment. When usingup_to_X
, “X” represent a positive integer number. Example:{ "backorder_policy": "up_to_3" }
If specified, sets this order’s priority. Setting the priority will boost or suppress this order’s priority in relation to other orders for the same products. Valid input are values in the range
0 -100
. Lower numbers are higher in priority. If not specified will default to 50
.If specified, the requested ship date will determine if the merchant wishes for the item to be shipped on the same day or not. Whether or not this date becomes the Target Ship Date depends on the merchant’s target ship date cutoff time and the time the order is placed. Format:
YYYY-MM-DD
Required for the Cheapest On-Time shipping method. Format:
YYYY-MM-DD
If specified, the order will be placed in “hold” status until this date and time. May be specified as a date or a date and time. The timezone is assumed to be the global default timezone if not specified. If a time is not specified it is assumed to be 00:00:00 (12:00 am). Format:
YYYY-MM-DD
or YYYY-MM-DDThh:mm:ss
or YYYY-MM-DDThh:mm:ssZ
If specified, the order will be placed in “hold” status indefinitely (cannot be used with
delayed_ship_date
).The ID number of a Third Party Billing Account Group. If unset or
null
, and a default group is configured, the default group will be used. Set to 0
to disable third party billing.Duties Payor. Values can be
default
, shipper
, recipient
, third_party
. If not specified will default to default
. Only applicable to international orders.The ID number of a Duties Payor Third Party Billing Account Group. Only applicable to
third_party
duties payor.Array of packing instructions. See Packing Instruction.
Generate Serial Shipping Container Codes option. Array with elements ‘pack’ and/or ‘item’. If not specified will default to an empty array.
Object with Custom Fields. See Order Custom Field.
Order Flags
Values can be
true
, false
, a PHP strtotime string indicating the oldest date to consider. e.g. -3 days
.true
— Must be unique across all orders.false
— Uniqueness is not required. (default - current behavior).-3 days
— Must be unique across all orders created for the last three days. If not specified it will fall back tofalse
.
Return Value
An object with the new order’s Order Properties.Example Request
Create new order:Request
Example Response
Response
Error Codes
code | message |
---|---|
102 | Invalid data given. Details in error message. |
104 | An order with the specified ID already exists. |
106 | Invalid script given. Details in error message. |
107 | Product does not exist. |
order.bulk_create
order.bulk_create (object $orders)
Create multiple new orders in a single request. This method is significantly faster than submitting orders one at a time. If an error occurs while processing an order, processing will continue with the next order.
Parameters
An object with keys providing a reference for each order, which will be used in the response, and values which are an array of arguments as accepted by the order.create endpoint.
Return Value
An object with the new order’s Order Properties.Example Request
Create new orders:Request
Example Response
Response
Error Codes
The error codes returned for specific orders are the same as those return by the order.create endpoint.code | message |
---|---|
102 | Invalid data given. Details in error message. |
order.edit
order.edit (string $orderUniqueId, object $address, object $info, object $customFields)
Modify the Shipping Address and/or the Order Additional Data for the existing order.
Parameters
Order unique ID.
Shipping Address (see Address Properties)
Order Additional Data (see Order Additional Data)
Order Custom Field Operations (see Order Custom Field Operations)
Order Custom Field Operations
An object with an operation name as the key and an object containing the Order Custom Field data for all operations except theremove
operation. The remove
operation only requires a list of custom field codes.
Allowed operations: set
, add
, remove
, add_option
, remove_option
.
set
- Replace all values.add
- Add new fields to existing, replace old values.remove
- Remove only fields specified.add_option
- Multi-selects only. Add an option without unsetting existing options.remove_option
- Multi-selects only. Remove an option without unsetting other options not listed.
Return Value
An object with the updated order’s Order Properties.Example Request
Request
Example Response
Response
Error Codes
code | message |
---|---|
102 | Invalid data given. Details in error message. |
105 | The order cannot be edited. |
order.search
order.search (null|object $filters, array $options = [], null|string|object $fields = [])
Retrieve list of orders by filters. Order data can be customized by specifying properties to retrieve.
Parameters
Filters to apply for the search.
null
- Retrieve list of all orders.object
- Retrieve list of orders using specified Search Filters.
Options to apply for the search.
null
- No options will be applied.object
- Apply specified Search Options.
Specify which fields should be included in the response.See Order Properties.
null
- Retrieve only “order_id”, “unique_id”, and “order_ref” properties.string
- The string'*'
denotes all properties excluding “shipping_address”, “items”, “shipments”, “tracking_numbers”, “packages”, “status_history”, and “serial_number_data”.object
- List of properties to retrieve in addition to “order_id”, “unique_id”, and “order_ref”. List may include ’*’. Example:
Return Value
An object containing:results
- The matching records as an array of objects. Each object will contain the specified (or default if no fields parameter was given) Order Properties.totalCount
- The total number of records that match the query - this may be more than the number of records returned.numPages
- The number of pages of records with the given page size.
Example Request
Get order status and order items for two order ids:Request
Example Response
Response
Error Codes
code | message |
---|---|
101 | Invalid filters given. Details in error message. |
order.info
order.info(string $orderUniqueId, null|string|object $fields = [])
Retrieve full order information.
Parameters
Order unique ID.
Specify which fields should be included in the response.See Order Properties.
null
- Retrieve only “order_id”, “unique_id”, and “order_ref” properties.string
- The string'*'
denotes all properties excluding “shipping_address”, “items”, “shipments”, “tracking_numbers”, and “status_history”.object
- List of properties to retrieve in addition to “order_id”, “unique_id”, and “order_ref”. List may include ’*’. Example:
Return Value
Object which contains the specified (or default if no fields parameter was given) Order Properties.Example Request
Get order information for the specified order:Request
Example Response
Response
Error Codes
code | message |
---|---|
100 | Requested order does not exist. |
order.hold
order.hold(string $orderUniqueId)
Hold an existing order. This operation will only be successful if the order exists and can be holded.
Parameters
Order unique ID.
Return Value
true
if the order was holded.
Example Request
Request
Example Response
Response
Error Codes
code | message |
---|---|
100 | Requested order does not exist. |
103 | Order status not changed. Details in error message. |
order.unhold
order.unhold(string $orderUniqueId)
Unhold an existing order. This operation will only be successful if the order exists and can be unholded.
Parameters
Order unique ID.
Return Value
true
if the order was unholded.
Example Request
Request
Example Response
Response
Error Codes
code | message |
---|---|
100 | Requested order does not exist. |
103 | Order status not changed. Details in error message. |
order.cancel
order.cancel (string $uniqueOrderId, array $options, null|string|object $fields = [])
Cancel an existing order. This operation will only be successful if the order exists, and at least one of the cancellation options is permitted for the order’s current status and the store configuration.
Parameters
Order unique ID
A list of the following properties, at least one of which must be set to
true
.backordered_items
- If the order has back ordered items, attempt to cancel them. If all items on the order are back ordered, then the entire order will be canceled.unfulfilled_items
- If the order has unfulfilled items, attempt to cancel them. If all items on the order are unfulfilled, then the entire order will be canceled. An unfulfilled item is an item that has not yet been added to a shipment for picking, including backordered items.all_items
- Attempt to cancel the entire order. If the order state isprocessing
orcomplete
then you will only be able to cancel the order if the store configuration allows it. If any items on the order have been fulfilled, then you must also setcancellation_request
totrue
.cancellation_request
- If theall_items
option is not available, you can use this option send a cancellation request instead. Example:
Specify which fields should be included in the order object returned in the response.See Order Properties.
null
- Retrieve only “order_id”, “unique_id”, and “order_ref” properties.string
- The string'*'
denotes all properties excluding “shipping_address”, “items”, “tracking_numbers” and “status_history”.object
- List of properties to retrieve in addition to “order_id”, “unique_id”, and “order_ref”. List may include ’*’. Example:
Return Value
An object containing the following properties:success
- If at least one of the cancellation options was successful, the value will betrue
warnings
- An array of warning messagesorder
- Contains the specified (or default if no fields parameter was given) Order Properties.
Example Request
Attempt to cancel all items on an order:Request
Example Response
Response
Error Codes
code | message |
---|---|
100 | Requested order does not exist. |
102 | Invalid data given. Details in error message. |
103 | Order status not changed. Details in error message. |
order.comment
order.comment(string $orderUniqueId, string $comment)
Add a comment to an order’s history.
This method was added in version 2021.6.
Parameters
Order unique ID.
Comment.
Return Value
true
if the comment was added.
Example Request
Request
Example Response
Response
Error Codes
code | message |
---|---|
100 | Requested order does not exist. |
102 | Invalid data given. Details in error message. |
103 | Order comment not added. Details in error message. |
Entity Properties
Order Properties
Packing Instructions
Packing Instructions are presented to the packer in a dialog that must be confirmed. If a file is attached, the file will be printed using the specified printer type the appropriate number of times depending on the “presentation”. The file must be in PDF format, and for best results it is recommended for the paper size to match the printer target type. If the print target is aLABEL
printer and the page size is not 4 inches in either dimension, the system will attempt to extract an image from the file or otherwise crop the page which may not always have good results.
The “Note” property. This is required.
The name to be given to the file attached using the “file_content” or “file_request” properties.
The base64-encoded contents of the file. If specified you must also provide a “file_name”.
Attach a file using a url instead of
file_content
. The file will be downloaded using the optional auth
and headers
if specified. The file_name
will be used if specified, but is optional and will otherwise be set using the Content-Disposition
header value or the last part of the url.The “Presentation” property. Values can be
once_per_order
, once_per_shipment
, or once_per_package
.The “Print Target” property. Values can be
LABEL
, SMALL_LABEL
, or LASER
.The “copies_printed” property.
The instruction confirmations. See Packing instruction Confirmation Properties.
Single Instruction Example:
Multiple Instructions example:
Full order.create
Example:
Order Item Properties
Address Properties
Package Properties
Tracking Number Properties
This entity is deprecated, please use Package instead.Status History
Serial Number Properties
Packing instruction Confirmation Properties
Order Custom Field
An object with a Custom Field code as the key and the Custom Field data as the value. The value format depends on the Custom Field input type."custom_fields": { ... }
To find out what fields are available see Order Custom Fields — order_custom_field.list