order

order.add

Add a new order to the cart.

post/order.add.json

Request

  • Base URL: https://api.api2cart.com/v1.1
  • URL: https://api.api2cart.com/v1.1/order.add.json
  • Auth: API key in header x-api-key and API key in header x-store-key

Request body

idstring

Defines order's id

order_idstring

Defines the order id if it is supported by the cart

store_idstring

Defines store id where the order should be assigned

channel_idstring

Channel ID

order_statusstring required

Defines order status.

fulfillment_statusstring

Create order with fulfillment status

financial_statusstring

Create order with financial status

customer_emailstring required

Defines the customer specified by email for whom order has to be created

customer_first_namestring

Specifies customer's first name

customer_last_namestring

Specifies customer’s last name

customer_phonestring

Specifies customer’s phone

customer_countrystring

Specifies customer's address ISO code or name of country

customer_birthdaystring

Specifies customer’s birthday

customer_faxstring

Specifies customer’s fax

is_guestboolean

Indicates whether the customer is a guest customer

order_payment_methodstring

Defines order payment method.<br/>Setting order_payment_method on Shopify will also change financial_status field value to 'paid'

transaction_idstring

Payment transaction id

currencystring

Currency code of order

datestring

Specifies an order creation date in format Y-m-d H:i:s

date_modifiedstring

Specifies order's modification date

date_finishedstring

Specifies order's finished date

bill_first_namestring required

Specifies billing first name

bill_last_namestring required

Specifies billing last name

bill_address_1string required

Specifies first billing address

bill_address_2string

Specifies second billing address

bill_citystring required

Specifies billing city

bill_postcodestring required

Specifies billing postcode

bill_statestring required

Specifies billing state code

bill_countrystring required

Specifies billing country code

bill_companystring

Specifies billing company

bill_phonestring

Specifies billing phone

bill_faxstring

Specifies billing fax

shipp_first_namestring

Specifies shipping first name

shipp_last_namestring

Specifies shipping last name

shipp_address_1string

Specifies first shipping address

shipp_address_2string

Specifies second address line of a shipping street address

shipp_citystring

Specifies shipping city

shipp_postcodestring

Specifies shipping postcode

shipp_statestring

Specifies shipping state code

shipp_countrystring

Specifies shipping country code

shipp_companystring

Specifies shipping company

shipp_phonestring

Specifies shipping phone

shipp_faxstring

Specifies shipping fax

subtotal_pricenumber

Total price of all ordered products multiplied by their number, excluding tax, shipping price and discounts

tax_pricenumber

The value of tax cost for order

total_pricenumber

Defines order's total price

total_paidnumber

Defines total paid amount for the order

total_weightinteger

Defines the sum of all line item weights in grams for the order

prices_inc_taxboolean

Indicates whether prices and subtotal include tax.

shipping_pricenumber

Specifies order's shipping price

shipping_taxnumber

Specifies order's shipping price tax

discountnumber

Specifies order's discount

coupon_discountnumber

Specifies order's coupon discount

gift_certificate_discountnumber

Discounts for order with gift certificates

order_shipping_methodstring

Defines order shipping method

carrier_idstring

Defines tracking carrier id

warehouse_idstring

This parameter is used for selecting a warehouse where you need to set/modify a product quantity.

couponsstring[]

Coupons that will be applied to order

tagsstring

Order tags

commentstring

Specifies order comment

admin_commentstring

Specifies admin's order comment

admin_private_commentstring

Specifies private admin's order comment

send_notificationsboolean

Send notifications to customer after order was created

send_admin_notificationsboolean

Notify admin when new order was created.

external_sourcestring

Identifying the system used to generate the order

inventory_behaviourstring

The behaviour to use when updating inventory.<hr><div style="font-style:normal">Values description:<div style="margin-left: 2%; padding-top: 2%"><div style="font-size:85%"><b>bypass</b> = Do not claim inventory </br></br><b>decrement_ignoring_policy</b> = Ignore the product's </br> inventory policy and claim amounts</br></br><b>decrement_obeying_policy</b> = Obey the product's </br> inventory policy.</br></br></div></div></div>

create_invoiceboolean

Defines whether the invoice is created automatically along with the order

invoice_admin_commentstring

Specifies admin's order invoice comment

