Create Order

POST New Orders

This route submits a new order and places it in User’s shopping cart. An order is consisted of one or more jobs. Each job is constructed by series of UUIDs and shipping data. Ship_from address is required when a job is drop-shipped.
All files must be identified by appropriate file-reason code. For more details about files and file reason codes please see Services/File Services section.
For ship-to and ship-from (if drop-ship is set to TRUE) addresses, either company name or both first and last name of the contact person are required. Presence of all three is also acceptable.

Resource URI

POST  /orders                                                 



<h3>Input Parameters</h3>


@param order_id {String} order_id specified by the API user. (Required)
@param is_test_order {boolean} allows the user to submit test orders. Orders with is_test_order set to TRUE will not go to production. (Optional and default is set to FALSE)
@param coupon_code {string} allows user to pass a coupon-code that will apply to any resources qualified in the order based on coupon rules. Only one coupon per order is allowed (Optional)
@param skip_conformation {boolean} By setting this flag to TRUE the system will bypass conformation. If the flag is set to FALSE, an e-mail containing a HTML preview link is emailed to the authenticated user.  (Optional and default set to FALSE)
@param job_name {string} Job name. (Required)
@param product_uuid {uuid} UUID of product. (Required)
@param runsize_uuid {uuid} UUID of runsize option. (Required)
@param turnaroundtime_uuid {uuid} UUID of product. (Optional - If not submitted, shortest free tunraround time will be selected)
@param colorspec_uuid {uuid} UUID of colorspec option. (Required)
@param option_uuids {uuid} array of option UUIDs to specify any options that may be required or optional. (Required field but can be empty array)
@param dropship {boolean} flag to identify if the job is being drop shipped. (Required) 
@param skip_files {boolean} allows order submission without files. Files can be submitted later when the order comes in with this falg set to TRUE. (Optional)
@param files {string} URI to location of files or UUID of files POST-ed to 4over server. If "skip_files" is set to TRUE this parameter can be omitted. (Optional)
@param company {string} Ship_to Company Name. (Required if firstname and lastname are not provided)
@param firstname {string} Ship_to First Name. (Required if company is not provided)
@param lastname {string} Ship_to Last Name. (Required if company is not provided)
@param email {string} Ship_to Email. (optional)
@param phone {string} Ship_to Phone Number. (Required)
@param address {string} Ship_to address line. (Required)
@param address2 {string} Ship_to address2 line. (Optional)
@param city {string} Ship_to city. (Required)
@param state {string} Ship_to state. (Required)
@param zipcode {string} Ship-to zipcode. (Required)
@param country {string} Ship_to country. (Required)
@param company {string} Ship_from Company Name. (Required if ship-from present and firstname and lastname are not provided)
@param firstname {string} Ship_from First Name. (Required if ship-from present and company is not provided)
@param lastname {string} Ship_from Last Name. (Required if ship-from present and company is not provided)
@param email {string} Ship_from Email. (optional if ship-from is present)
@param phone {string} Ship_from Phone Number. (Required if ship-from is present)
@param address {string} Ship_from address line. (Required if ship-from is present)
@param address2 {string} Ship_from address2 line. (optional if ship-from is present)
@param city {string} Ship_from city. (Required if ship-from is present)
@param state {string} Ship_from state. (Required if ship-from is present)
@param zipcode {string} Ship_from zipcode. (Required if ship-from is present)
@param country {string} Ship_from country. (Required if ship-from is present)
@param facility_code {string} facility code of the production facility. (Optional - If not submitted, the closets facility to the Ship-to address that can produce the product/options combination will be selected.)

Sample Request URI

html

https://api.4over.com/orders 

Sample Request Body

NOTE:
Group-Shipping is available for same type products with the same stock, colorspec, coating and runsize. The base price route provides a “can_group_ship” flag to let users know what products are qualifid for group-shipping.
In sample request bellow “job001-001” and “job001-002” are grouped together for group-shipping and “job002-001”, “job002-002” and “job002-003” are groupped as a separate group-shipping job.

JSON

