POST api/v1/OrderCreate

Create a new sales order in Caliq. Must be created on an already existing customer

Request Information

URI Parameters

None.

Body Parameters

OrderCreateParams
NameDescriptionTypeAdditional information
apiKey

Please contact Caliq support to get your key

string

Required

WebOrderRef

Website Order reference. Not meaningful to Caliq but will be returned on order API queries. Should be unique per order

string

Required

Max length: 50

ChannelID

List of channels can be retrieved via API

integer

Required

PutOnCustomerHold

If set the order will be placed on customer hold

boolean

None.

PutOnInternalHold

If set the order will be placed on internal hold

boolean

None.

DateTaken

Date the order was taken in YYYYMMDD format

string

Required

DateRequired

Date the customer wants the item delivered in YYYYMMDD. If not supplied then will be created with order date

string

None.

CustomerPONumber

Customer's purchase order number

string

Max length: 20

Currency

Currency that the order values are in

string

Required

Max length: 3

VATInclusive

Are the values in this order to be treated as VAT inclusive unless explicitly specified by the name of the value

boolean

Required

CustomerID

Caliq internal unique customer identifier

integer

None.

AccountNo

User entered unique customer account number

string

Required

Max length: 10

InvoiceToAccountNo

User entered unique customer account number to override billing customer. Billing address data should be from this customer. If this is invalid it will be ignored

string

Max length: 10

OrderNotes

User entered notes to be shown on despatch paperwork. Typically 'if not in leave in porch'

string

None.

OfficeNotes

User entered notes to be shown only to office staff

string

None.

CreateAsQuote

If true then order will be created as a quotation and payment data will be ignored, any other value indicates false

boolean

None.

FailedFraudDetection

boolean

None.

FraudDetectionMessage

string

None.

OrderingContact

This data can be used to influence the 'ordering contact and address' for this order in Caliq. None of this is mandatory and if not set the default web contact will be used.

OrderingContact

None.

DeliveryAddress

If not a direct ship the address must must exist in Caliq and be set to AllowDeliver = true

DeliveryAddress

None.

InvoiceAddress

The address must must exist in Caliq and be set to AllowBilling = true

InvoiceAddress

None.

NewOrderLines

NewOrderLines

None.

OrderDiscounts

Any discounts added here will be applied to the supplied line unit prices, pro rate

OrderDiscounts

None.

OrderPayments

OrderPayments

None.

CarriageAndDespatch

CarriageAndDespatch

None.

ExternalMeta1

Reserved for internal use

string

Max length: 25

ExternalMeta2

Reserved for internal use

string

Max length: 25

Request Formats

application/json, text/json

