1. Buyer perspective

Submitting your first order

In the previous guides, you created an empty order and then populated it with a line item containing two of our Cotton T-shirt products.

Shipping estimates

In a normal order checkout process, you would provide a shipping address and have a choice of shipping providers. This is what the Shipping Estimates integration is for and will be covered in later documentation.

See Integration Events: Estimate Shipping for more information.

Calculate

When a shipper is selected or pre-configured by the application, run an Order Calculate to update ShippingCost and TaxCost using a third-party provider and elevated API roles. Again, this is beyond the scope of this guide and covered in later documentation.

See Integration Events: Order Calculate for more information.

Submitting the order

Once you have an order with at least one line item, use the Order Submit endpoint to change the order's status from Unsubmitted to Open. At that point, the seller perspective or automation takes over fulfillment.

See Order Submit for more information.

http
POST https://sandboxapi.ordercloud.io/v1/orders/Outgoing/INSERT_ORDER_ID_HERE/submit HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

The response looks like this:

json
{
	"ID": "PKTiEFNEiEi9mEmC9cZCrw",
	"FromUser": {
		"ID": "BUYER_USER",
		"Username": "buyer01",
		"Password": null,
		"FirstName": "Buyer",
		"LastName": "User",
		"Email": "[email protected]",
		"Phone": null,
		"TermsAccepted": null,
		"Active": true,
		"xp": null,
		"AvailableRoles": null,
	        "Locale": null,
		"DateCreated": "2021-02-08T23:09:14.82+00:00",
		"PasswordLastSetDate": "2021-02-08T23:10:00.56+00:00"
	},
	"FromCompanyID": "BUYER_ORGANIZATION",
	"ToCompanyID": "bClEeDV0f9GjjkGD",
	"FromUserID": "BUYER_USER",
	"BillingAddressID": null,
	"BillingAddress": null,
	"ShippingAddressID": null,
	"Comments": null,
	"LineItemCount": 1,
	"Status": "Open",
	"DateCreated": "2021-02-23T20:39:03.173+00:00",
	"DateSubmitted": "2021-03-01T22:37:59.267+00:00",
	"DateApproved": null,
	"DateDeclined": null,
	"DateCanceled": null,
	"DateCompleted": null,
	"LastUpdated": "2021-03-01T22:37:59.267+00:00",
	"Subtotal": 20,
	"ShippingCost": 0,
	"TaxCost": 0,
	"PromotionDiscount": 0,
	"Total": 20,
	"IsSubmitted": true,
	"LineItems": null,
	"xp": null
}

The order now has IsSubmitted set to true, Status is set to "Open", and the DateSubmitted property has been set.

You have submitted your first OrderCloud order.

If you have suggestions for improving this article, let us know!