{
	"order_id": "test001",
	"is_test_order": "true",
	"coupon_code": "PRC5PKS",
	"skip_conformation": "true",
	"jobs": [{
			"product_uuid": "91efff4d-de64-410a-8794-fc547022a7f2",
			"runsize_uuid": "52e3d710-0e8f-4d4d-8560-7d4d8655be69",
			"option_uuids": [],
			"turnaroundtime_uuid": "50979118-b3a2-4556-9f46-d1da268f2354",
			"colorspec_uuid": "13abbda7-1d64-4f25-8bb2-c179b224825d",
			"dropship": "true",
			"sets": 2,
			"files": {
				"set_001": {
					"job_name": "job001-001",
					"files": {
						"fr": "5a2e207c-8a97-42a3-9b17-1e4899eae9ac",
						"bk": "d044410f-003e-4b32-8039-f6d590728f5b"
					}
				},
				"set_002": {
					"job_name": "job001-002",
					"files": {
						"fr": "8b0fd851-7f13-4700-a35a-baff123eecfe",
						"bk": "3d71bf4a-a799-4dfb-ac90-8fea5f97b608"
					}
				}
			},
			"ship_to": {
				"company": "My Print Company",
				"firstname": "James",
				"lastname": "Doe",
				"email": "james.doe@abcd_company.com",
				"phone": "888-888-8888",
				"address": "8900 Executive Park Drive",
				"address2": "",
				"city": "Knoxville",
				"state": "TN",
				"zipcode": "37923",
				"country": "US"
			},
			"ship_from": {
				"company": "My Print Company",
				"firstname": "Mike",
				"lastname": "Doe",
				"email": null,
				"phone": "888-888-8888",
				"address": "100 CUMMINGS CTR",
				"address2": null,
				"city": "BEVERLY",
				"state": "MA",
				"zipcode": "01915",
				"country": "US"
			},
			"shipper": {
				"shipping_method": "FREE UPS Ground",
				"shipping_code": "03f"
			},
			"ship_from_facility": "DAY"
		},
		{
			"product_uuid": "91efff4d-de64-410a-8794-fc547022a7f2",
			"runsize_uuid": "52e3d710-0e8f-4d4d-8560-7d4d8655be69",
			"option_uuids": [],
			"turnaroundtime_uuid": "50979118-b3a2-4556-9f46-d1da268f2354",
			"colorspec_uuid": "13abbda7-1d64-4f25-8bb2-c179b224825d",
			"dropship": "true",
			"sets": 3,
			"files": {
				"set_001": {
					"job_name": "job002-001",
					"files": {
						"fr": "62a7d70a-3b38-45a8-9327-e10a9c4057df",
						"bk": "ef45e3ff-2f3c-415c-8c63-4f5e3f290e8d"
					}
				},
				"set_002": {
					"job_name": "job002-002",
					"files": {
						"fr": "bad3efad7-2e72-4a5e-87ec-d8bad3ef0359",
						"bk": "f9ead3ef0-b0de-4033-ad6d-aa15aa8c2555"
					}
				},
				"set_003": {
					"job_name": "job002-003",
					"files": {
						"fr": "3830c3ee-72e4-46d7-8d0d-aad3ef77ccf1",
						"bk": "bd380570-135d-47fd-9411-b3ead3ef99d8"
					}
				}
			},
			"ship_to": {
				"company": "My Test Company",
				"firstname": "Maria",
				"lastname": "Doe",
				"email": "maria.doe@abcd_company.com",
				"phone": "888-888-8888",
				"address": "8900 Executive Park Drive",
				"address2": null,
				"city": "Knoxville",
				"state": "TN",
				"zipcode": "37923",
				"country": "US"
			},
			"ship_from": {
				"company": "My Print Company",
				"firstname": "Mike",
				"lastname": "Doe",
				"email": null,
				"phone": "888-888-8888",
				"address": "100 CUMMINGS CTR",
				"address2": null,
				"city": "BEVERLY",
				"state": "MA",
				"zipcode": "01915",
				"country": "US"
			},
			"shipper": {
				"shipping_method": "FREE UPS Ground",
				"shipping_code": "03f"
			},
			"ship_from_facility": "DAY"
		}
	],
	"payment": {
		"profile_token": "xxxxxxxxxx"

	}
}

Sample Response

JSON

