Prerequisites

It is most important to understand that in order to create an order in Caliq that the customer must always exist in Caliq first. The ability for the api to create new customers and also to add addresses to existing accounts is sometimes prohibited. Typically, for a B2B site customer data must be created in Caliq and approved before being allowed to order on the web whereas for a B2C site anyone is allowed to setup a web login and order.


If an existing customer tries to place an order to be delivered to a new address this needs to be added to the account first using the [AddressCreate] api



Direct Delivery

The only exception to the above is for direct delivery addresses. This would be used when a customer places an order but wants it delivered to a 'one off' address. Setting <DirectDelivery> to true when creating the order will create the order in Caliq and set it to be delivered to that address without it existing or being added to the customer's account.



Key Parameter Values

The parameters required when sending an order to Caliq are listed in the technical documentation page but we list below a number of key ones which merit further explanation


Web Order Ref

This is how the website internally references the order. It will be stored on the order in Caliq and will be returned on all api queries which reference orders, allowing the website to cross reference back. Caliq will not allow more than one order to be created with the same order reference.



Channel

The channel tells Caliq where the order comes from. Typically this might be phone, trade show, sales rep and of course website. Sending the channel is mandatory. The full list can be retrieved via the [Channel] api call.



Currency

The currency of the order. This must match the currency of the customer. Each customer account is associated with a specific currency and they are only allowed to create orders in that currency. Orders for a customer where the currency does not match will be rejected. 



Addresses

As previously mentioned both the delivery address and billing address must be populated and must exist on the customer account. If you know the internal ID of the address this can be sent and all the other address fields will be ignored. If the IS is not sent Caliq will attempt to match the address fields supplied to an address on the customer.


Every address in Caliq is tagged as 'Allow Delivery' and 'Allow Billing' and these values are exposed in the Cusromer api data. When creating an order the delivery address supplied must be one set to AllowDelivery = true and the billing address supplied must be set to AllowBilling = true, otherwise the order will be rejected.



Order Lines

Some extra explanation is required here for the line price.


On a basic level Caliq requires the <Quantity> and the <UnitPrice>


Caliq will always create the order line with the total being quantity x price


If a discount is given for the item there are 2 ways to transmit this to Caliq.


  1. Reduce the <UnitPrice> If the item was originally £10 and a 10% discount is given then just send the <UnitPrice> in as £9
  2. Send <LineDiscountAmount> The <UnitPrice> would remain at £10 and <LineDiscountAmount> would be £1  Caliq will deal with the required adjustments and any rounding problems this may throw up.



Order Discount

If an overall order discount is given, rather than reduce the individual line values, it is possible to send this through as a total. Within Caliq there are options to add the discount to the order an a negative line or to pro-rate the discount over the other order lines. This has the benefit of generating a more accurate margin for each line.