Sample:
{
  "apiKey": "sample string 1",
  "WebOrderRef": "sample string 2",
  "ChannelID": 3,
  "PutOnCustomerHold": true,
  "PutOnInternalHold": true,
  "DateTaken": "sample string 6",
  "DateRequired": "sample string 7",
  "CustomerPONumber": "sample string 8",
  "Currency": "sample string 9",
  "VATInclusive": true,
  "CustomerID": 11,
  "AccountNo": "sample string 12",
  "InvoiceToAccountNo": "sample string 13",
  "OrderNotes": "sample string 14",
  "OfficeNotes": "sample string 15",
  "CreateAsQuote": true,
  "FailedFraudDetection": true,
  "FraudDetectionMessage": "sample string 18",
  "OrderingContact": {
    "OrderingContactID": 1,
    "OrderingEmail": "sample string 2"
  },
  "DeliveryAddress": {
    "AddressID": 1,
    "DirectDelivery": true,
    "MedicalVATExempt": true,
    "CustomerCollecting": true,
    "DeliveryCompany": "sample string 5",
    "Line1": "sample string 6",
    "Line2": "sample string 7",
    "Line3": "sample string 8",
    "Town": "sample string 9",
    "County": "sample string 10",
    "Postcode": "sample string 11",
    "Country": "sample string 12",
    "Firstname": "sample string 13",
    "Surname": "sample string 14",
    "Email": "sample string 15",
    "Phone": "sample string 16",
    "Mobile": "sample string 17"
  },
  "InvoiceAddress": {
    "AddressID": 1,
    "Line1": "sample string 2",
    "Line2": "sample string 3",
    "Line3": "sample string 4",
    "Town": "sample string 5",
    "County": "sample string 6",
    "Postcode": "sample string 7",
    "Country": "sample string 8"
  },
  "NewOrderLines": {
    "NewOrderLine": [
      {
        "ProductID": 1,
        "ProductCode": "sample string 2",
        "Quantity": 3,
        "RequiredDate": "sample string 4",
        "UnitPrice": 5.0,
        "LineDiscountAmount": 6.0,
        "DiscountNotes": "sample string 7",
        "GiftVoucher": "sample string 8",
        "LinkGroupID": 9,
        "MediaCode": "sample string 10",
        "CustRef": "sample string 11",
        "UnitCost": 12.0
      },
      {
        "ProductID": 1,
        "ProductCode": "sample string 2",
        "Quantity": 3,
        "RequiredDate": "sample string 4",
        "UnitPrice": 5.0,
        "LineDiscountAmount": 6.0,
        "DiscountNotes": "sample string 7",
        "GiftVoucher": "sample string 8",
        "LinkGroupID": 9,
        "MediaCode": "sample string 10",
        "CustRef": "sample string 11",
        "UnitCost": 12.0
      }
    ]
  },
  "OrderDiscounts": {
    "OrderDiscount": [
      {
        "DiscountAmount": 1.0,
        "DiscountText": "sample string 2"
      },
      {
        "DiscountAmount": 1.0,
        "DiscountText": "sample string 2"
      }
    ]
  },
  "OrderPayments": {
    "OrderPayment": [
      {
        "TypeID": 1,
        "Amount": 2.0,
        "GiftVoucherNumber": "sample string 3",
        "TransactionID": "sample string 4",
        "AuthNumber": "sample string 5",
        "SecurityKey": "sample string 6",
        "VendorTXCode": "sample string 7"
      },
      {
        "TypeID": 1,
        "Amount": 2.0,
        "GiftVoucherNumber": "sample string 3",
        "TransactionID": "sample string 4",
        "AuthNumber": "sample string 5",
        "SecurityKey": "sample string 6",
        "VendorTXCode": "sample string 7"
      }
    ]
  },
  "CarriageAndDespatch": {
    "ServiceLevelID": 1,
    "DespatchMethodID": 2,
    "Carriage": 3.0,
    "CarriageFOC": true
  },
  "ExternalMeta1": "sample string 19",
  "ExternalMeta2": "sample string 20"
}

application/xml, text/xml