{
	"order_status": "Success",
	"customer_order_id": "test001",
	"job_ids": {
		"X8291118499-001": {
			"customer_job_id": "job001-001",
			"status": 200,
			"messages": []
		},
		"X8291118499-002": {
			"customer_job_id": "job001-002",
			"status": 200,
			"messages": []
		},
		"X8291118499-003": {
			"customer_job_id": "job002-001",
			"status": 200,
			"messages": []
		},
		"X8291118499-004": {
			"customer_job_id": "job002-002",
			"status": 200,
			"messages": []
		},
		"X8291118499-005": {
			"customer_job_id": "job002-003",
			"status": 200,
			"messages": []
		}
	},
	"payment_response": {
		"payment_uuid": "e58bee7f-0b57-4214-9e2a-33d683e7fe9f",
		"payment_provider": {
			"payment_provider_uuid": "6b0e699e-bdaf-4d1e-af4c-bc422ad21761",
			"payment_provider": "Authorizenet",
			"created_at": "2013-11-05 11:33:51-08"
		},
		"requested_amount": "119.70",
		"requested_currency": {
			"currency_code": "USD",
			"currency": "United States dollar",
			"currency_number": "840",
			"created_at": "2013-09-30 09:27:22.689216-07"
		},
		"request_transaction_code": "12345678920",
		"request_data": "",
		"requested_at": "2018-10-18T18:06:19+0000",
		"response_transaction_code": "12345678920",
		"response_data": {
			"card_number": "XXXX1111",
			"card_type": "Visa",
			"response_message": "This transaction has been approved."
		},
		"responded_at": "2018-10-18T18:06:19+0000",
		"authorization_code": "ABCDEF",
		"authorized_at": "2018-10-18T18:06:19+0000",
		"authorized_payment_amount": "119.70",
		"authorized_refund_amount": 0,
		"authorized_currency": {
			"currency_code": "USD",
			"currency": "United States dollar",
			"currency_number": "840",
			"created_at": "2013-09-30 09:27:22.689216-07"
		},
		"paying_organization": {
			"organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989",
			"organization_name": "4over",
			"organization_description": "4over Website - Trade Ultra",
			"job_code_prefix": "K",
			"is_public_organization": true,
			"primary_contact_user": {
				"user_uuid": "d44fa923-d567-48ed-aa3a-9c02a98bcee6",
				"first_name": "Admin User",
				"last_name": "API",
				"email": "",
				"user_notes": "admin user",
				"created_at": "2014-03-18 12:33:43.387423-07",
				"updated_at": "2015-07-06 10:29:18.338875-07",
				"deleted_at": "",
				"organizations": "https://sandbox-api.4over.com/users/d44fa923-d567-48ed-aa3a-9c02a98bcee6/organizations",
				"logins": "https://sandbox-api.4over.com/users/d44fa923-d567-48ed-aa3a-9c02a98bcee6/logins",
				"token": "5ec64e96d3877374fd35c2aae94cea3d07b83e10",
				"timestamp": "0.09669000 1539885980",
				"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
			},
			"parent_organization": {
				"organization_uuid": "8a17ef16-d997-4544-9f7c-d313febf9c40",
				"organization_name": "4over root",
				"organization_description": "4over root",
				"job_code_prefix": "Z",
				"is_public_organization": true,
				"primary_contact_user": {
					"user_uuid": "cb51b9fc-6a6e-4b98-885f-5d21041c1403",
					"first_name": "Jane",
					"last_name": "Doe",
					"email": "fake@4over.com",
					"user_notes": "test",
					"created_at": "2012-09-10 07:00:00.000000+0000",
					"updated_at": "2018-05-31 15:48:19.140525-07",
					"deleted_at": "",
					"organizations": "https://sandbox-api.4over.com/users/cb51b9fc-6a6e-4b98-885f-5d21041c1403/organizations",
					"logins": "https://sandbox-api.4over.com/users/cb51b9fc-6a6e-4b98-885f-5d21041c1403/logins",
					"token": "47a11796c675bbde6e3215239cd1a4c76255e854",
					"timestamp": "0.09683600 1539885980",
					"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
				}
			}
		},
		"paying_user": {
			"user_uuid": "0e153dc0-9b7b-47e8-8cfd-e50d88817ffb",
			"first_name": "Test",
			"last_name": "Tester",
			"email": "fake@4over.com",
			"user_notes": "testing ",
			"created_at": "2013-08-26 07:00:00.000000+0000",
			"updated_at": "2018-05-31 15:48:19.773569-07",
			"deleted_at": "",
			"organizations": "https://sandbox-api.4over.com/users/0e153dc0-9b7b-47e8-8cfd-e50d88817ffb/organizations",
			"logins": "https://sandbox-api.4over.com/users/0e153dc0-9b7b-47e8-8cfd-e50d88817ffb/logins",
			"token": "19253d572c2e5db795b4a8c846135218587c065b",
			"timestamp": "0.09695700 1539885980",
			"current_organization_uuid": "a4377724-8819-4a96-bc2b-3877b269f989"
		},
		"created_at": "2018-10-18T18:06:19+0000"
	},
	"payment_type": "authnet"
}

 

**If there are any failed jobs, the response will show either “Warning” or “Failed” for “order_status” and will appear as shown below:

If  “order_status” is Warning or Failed, you have jobs that did not go through.  Jobs in the “job_ids” array are the Successful jobs and do not need to get sent again.  Any jobs in the “errors” array DO need to get fixed and resent to the order API.

{
 "order_status": "Warning",
 "job_ids": [
    {
        "internal_id": "X6327136040-001",
        "customer_job_id": "93cc6db6-acd7-11e6-8635-0242ac110003-corporate"
    }
 ],
....
....
"errors": [
    {
       "customer_order_id": "123456",
       "customer_job_id": "YOUR_JOB_ID",
       "internal_id": "Z12345678",
       "message": "ERROR MESSAGE WILL GO HERE",
       "job_status": "Failed"
     }
  ]
}