clear_cacheboolean

Is cache clear required

originstring

The source of the order

fee_pricenumber

Specifies refund's fee price

shipp_national_addressstring

Specifies short national address code of a shipping address

shipp_building_numberstring

Specifies building number of a shipping address

shipp_additional_numberstring

Specifies additional number of a shipping address

idempotency_keystring

A unique identifier associated with a specific request. Repeated requests with the same <strong>idempotency_key</strong> return a cached response without re-executing the business logic. <strong>Please note that the cache lifetime is 15 minutes.</strong>

Example request

{
  "store_id": "1",
  "channel_id": "1",
  "order_status": "Completed",
  "fulfillment_status": "fulfilled",
  "financial_status": "paid",
  "customer_email": "jubari@hannsgroup.com",
  "customer_first_name": "John",
  "customer_last_name": "Smith",
  "customer_phone": "88008547457",
  "customer_country": "US",
  "customer_birthday": "1990-12-03",
  "customer_fax": "5656598",
  "is_guest": true,
  "order_payment_method": "PayPal",
  "transaction_id": "d41d8cd98f00b204e9800998ecf8427e",
  "currency": "USD",
  "date": "2012-09-25 19:40:00",
  "date_modified": "2014-05-05 05:05:00",
  "date_finished": "2014-06-05 05:05:00",
  "bill_first_name": "Adam",
  "bill_last_name": "Smith",
  "bill_address_1": "Green str. 35",
  "bill_address_2": "Red str, 2",
  "bill_city": "Chicago",
  "bill_postcode": "12345",
  "bill_state": "IL",
  "bill_country": "US",
  "bill_company": "Apple",
  "bill_phone": "8 800 5659 6896",
  "bill_fax": "545 45878",
  "shipp_first_name": "John",
  "shipp_last_name": "Smith",
  "shipp_address_1": "Green str. 35",
  "shipp_address_2": "Green str. 35",
  "shipp_city": "Chicago",
  "shipp_postcode": "24545",
  "shipp_state": "IL",
  "shipp_country": "US",
  "shipp_company": "Apple",
  "shipp_phone": "880086544564",
  "shipp_fax": "556868",
  "subtotal_price": 563.23,
  "tax_price": 5.5,
  "total_price": 23.56,
  "total_paid": 23.56,
  "total_weight": 23,
  "prices_inc_tax": true,
  "shipping_price": 5.5,
  "shipping_tax": 5.5,
  "discount": 5.5,
  "coupon_discount": 5.5,
  "gift_certificate_discount": 5.5,
  "order_shipping_method": "UPS Ground",
  "carrier_id": "USPS",
  "warehouse_id": "1",
  "tags": "tag1,tag2",
  "comment": "This coole order",
  "admin_comment": "Test admin comment",
  "admin_private_comment": "Test admin private comment",
  "send_notifications": true,
  "send_admin_notifications": true,
  "external_source": "POS",
  "inventory_behaviour": "decrement_ignoring_policy",
  "create_invoice": true,
  "invoice_admin_comment": "Test admin comment",
  "origin": "newsletter",
  "fee_price": 5.5,
  "shipp_national_address": "RHMA3184",
  "shipp_building_number": "3184",
  "shipp_additional_number": "8523",
  "idempotency_key": "098f6bcd4621d373cade4e832627b4f6",
  "order_item": [
    {
      "order_item_id": "125, where {x} - 1,2,3,... etc",
      "order_item_name": "Product 1, where {x} - 1,2,3,... etc",
      "order_item_model": "sku_1, where {x} - 1,2,3,... etc",
      "order_item_tax": 5.5,
      "order_item_tax_class": "standard",
      "order_item_parent": 2,
      "order_item_parent_option_name": "Internal Memory Storage",
      "order_item_allow_refund_items_separately": true,
      "order_item_allow_ship_items_separately": true,
      "order_item_option": [
        {
          "order_item_option_name": "Color",
          "order_item_option_value": "green",
          "order_item_option_price": 2.3
        }
      ],
      "order_item_property": [
        {
          "order_item_property_name": "Engraving",
          "order_item_property_value": "lorem ipsum"
        }
      ]
    }
  ]
}

Response

successful operation

return_codeinteger
return_messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.