Sample:
<OrderCreateParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <apiKey>sample string 1</apiKey>
  <WebOrderRef>sample string 2</WebOrderRef>
  <ChannelID>3</ChannelID>
  <PutOnCustomerHold>true</PutOnCustomerHold>
  <PutOnInternalHold>true</PutOnInternalHold>
  <DateTaken>sample string 6</DateTaken>
  <DateRequired>sample string 7</DateRequired>
  <CustomerPONumber>sample string 8</CustomerPONumber>
  <Currency>sample string 9</Currency>
  <VATInclusive>true</VATInclusive>
  <CustomerID>11</CustomerID>
  <AccountNo>sample string 12</AccountNo>
  <InvoiceToAccountNo>sample string 13</InvoiceToAccountNo>
  <OrderNotes>sample string 14</OrderNotes>
  <OfficeNotes>sample string 15</OfficeNotes>
  <CreateAsQuote>true</CreateAsQuote>
  <FailedFraudDetection>true</FailedFraudDetection>
  <FraudDetectionMessage>sample string 18</FraudDetectionMessage>
  <OrderingContact>
    <OrderingContactID>1</OrderingContactID>
    <OrderingEmail>sample string 2</OrderingEmail>
  </OrderingContact>
  <DeliveryAddress>
    <AddressID>1</AddressID>
    <DirectDelivery>true</DirectDelivery>
    <MedicalVATExempt>true</MedicalVATExempt>
    <CustomerCollecting>true</CustomerCollecting>
    <DeliveryCompany>sample string 5</DeliveryCompany>
    <Line1>sample string 6</Line1>
    <Line2>sample string 7</Line2>
    <Line3>sample string 8</Line3>
    <Town>sample string 9</Town>
    <County>sample string 10</County>
    <Postcode>sample string 11</Postcode>
    <Country>sample string 12</Country>
    <Firstname>sample string 13</Firstname>
    <Surname>sample string 14</Surname>
    <Email>sample string 15</Email>
    <Phone>sample string 16</Phone>
    <Mobile>sample string 17</Mobile>
  </DeliveryAddress>
  <InvoiceAddress>
    <AddressID>1</AddressID>
    <Line1>sample string 2</Line1>
    <Line2>sample string 3</Line2>
    <Line3>sample string 4</Line3>
    <Town>sample string 5</Town>
    <County>sample string 6</County>
    <Postcode>sample string 7</Postcode>
    <Country>sample string 8</Country>
  </InvoiceAddress>
  <NewOrderLines>
    <NewOrderLine>
      <ProductID>1</ProductID>
      <ProductCode>sample string 2</ProductCode>
      <Quantity>3</Quantity>
      <RequiredDate>sample string 4</RequiredDate>
      <UnitPrice>5</UnitPrice>
      <LineDiscountAmount>6</LineDiscountAmount>
      <DiscountNotes>sample string 7</DiscountNotes>
      <GiftVoucher>sample string 8</GiftVoucher>
      <LinkGroupID>9</LinkGroupID>
      <MediaCode>sample string 10</MediaCode>
      <CustRef>sample string 11</CustRef>
      <UnitCost>12</UnitCost>
    </NewOrderLine>
    <NewOrderLine>
      <ProductID>1</ProductID>
      <ProductCode>sample string 2</ProductCode>
      <Quantity>3</Quantity>
      <RequiredDate>sample string 4</RequiredDate>
      <UnitPrice>5</UnitPrice>
      <LineDiscountAmount>6</LineDiscountAmount>
      <DiscountNotes>sample string 7</DiscountNotes>
      <GiftVoucher>sample string 8</GiftVoucher>
      <LinkGroupID>9</LinkGroupID>
      <MediaCode>sample string 10</MediaCode>
      <CustRef>sample string 11</CustRef>
      <UnitCost>12</UnitCost>
    </NewOrderLine>
  </NewOrderLines>
  <OrderDiscounts>
    <OrderDiscount>
      <DiscountAmount>1</DiscountAmount>
      <DiscountText>sample string 2</DiscountText>
    </OrderDiscount>
    <OrderDiscount>
      <DiscountAmount>1</DiscountAmount>
      <DiscountText>sample string 2</DiscountText>
    </OrderDiscount>
  </OrderDiscounts>
  <OrderPayments>
    <OrderPayment>
      <TypeID>1</TypeID>
      <Amount>2</Amount>
      <GiftVoucherNumber>sample string 3</GiftVoucherNumber>
      <TransactionID>sample string 4</TransactionID>
      <AuthNumber>sample string 5</AuthNumber>
      <SecurityKey>sample string 6</SecurityKey>
      <VendorTXCode>sample string 7</VendorTXCode>
    </OrderPayment>
    <OrderPayment>
      <TypeID>1</TypeID>
      <Amount>2</Amount>
      <GiftVoucherNumber>sample string 3</GiftVoucherNumber>
      <TransactionID>sample string 4</TransactionID>
      <AuthNumber>sample string 5</AuthNumber>
      <SecurityKey>sample string 6</SecurityKey>
      <VendorTXCode>sample string 7</VendorTXCode>
    </OrderPayment>
  </OrderPayments>
  <CarriageAndDespatch>
    <ServiceLevelID>1</ServiceLevelID>
    <DespatchMethodID>2</DespatchMethodID>
    <Carriage>3</Carriage>
    <CarriageFOC>true</CarriageFOC>
  </CarriageAndDespatch>
  <ExternalMeta1>sample string 19</ExternalMeta1>
  <ExternalMeta2>sample string 20</ExternalMeta2>
</OrderCreateParams>

Response Information

Resource Description

Returns:
200 OK Returns created internal order ID and order number
400 Bad Request - parameters supplied cannot be properly interpreted
401 Not Authorised if supplied api key is not valid
503 Service Unavailable
Messages returned for error: 1,2,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,41,46

OrderCreateResults
NameDescriptionTypeAdditional information
OrderCreateData

OrderCreateData

None.

Response Formats

application/json, text/json

Sample:
{
  "OrderCreateData": {
    "OK": true,
    "OrderID": 2,
    "OrderNo": 3,
    "OrderCreateIssues": [
      {
        "ID": 1,
        "Message": "sample string 2",
        "ExtraData": "sample string 3"
      },
      {
        "ID": 1,
        "Message": "sample string 2",
        "ExtraData": "sample string 3"
      }
    ]
  }
}

application/xml, text/xml

Sample:
<OrderCreateResults xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <OrderCreateData>
    <OK>true</OK>
    <OrderID>2</OrderID>
    <OrderNo>3</OrderNo>
    <OrderCreateIssues>
      <OrderCreateIssue>
        <ID>1</ID>
        <Message>sample string 2</Message>
        <ExtraData>sample string 3</ExtraData>
      </OrderCreateIssue>
      <OrderCreateIssue>
        <ID>1</ID>
        <Message>sample string 2</Message>
        <ExtraData>sample string 3</ExtraData>
      </OrderCreateIssue>
    </OrderCreateIssues>
  </OrderCreateData>
</OrderCreateResults>