MenuClose

Sales Order - API Reference

Select API:

Sales Order

Invoices, orders, baskets and quotes are all represented by this object, and differentiated by status.

End Point URL

https://api.cms-tool.net/webapps/api/basket

API Parameters and Filters

Filter Parameters

Used to filter a list of orders/baskets returned, except id which returns a singular.

NameDescriptionExampleData type
b_cust_name 

Filter results based on customer name

b_cust_name=John

string
mbr_id 

Filter results based on member id

mbr_id=123 int
id 

Get a single order/basket (singular data object)

b_id=123

int
invoice_id

Filter results based on the final invoice id reference... usually the same as b_id, but can have prefixes and a different number sequence.   aka b_invoice_id

invoice_id=INV003

text
readyToShip 

Filter results based on orders that are paid and ready to be shipped

readyToShip=1

int
isPaid

Filter results based on orders that are paid isPaid=1, or unpaid isPaid=0

isPaid=1

bool
isShipped Filter results based on orders that are shipped isShipped=1, or unshipped  if isShipped=0 isShipped=1 bool
isCancelled Filter results based on orders that are cancelled, by default cancelled orders are excluded isCancelled=1 bool
orderedAfter

Get orders placed after timestamp

orderedAfter=2020-02-28 12:00:00

string
orderedBefore

Get orders placed before timestamp

orderedBefore=2020-03-01 18:00:00

string
paidAfter Get orders paid after timestamp paidAfter=2020-02-28 12:00:00 string
paidBefore Get orders paid before timestamp paidBefore=2020-03-01 18:00:00
orderBy

Sort results based on date created, order date, payment date, shippped date

orderby=created

orderby=order_date

orderby=paid_date

orderby=shipped_date

string
orderDirection Sort results in ascending or descending order

orderDirection=reverse 

string
includeBasketItems Include basket items in the response for GET list... included by default for single object fetches, excluded by default on multiple object searches.

includeBasketItems=1

int/string

Action Parameters

The following parameters should be used for advanced processing of the data, and is usually focused on a "single order" GET or POST

NameDescriptionExampleData type
doAction=CalculateTotals ACTION: Calculate and update the total of the basket, 
Do not include this parameter if do not wish to calculate totals.
doAction=CalculateTotals string
doAction=UpdateShippingStatus ACTION : Updates shipping status to shipped, updates shipping dates... 
You should set the other fields using json data, eg b_courier_ref, b_courier_url, b_courier_notes

doAction=UpdateShippingStatus

string
doNotSendNotification Optionally provide doNotSendNotification=1 if you want to prevent the default sending of the branded shipping notification to the customer

doNotSendNotification=1

int
ReduceStock

ACTION: Calculate and update the stock of the product when new order is created.

NOTE: The default logic assumes basket data is being added/updated, but not closed.

The above action should only be triggered ONCE per order.

doAction=ReduceStock

string
doAction=ProcessOnPaidActions ACTION: Trigger On Paid Actions.  doAction=ProcessOnPaidActions string
doAction=ProcessPoints ACTION: Trigger Member Points processing. doAction=ProcessPoints string
doAction=SendInvoice ACTION: Send Invoices to Customer email. doAction=SendInvoice string
doAction=SendOrder ACTION: Send Order to Customer email. doAction=SendOrder string
doAction=SendMerchantOrder ACTION: Send Merchant Order Copy to Customer email. doAction=SendMerchantOrder string
doAction=SendMerchantInvoice ACTION: Send Merchant Invoice Copy to Customer email. doAction=SendMerchantInvoice string

Accepted date format is yyy-MM-dd HH:mm:ss. If the time is not provided, then it will default to midnight time.

Data Dictionary

