Skip to content

Order_Create#


Description#

This function allows you to create a new order. This function takes input parameters for both items and products. Items allows you to add any item to an order. It does not need to match any existing product in the catalog. When using the products object, Miva will validate that product code exists and load data from that product such as price, weight, name, and cost.

Request Body Parameters#

Parameter
Type Description
Customer_Login String Customer to assign the order to
Customer_ID Number Customer to assign the order to (only customer_login or customer_id can be sent)
Order_Id Number If omitted, Miva will automatically assign an order id to the order.
ShipFirstName String FirstName for Ship To address
ShipLastName String LastName for Ship To address
ShipEmail String Email for Ship To address
ShipPhone String Phone Number for Ship To address
ShipFax String Fax Number for Ship To address
ShipCompany String Company Name for Ship To address
ShipAddress1 String Address line 1 for Ship To address
ShipAddress2 String Address line 2 for Ship To address
ShipCity String City for Ship To address
ShipState String State for Ship To Address
ShipZip String Zip Code for Ship To address
ShipCountry String Country for Ship To Address
ShipFirstName String FirstName for Bill To address
ShipLastName String LastName for Bill To address
ShipEmail String Email for Bill To address
ShipPhone String Phone Number for Bill To address
ShipFax String Fax Number for Bill To address
ShipCompany String Company Name for Bill To address
ShipAddress1 String Address line 1 for Bill To address
ShipAddress2 String Address line 2 for Bill To address
ShipCity String City for Bill To address
ShipState String State for Bill To Address
ShipZip String Zip Code for Bill To address
ShipCountry String Country for Bill To Address
Items Object Object containing all the items in the order
Products Object Object containing all the product groups in the order
Charges Object Object containing the charges for the order
CustomFields Object Object containing the custom fields for the order
Shipping_Module_Code String Shipping Module Code
Shipping_module_Data String Typically Shipping Method Name
CalculateCharges Boolean Boolean Value to have Miva re-calculate tax and shipping values based on Shipping Module/Method sent.
TriggerFulfillmentModules Boolean Boolean Value to have Miva trigger fulfillment modules (Send Order Confirmation Emails)

Items Object#

Parameter
Type Description
status Number Item Status. 0 = Pending
100 = Picking
200 = Shipped
210 = Gift Certificate: Not Redeemed
211 = Gift Certificate: Redeemed
220 = Digital: Not Downloaded
221 = Digital: Downloaded
300 = Cancelled
400 = Backordered
500 = RMA Issued
600 = Returned
Code String Item Code
Name String Item Name
SKU String SKU
tracknum String [optional] Tracking Number if item is already shipped
tracktype String Tracking Type. Default Types include “CanadaPost”, “Endicia”, “FedEx”, “UPS”, “USPS”.
price Number Price
weight Number Weight
quantity Number Quantity
taxable Boolean Taxable
upsold Boolean Upsold
Options Object Object containing the items options

Items.Options Object#

Parameter
Type Description
opt_code_or_data String You can pass this value OR opt_code below.
attr_code String attr_code
opt_code String Option Code
Price Number Option Price
Weight Number Option Weight

Products Object#

Parameter
Type Description
status Number Item Status. 0 = Pending, 100 = Picking, 200 = Shipped, 210 = Gift Certificate: Not Redeemed, 211 = Gift Certificate: Redeemed, 220 = Digital: Not Downloaded, 221 = Digital: Downloaded , 300 = Cancelled, 400 = Backordered, 500 = RMA Issued, 600 = Returned
Code String Code
SKU String SKU
tracknum String tracknum
tracktype String tracktype
quantity Number quantity
Attributes Object Attributes

Products.Attributes Object#

Parameter
Type Description
code String code
template_code String Attribute Template Code. Empty if not an attribute template is not being used.
Value String Attribute Value

Charges Object#

Parameter
Type Description
type String Default Types include: TAX, SHIPPING, DISCOUNT, COUPON
descrip String Charge Description
amount Number Amount
display_amount Number Display Amount
tax_exempt Boolean Tax Exempt

CustomFields Object#

Parameter
Type Description
module_code String Module Code, ex: customfields
field_code String Custom Field Code
value String Custom Field Value

Example Request#

{
    "Customer_Login": "user123",
    "ShipFirstName": "John",
    "ShipLastName": "Doe",
    "ShipEmail": "john@example.com",
    "ShipPhone": "123-456-7890",
    "ShipAddress1": "123 Main St",
    "ShipCity": "Springfield",
    "ShipState": "IL",
    "ShipZip": "62701",
    "ShipCountry": "US",
    "Items": {
        "item1": {
            "Code": "ITEM001",
            "Name": "Example Item",
            "SKU": "SKU001",
            "price": 10.99,
            "weight": 0.5,
            "quantity": 2,
            "taxable": true,
            "Options": {
                "option1": {
                    "code": "OPTION001",
                    "prompt": "Size",
                    "value": "Large"
                }
            }
        }
    }
}

Example Response#

{
    "Order_Id": 12345
}