Want to add orders from another system? You are at the right place. Below is an example of a code to create orders in your system. These orders will be marked as API with their own icon so they are identifiable to others.
Orders coming from the API cannot be tied to existing products. You can call them the same, but they will not connected to your existing products.
The first section relates to the Order. Where you see a bold 'Jobs' is the start of the data relating to the jobs within the order. There are two jobs in the example below. The last section relates to the timeline entrie and custom order fields.
To use this code you will need to add your relevant storefront ID
{
"object": "order",
"attributes": {
"delivery_address_city": "Halifax",
"delivery_address_country": "GB",
"delivery_address_fao": "Max",
"delivery_address_line_1": "88 Marketing Road",
"delivery_address_line_2": "Tumbledown weeds",
"delivery_address_line_3": "Southowram",
"delivery_address_name": "Something Useful Ltd",
"delivery_address_postcode": "HD2 3SZ",
"delivery_address_state": "",
"delivery_instructions": "Deliver here only",
"delivery_name": "",
"delivery_telephone": "0488426368",
"delivery_email": "",
"billing_address_city": "",
"billing_address_country": "",
"billing_address_line_1": "",
"billing_address_line_2": "",
"billing_address_line_3": "",
"billing_address_name": "",
"billing_address_postcode": "",
"billing_address_state": "",
"currency_code": "GBP",
"net_price": 2.49,
"tax_name": "VAT",
"tax_rate": 20,
"tax_value": 0,
"total_price": 2.49,
"budget_name": "",
"budget_used": 0,
"cost_centre": "",
"amount_paid": 0,
"paid_flag": false,
"date_approved": "",
"date_ordered": 1697552155,
"date_required_by": "",
"department_name": "Marketing (August 2023)",
"external_code": "",
"from_quote_urn": "",
"invoice_sent": false,
"invoice_sent_date": "",
"order_comment": "Some checkout comment",
"ordered_by_company": "Marshalls",
"ordered_by_name": "Max Kulow",
"ordered_by_email": "max@printjob.com",
"shipping_consignment_cost_aggregate": 0,
"shipping_consignment_method_aggregate": "",
"shipping_method": "",
"shipping_price": 0,
"shipping_taxed": false,
"storefront": "client_5_X5xzdGZV6yrBeODJ1WQa",
"department": "department_19_p0kDxOqE9qnPlgyNZ54M",
"jobs": {
"object": "list",
"count": 2,
"data": [
{
"object": "job",
"attributes": {
"cost_price": 0,
"discount_code": "",
"discount_percentage": 0,
"discount_value": 0,
"estimated_delivery_date": "",
"job_name": "",
"currency_code": "GBP",
"net_price": 0,
"quantity": 2,
"supplier_email": "",
"supplier_name": "",
"tax_rate": 20,
"tax_value": 0,
"urgent": false,
"weight": 0.0004,
"title": "Box of Marshalls Brochures (20 copies)",
"preconfiguredProduct": {
"object": "preconfiguredProduct",
"attributes": {
"digital": "normal",
"area_width_mm": 0,
"area_height_mm": 0,
"area_width_ft": 0,
"area_height_ft": 0,
"area_width_in": 0,
"area_height_in": 0,
"product_name": "Box of Marshalls Brochures (20 copies)",
"product_description": "<p><span style=\"color:hsl(210,29%,24%);\">Order your Marshalls 148 page A4 brochure, packed with all the Marshalls classic and contemporary products, along with many design guides and tips to help you plan your dream patio or driveway.</span></p>",
"product_print_specification": "",
"product_unique_id": "MARBROPK",
"tax_exempt": "0",
"options": {
"object": "list",
"count": 0,
"data": []
},
"parameters": {
"object": "list",
"count": 0,
"data": []
},
"files": {
"object": "list",
"count": 0,
"data": []
},
"digitalFiles": {
"object": "list",
"count": 0,
"data": []
}
}
},
"jobStatus": "job_status_3_AMkaYl1eBde9jvRLWDpX",
"supplier": "",
"timeline": {
"object": "list",
"count": 0,
"data": []
},
"jobArtworkFile": "",
"finalArtworks": {
"object": "list",
"count": 0,
"data": []
},
"jobAdminArtworkFiles": {
"object": "list",
"count": 0,
"data": []
}
}
},
{
"object": "job",
"attributes": {
"cost_price": 2.49,
"discount_code": "",
"discount_percentage": 0,
"discount_value": 0,
"estimated_delivery_date": "",
"job_name": "",
"currency_code": "GBP",
"net_price": 2.49,
"quantity": 1,
"supplier_email": "",
"supplier_name": "",
"tax_rate": 0,
"tax_value": 0,
"urgent": false,
"weight": 0.0001,
"title": "Single Marshalls Brochure (1 copy)",
"preconfiguredProduct": {
"object": "preconfiguredProduct",
"attributes": {
"digital": "normal",
"area_width_mm": 0,
"area_height_mm": 0,
"area_width_ft": 0,
"area_height_ft": 0,
"area_width_in": 0,
"area_height_in": 0,
"product_name": "Single Marshalls Brochure (1 copy)",
"product_description": "<p><span style=\"color:hsl(210,29%,24%);\">Order your Marshalls 148 page A4 brochure, packed with all the Marshalls classic and contemporary products, along with many design guides and tips to help you plan your dream patio or driveway.</span></p>",
"product_print_specification": "",
"product_unique_id": "MARBROSG",
"tax_exempt": "1",
"options": {
"object": "list",
"count": 0,
"data": []
},
"parameters": {
"object": "list",
"count": 0,
"data": []
},
"files": {
"object": "list",
"count": 0,
"data": []
},
"digitalFiles": {
"object": "list",
"count": 0,
"data": []
}
}
},
"jobStatus": "job_status_3_AMkaYl1eBde9jvRLWDpX",
"supplier": "",
"timeline": {
"object": "list",
"count": 0,
"data": []
},
"jobArtworkFile": "",
"finalArtworks": {
"object": "list",
"count": 0,
"data": []
},
"jobAdminArtworkFiles": {
"object": "list",
"count": 0,
"data": []
}
}
}
]
},
"orderPayments": {
"object": "list",
"count": 0,
"data": []
},
"timeline": {
"object": "list",
"count": 2,
"data": [
{
"object": "timelineEntry",
"attributes": {
"actual_originator_name": "Support User (support@printjob.com)",
"actual_originator_role": "developer",
"date_created": "1697552155.6326",
"message_metadata": "",
"pertains_to": "order",
"recorded_originator_name": "Max (max@printjob.com)",
"recorded_originator_role": "registered_guest",
"system_message": "Created order",
"type": "system",
"user_message": "",
"visible_admin": true,
"visible_supplier": false,
"visible_user": true,
"timelineEntryFiles": {
"object": "list",
"count": 0,
"data": []
}
}
},
{
"object": "timelineEntry",
"attributes": {
"actual_originator_name": "Support User (support@printjob.com)",
"actual_originator_role": "developer",
"date_created": "1697552155.7016",
"message_metadata": "",
"pertains_to": "order",
"recorded_originator_name": "Max (max@printjob.com)",
"recorded_originator_role": "registered_guest",
"system_message": "Some checkout comment",
"type": "comment",
"user_message": "Some checkout comment",
"visible_admin": true,
"visible_supplier": true,
"visible_user": true,
"timelineEntryFiles": {
"object": "list",
"count": 0,
"data": []
}
}
}
]
},
"orderCustomFieldValues": {
"object": "list",
"count": 3,
"data": [
{
"object": "orderCustomFieldValue",
"attributes": {
"name": "Other Customer (if applicable)",
"value": "Someone else"
}
},
{
"object": "orderCustomFieldValue",
"attributes": {
"name": "Delivery Address Contact Tel No",
"value": "0444 4444 4444"
}
},
{
"object": "orderCustomFieldValue",
"attributes": {
"name": "Customer Order Required for",
"value": "Jewson"
}
}
]
}
}
}