Key Definition Type Format
b_id
id
Unique Invoice Serial Number, aka ID (Validation: Integer)
Integer (Unique ID)
Max Len: 11
e.g. 123456
b_affiliate
affiliate
Affiliate ID for affiliate style commissions (Validation: Integer)
int
Max Len: 11
b_payment_card_id
payment card id
ID of saved credit card that was or will be used to pay for this order
int
Max Len: 11
b_payopid
payopid
Payment method as ID reference, to the settings related to the payment method. (Validation: Integer)
int
Max Len: 11
b_repeated_from_bid
repeated from bid
The last basket ID in the repeating order chain. (Validation: Integer)
int
Max Len: 11
b_staff_id
staff id
Sales person ID for POS users (Validation: Integer)
int
Max Len: 11
b_version
version
If an order is re opened after being closed, then the version number will increment and affect the invoice ID (Validation: Integer)
int
Max Len: 11
b_wishlistid
wishlistid
Related wishlist ID if this order originated from a wedding list type picklist. (Validation: Integer)
int
Max Len: 11
cid
cid
Website ID. The Site ID is automatically assigned by CSV uploads and API connections.  (Validation: Integer)
int
Max Len: 11
e.g. 123456
mbr_id
mbr id
Member ID / Customer ID (Validation: Integer)
int
Max Len: 11
page
page
All baskets are associated with the website page ID for the first product ordered. Some config settings exist to prevent split page orders. The Page ID is automatically assigned by CSV uploads and API connections.  (Validation: Integer)
int
Max Len: 11
e.g. 123456
b_address_quality
address quality
API results from address validation checker service, if enabled (Validation: Text)
text
basketItems
Item Lines
Nested array of basket items (order lines)
json
b_bill_email
bill email
Email address of accounts department (optional extra full address format) (Validation: Text)
text
b_booking_duration
booking duration
The total duration of the order, from a pricing perspective. (Validation: Interval)
interval
e.g. 01:00:00
b_booking_finish
booking finish
The end booking time, may be selectable for rental items, but otherwise is the booking start plus the duration (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_booking_resourceid
booking resourceid
The staff member or room assigned to the booking (resource used by all products in the order) (Validation: Integer)
int
Max Len: 11
b_booking_start
booking start
The booking time (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_cancelled
cancelled
Time of cancellation if cancelled. Primary indicator of cancellation (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_closed
closed
The order date, when the draft order was submitted to be come a proper order.  (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_confirmtermsandconditions
terms and conditions confirmed
If T&C confirmed, this will be: T otherwise null
char
b_courier_notes
courier notes
Notes given back to the customer about shipping status (Validation: Text)
text
b_courier_ref
courier ref
Courier tracking ticket number, for human viewing / readback, or for a human to copy and paste into a form (Validation: Text)
text
b_courier_url
courier url
A URL to a courier tracking site, that may or may not include a courier reference.. Presented to user as a clickable link (Validation: Text)
text
b_created
created
Draft order creation date (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_currency
currency
Currency of order (Validation: Text)
text
b_cust_address
cust address
Customer primary address (aka billing address) (Validation: Text)
text
b_cust_city
cust city
Customer primary address (aka billing address) (Validation: Text)
text
b_cust_company
cust company
Customer Company name (Validation: Text)
text
b_cust_country
cust country
Customer primary address (aka billing address) (Validation: Text)
text
b_cust_email
cust email
Customer Email (Validation: Text)
text
b_cust_name
cust name
Customer Personal Name (Billing Name) (Validation: Text)
text
b_cust_notes
cust notes
Notes given by customer as part of their order (Validation: Text)
text
b_customer_savedon
customer savedon
When customer saved this order / wishlist. (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_custom_fields
custom fields
JSON data structure of any additional custom questions asked during checkout. (Validation: Text)
text
b_cust_phone
cust phone
Customer Phone (not validated format) (Validation: Text)
text
b_cust_postcode
cust postcode
Customer primary address (aka billing address) (Validation: Text)
text
b_cust_state
cust state
Customer primary address (aka billing address) (Validation: Text)
text
b_cust_suburb
cust suburb
Customer primary address (aka billing address) (Validation: Text)
text
b_emailjobid
email job id
If this order originated from a bulk email, then this was the bulk email ID
int
b_fx_rate
fx rate
The decimal multiplier from merchant base currency to currency selected. (Validation: Decimal)
decimal
Precision: 10.4
b_gift_message
gift message
A message to be provided where applicable for gift stores. (Validation: Text)
text
b_invoice_id
invoice id
Invoice Number (Validation: Text)
text
b_ipaddress
ipaddress
IP Address of the user who placed the order
text
b_is_domestic
is domestic
Tax status, Domestic or International (Validation: Integer)
int
Max Len: 11
b_item_count
item count
Number of line items (Validation: Integer)
int
Max Len: 11
b_json_data
json data
Nested data in JSON format for other purposes
text
b_notes_confidential
notes confidential
Notes entered by merchant, that for for merchant / staff visibility only (Validation: Text)
text
b_paidon
paidon
Time once order payment was completed in full. Null if partially paid. Primary indicator of fully paid orders (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_paycustcode
paycustcode
Customers may provide their account number when checking out, rather than payment. (Not validated) (Validation: Text)
text
b_payment_method
payment method
Payment method in human readable form, but is actually the payment type code. (Validation: Text)
text
Max Len: 50
b_paymentsummary
paymentsummary
Human readible payment summary (Validation: Text)
text
b_paypurchaseorder
paypurchaseorder
Customers may provide their own purchase order number when checking out, for future reconcilation when the goods are received and documentation accounted for. (Validation: Text)
text
b_points_earned
points earned
Loyalty points earned from this order (if submitted) (Validation: Decimal)
decimal
Precision: 10.2
b_points_earned_affiliate
points earned affiliate
Loyalty points earned by an affiliate who referred the sale. (Validation: Decimal)
decimal
Precision: 10.2
b_points_redeemed
points redeemed
Loyalty points redeemed for this order (if submitted) (Validation: Decimal)
decimal
Precision: 10.2
b_preadj_tax
preadj tax
The value of b_total_tax, prior to post sale adjustments (Validation: Decimal)
decimal
Precision: 10.3
b_preadj_total
preadj total
The value of b_total_total, prior to post sale adjustments, and excluding any payment surcharges
text
Precision: 10.3
b_pref_delivery_time
pref delivery time
Customers preferred delivery time, that can be free text in some situations (Validation: Text)
text
b_pref_delivery_timestamp
pref delivery timestamp
Customers target delivery time in a timestamp format, that is better suited to sorting and filtering. (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_promocode
promocode
Promotional Code = Discount Code (Validation: Text)
text
b_quotedon
quotedon
Timestamp when this order was quoted. If null, then there was never a quote.
timestamp
e.g. 2025-12-31 23:59:59
b_readytoship
readytoship
Timestamp indicating an order has been picked/packed, and is ready to ship or collect by customer. (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_reminderdue
reminderdue
If customer wishes to be reminded on an aniversary, then this is when they will be reminded next. (Validation: Timestamp)
date
e.g. 2025-12-31
b_remindernotes
remindernotes
If customer wishes to be reminded on an aniversary, then notes to themselves, perhaps persons name, or product serial number. (Validation: Text)
text
b_reminderperiod
reminderperiod
If customer wishes to be reminded on an aniversary, then this is when they will be reminded (interval from the last order) (Validation: Interval)
interval
e.g. 01:00:00
b_repeat_interval
repeat interval
For repeating orders (aka subscriptions) this is the repeat interval (Validation: Interval)
interval
e.g. 01:00:00
b_repeat_target
repeat target
The target date for the draft order to be closed, and start the next draft order. Allows users to skip a repeatition.  (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_ship_address
ship address
Delivery address (aka gift address) (Validation: Text)
text
b_ship_city
ship city
Delivery address (aka gift address), used for API shipping calc (Validation: Text)
text
b_ship_company
ship company
Company Name of delivery address optional (Validation: Text)
text
b_ship_country
ship country
Delivery address (aka gift address) (Validation: Text)
text
b_ship_email
ship email
Email of intended recipient (Courier tracking sent here) (Validation: Text)
text
b_ship_name
ship name
Name of intended recipient (Validation: Text)
text
b_shippedon
shippedon
Time when order was marked as shipped. Primary indicator that an order has been collected or shipped or taken, essentially completing the order status. (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_ship_phone
ship phone
Phone of intended recipient (provided to courier) (Validation: Text)
text
b_shippingcalc
shippingcalc
Shipping Method (Validation: Integer)
int
Max Len: 11
b_ship_postcode
ship postcode
Delivery address (aka gift address), used for API shipping calc (Validation: Text)
text
b_ship_state
ship state
Delivery address (aka gift address) (Validation: Text)
text
b_ship_suburb
ship suburb
Delivery address (aka gift address) (Validation: Text)
text
b_shopchannel
shopchannel
Indicates Website or POS, or Market place where order originated (Validation: Text)
text
b_status
status
The status of an order, human readible.  (Validation: Text)
text
b_status_updated
status updated
The timestamp when the order status was last updated (Validation: Timestamp)
timestamp
e.g. 2025-12-31 23:59:59
b_stock_allocated
stock allocated
True if stock counts have been allocated to this order, such that if cancelled stock allocation will be refreshed. (Validation: Boolean)
bool
Max Len: 1
true/false
b_surcharge_fee
surcharge fee
A fee added to an order, usually via some sort of customisation script that calculates a fee using javascript or similar, or simply a POS surcharge on an order. (Validation: Decimal)
decimal
Precision: 10.3
b_surcharge_reason
surcharge reason
Some text related to the surcharge, human readible, visible on invoice.  (Validation: Text)
text
b_total_adjustments
total adjustments
Total of adjustments post sale, eg credits for returned items or fees for shipping overage fees.  (Validation: Decimal)
decimal
Precision: 10.2
b_total_adjustments_tax
total adjustments tax
Sales Tax (GST or VAT) related to adjustments if any (Validation: Decimal)
decimal
Precision: 10.2
b_total_apishipping
total apishipping
Location for storing any shipping fee calculated from a live pricing API. This value may differ from b_total_shipping if surcharges applied. Assumption is a GST exclusive fee. (Validation: Decimal)
decimal
Precision: 10.2
b_total_deposit
total deposit
If customer is prepaying a deposit only, then this is the amount of deposit required, and customer will be expected to pay the remaining value of b_total_total - b_total_paid (Validation: Decimal)
decimal
Precision: 10.2
b_total_discount
total discount
The total discount as calculated by promotions  (excl sales tax) (Validation: Decimal)
decimal
Precision: 10.2
b_total_grams
total grams
Total weight of all items in cart (Validation: Integer)
int
Max Len: 11
b_total_paid
total paid
Total amount of receipts received from the customer (Validation: Decimal)
decimal
Precision: 20.2
b_total_qty
total qty
Total of all line item quantities (Validation: Decimal)
decimal
Precision: 10.3
b_total_refunds
total refunds
Total amount of any refunds given to the customer, in monetary form. (do not put discounts here) (Validation: Decimal)
decimal
Precision: 10.2
b_total_savings
total savings
Marketing savings, based on discounts or promotions on offer, but does not affect the total column, except where identified in b_total_discounts. (Validation: Decimal)
decimal
Precision: 10.2
b_total_shipping
total shipping
The total shipping fee (excl sales tax) (Validation: Decimal)
decimal
Precision: 10.2
b_total_tax
total tax
The total sales tax on the order (eg GST or VAT) (Validation: Decimal)
decimal
Precision: 10.2
b_total_total
total total
The final total after considering all charges, discounts, vouchers, taxes, transaction fees, and post sale adjustments (Validation: Decimal)
decimal
Precision: 10.2
b_total_transfee
total transfee
Optional transaction fee that may be applied to final invoice, for use of certain payment methods. Transaction fees do not increase tax. (Validation: Decimal)
decimal
Precision: 10.2
b_total_volume
total volume
The volume in cubed cm required to efficiently pack this whole order in one box.
text
Precision: 12.5
b_total_vouchers
total vouchers
The total of vouchers applied to this order. (Sales tax neutral) (Validation: Decimal)
decimal
Precision: 10.2
b_type
type
Identifies the type of orders that were saved prior to submitting them, eg wishlists or saved orders.  (Validation: Text)
text
b_uuid
uuid
Global Unique Identifier for the basket / order, soon to replace b_id
text
b_value_redeemed
value redeemed
The monetary value of points redeemed on this order, that would have adjusted the total due of the order. (Validation: Decimal)
decimal
Precision: 10.2
b_wishlist_title
wishlist title
Only used if order is a wishlist (Validation: Text)
text

basketItems - Sales Order Item Line - Data Dictionary

Key Definition Type Format
b_bookingid
Booking ID
ID of a booking if any
int
b_eventattendeeid
Event Attendee ID
ID of a member or customer who will attend an event that is being purchased by this line item
int
bi_adjusted_from_bi_id
Adjusted From Item ID
ID of a reference item, eg if a credit is given for a returned item, then this will identify which line item was originally issued.
int
b_id
Basket ID
Basket ID, foriegn key to basket.b_id
int
bi_partof_bi
Part of Item ID
The ID of another basket item where this product is a part of another recipe combindation product. eg part of a gift basket or assembled item.
int
bi_promoid
Discount ID
ID of the discount rule applied to this line item, if any
int
bi_staff_id
Staff ID
ID of the user who made an adjustment to this order, only used with adjustments
int
b_parentpid
Main Product ID
ID of the main product purchased (not variant). Links to product.id
int
cid
Site ID
ID of the website. System readonly
int
e.g. 123456
pid
Variant Product ID
ID of the product variant. Links to product.id. If the product has no variants, then pid = b_parentpid
int
b_bookingsummary
bookingsummary
A summary of any booking details if any. This could be an appointment booking or an event.
text
b_colour
Option Colour
Product option colour
text
bi_adjust_type
Adjustment Type
For adjustments to an order after the order was first closed, the adjustment type might be one of the following ( Credit,Damaged,Fee,Issued,Returned)
text
bi_custom_fields
Custom Fields and Calculations
Additional product customisations in a JSON array format. Contains all the other design/manufacture customer selections
text
bi_custom_total
Custom Calc Total
Total cost derived from product customisations used towards calculating the unit price
text
Precision: 10.3
bi_detail
Line Detail
A human friendly description of the product being purchased
text
bi_disc_amt
Discount Amount (Auto)
The discount value for the total line
text
Precision: 10.2
bi_disc_amt_pos
POS Discount Override
Overide discount amount for the entire item line. Only staff can set this discount. When this approach used, no other discount rule applied
text
Precision: 10.3
bi_discountmessage
Discount Message
A message displayed to customer as to which promotion was used to discount their item line
text
bi_hold
On Hold
If this product line is on hold and not to be shipped with the current batch
bool
true/false
bi_id
ID
Unique ID of this basket item
text
bi_json
Adjustments etc JSON
Nested JSON structure for additional information for this item line, including stock picking status, loyalty points redemption
json
bi_line_total
Line Total Excluding Tax
Line total equals unit price multiplied by quantity, and does not include any sales tax. After discounts applied
text
Precision: 10.2
bi_message
Message To User
Warning message about stock availability, back order or any errors during processing of this order line
text
bi_priceprediscount
Price RRP
The RRP unit price of the product prior to discounting excluding sales tax
text
Precision: 12.3
bi_shippedon
Item Line Shipped Timestamp
Timestamp of when this line item was shipped, that may not be shipped as a whole order together
timestamp
e.g. 2025-12-31 23:59:59
bi_tax_amt
Line Total Tax
Sales tax total for the whole line
text
Precision: 10.2
b_option
Option or Style
Product option style or generic option
text
b_qty
Quantity
Quantity of items purchased in this order line
text
Precision: 10.3
b_size
Size
Product option size
text
b_unit_price
Unit Price
Unit price of the product excluding tax, after any discounts were deducted, and this value includes any option pricing or customisation pricing.
text
Precision: 10.2

Usage Instructions and Examples

Useful use cases for a courier company

1. Get all orders that are ready to ship (paid status)

Return all orders that are ready to ship. Use GET to retrieve the data.
EndPoint: https://api.cms-tool.net/webapps/api/basket?readyToShip=1

2. Update an existing order status as shipped (Courier approach)

Assuming you are a courier company, just provide only the minimal data to update your order. The data is provided as a "data" field, or as POST content in JSON format.

The UpdateShippingStatus action will update shipping dates and shipping status, and send a notification to the customer with the courier details, unless you also provide the parameter ?doNotSendNotification=1

EndPoint: https://api.cms-tool.net/webapps/api/order?doAction=UpdateShippingStatus

{
  "id": 26845824,
  "b_courier_ref": "999yourtrackcode999",
  "b_courier_url": "https://mycourier.com/mytrackingsystem?trackcode=999yourtrackcode999"
}

3. Update an existing order to shipped status

EndPoint: https://api.cms-tool.net/webapps/api/order

{
  "id": 26845824, 
  "b_shippedon": "2023-12-31 12:35:00",
  "b_status ": "Shipped"
}

Sample Output

Based on our endpoints, we can expect to receive a sample output data as below. A full same output is provided at the bottom of this page.

endpoint: The end point that is being used
resultCount: The total number of results returned
data: The actual data desried
success: true or false depicting the success of the query

{
       "b_cust_name": "my name",
       "b_ship_address": "123 Street",
       "b_ship_email": "name@myname.nz",
       "basketItems": [
           {
               "b_qty": 1.000,
               "pid": 2332685
   ...
           }
       ],
}