Invoices, orders, baskets and quotes are all represented by this object, and differentiated by status.
https://api.cms-tool.net/webapps/api/basket
Used to filter a list of orders/baskets returned, except id which returns a singular.
| Name | Description | Example | Data 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 |
The following parameters should be used for advanced processing of the data, and is usually focused on a "single order" GET or POST
| Name | Description | Example | Data 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.
| Key | Definition | Type | Format |
| b_id |
id
Unique Invoice Serial Number, aka ID (Validation: Integer)
|
Integer (Unique ID)
|
Max Len: 11
|
| 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
|
| 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
|
| b_address_quality |
address quality
API results from address validation checker service, if enabled (Validation: Text)
|
text
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| b_cancelled |
cancelled
Time of cancellation if cancelled. Primary indicator of cancellation (Validation: Timestamp)
|
timestamp
|
|
| b_closed |
closed
The order date, when the draft order was submitted to be come a proper order. (Validation: Timestamp)
|
timestamp
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| b_readytoship |
readytoship
Timestamp indicating an order has been picked/packed, and is ready to ship or collect by customer. (Validation: Timestamp)
|
timestamp
|
|
| b_reminderdue |
reminderdue
If customer wishes to be reminded on an aniversary, then this is when they will be reminded next. (Validation: Timestamp)
|
date
|
|
| 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
|
|
| b_repeat_interval |
repeat interval
For repeating orders (aka subscriptions) this is the repeat interval (Validation: Interval)
|
interval
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
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
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"
}
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
...
}
],
}