> Part of [WHCC Developer Documentation](https://www.whcc.com/developer/llms.txt)

# Ordering

WHCC provides a simple API to order the products designed in editors for processing and production.

A single editor or a collection of editors can be ordered at once to allow you to provide a standard cart experience to your users.

This is currently a 3 step process consisting of:

> If you have an existing [Order Submit API](https://www.whcc.com/developer/docs/order-submit-api/order-import/index.html.md) integration, that can be used for submitting orders by leveraging [data from the Editor API](https://www.whcc.com/developer/docs/editor-api/order-export/index.html.md)

## 1. Export Editors

For more detail on exporting editors, see the [Exporting Editors for Ordering](https://www.whcc.com/developer/docs/editor-api/order-export/index.html.md) page.

### PUT `/oas/editors/export`

Content-type: application/json

### curl

#### CURL Example Request

The only required value is a single `editorId` in the `editors` array. Any required fields for OrderImport will be intialized to `null` and will need to be provided by your integration code otherwise the order will be rejected.

```shell
curl https://prospector.dragdrop.design/api/v1/oas/editors/export \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.r3udhowqndkwqneoiqwndjwndei12u390912hrbfhaslkdjbqwiei21nbrhewiuornqwjkfhbaiwodnqwjkbdawuosdhowqubdfjkwbdusandbiwquebio12nedbwbaodpqwnebou12rbwkjalndawuobdnwqndfqwbdfoiwqndpiqwhfiwqnkjdlnwqdnioqwhniorqw3nfjwbaodnwdnqwopd" \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-d '{"editors": [{ "editorId": "sampleEditorId" }]}'
```

#### Example Response

```json
{
    "items": [
    {
        "id": "sampleEditorId",
        "pricing": {
            ...
        },
        "editor": {
            "id": "sampleEditorId",
            ...
        }
    }],
    "order": {
        "EntryId": "SampleEntryId",
        "Orders": [
            {
                ...
            }
        ]
    },
    "pricing": {
        ...
    }
}
```

## 2. Create Order

To create an order, pass the `order` object directly as the payload `/oas/orders/create`.

> The needed `order` is returned from the `/oas/editors/export` call.

For more detail on creating orders, see the [analogous documentation for the Order Submit API](https://www.whcc.com/developer/docs/order-submit-api/order-import/index.html.md).

### POST `/oas/orders/create`

Content-type: application/json

### curl

#### CURL Example Request

```shell
curl https://prospector.dragdrop.design/api/v1/oas/orders/create \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.r3udhowqndkwqneoiqwndjwndei12u390912hrbfhaslkdjbqwiei21nbrhewiuornqwjkfhbaiwodnqwjkbdawuosdhowqubdfjkwbdusandbiwquebio12nedbwbaodpqwnebou12rbwkjalndawuobdnwqndfqwbdfoiwqndpiqwhfiwqnkjdlnwqdnioqwhniorqw3nfjwbaodnwdnqwopd" \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-d '{"EntryId":"12345","Orders":[{"SequenceNumber":1,"Instructions":null,"Reference":"OrderID 12345","SendNotificationEmailAddress":null,"SendNotificationEmailToAccount":true,"ShipToAddress":{"Name":"Chris Hanline","Attn":null,"Addr1":"2840 Lone Oak Parkway","Addr2":null,"City":"Eagan","State":"MN","Zip":"55121","Country":"US","Phone":"6516468263"},"ShipFromAddress":{"Name":"Returns Department","Addr1":"3432 Denmark Ave","Addr2":"Suite 390","City":"Eagan","State":"MN","Zip":"55123","Country":"US","Phone":"8002525234"},"OrderAttributes":[{"AttributeUID":548},{"AttributeUID":553}],"OrderItems":[{"ProductUID":2,"Quantity":1,"ItemAssets":[{"ProductNodeID":10000,"AssetPath":"https://whcc-api-testing.s3.amazonaws.com/sample-images/sample-image-1.jpg","ImageHash":"a9825bb0836325e07ccfed16751b1d07","PrintedFileName":"sample-image-1.jpg","AutoRotate":true}],"ItemAttributes":[{"AttributeUID":1},{"AttributeUID":5}]}]}]}'
```

### Pro-Client Shipping Methods

The `OrderAttributes` in the request above select the order's shipping. **All new integrations are provisioned Pro-Client**, where the shipping parent `AttributeUID` is always `548`. Pair that parent with one of the shipping method `AttributeUID`s below.

The Fulfillment shipping family (parent `96`) applies only to a small number of established partners, who are set up directly with their WHCC representative. Unless WHCC has told you otherwise, your account is Pro-Client and you should use `548`.

> Do **not** use parent `96` for Pro-Client orders. `96` is the Fulfillment parent and will produce an incorrect shipping pairing. If `548` does not appear in your catalog, contact your WHCC representative to confirm your account is entitled for the Pro-Client shipping options.

| AttributeUID | Method | Transit | Limitations |
| --- | --- | --- | --- |
| 553 | USA - Drop Ship, Lowest Cost (default) | 2-8 days | PO Boxes, APO/FPO and US Territories supported. |
| 554 | USA - Drop Ship, Expedited | 3 days or less |  |
| 3304 | USA - Economy USPS | 2-8 days | No tracking. Photo and Fine Art Prints only; 10 prints or fewer, 8x12 and smaller, no mounting, no premium packaging. |
| 555 | USA - Drop Ship, Standard One-Day | 1 day | Not available to every ZIP code; upgrades automatically to Priority One-Day where unavailable. |
| 556 | USA - Drop Ship, Priority One-Day | 1 day |  |
| 557 | Canada - Drop Ship, Lowest Cost | 2-4 days | Canadian provinces only. |

International shipping outside the United States and Canada is available. Contact your WHCC representative for the applicable shipping method and rates.

### Example Response

Prices below are illustrative only. Your actual product and shipping charges depend on your account's pricing and the `OrderAttributes` you submit.

```json
{
	"Account": "10072",
	"ConfirmationID": "d4bcb9a7-caf0-4d2b-aa18-674a5d2c527e",
	"EntryID": "",
	"Key": "B431BE78D2E9FFFE3709",
	"NumberOfOrders": 1,
	"Orders": [{
		"LineItems": [],
		"Note": "",
		"Products": [{
			"Price": "0.65",
			"ProductDescription": "Print Fulfillment 5x7",
			"Quantity": 1
		}, {
			"Price": "7.95",
			"ProductDescription": "USA - Drop Ship, Lowest Cost",
			"Quantity": 1
		}],
		"SequenceNumber": "1",
		"SubTotal": "8.60",
		"Tax": "0.60",
		"Total": "9.20"
	}],
	"Received": "8/19/2018 4:34:01 PM Central Time"
}
```

> Your order will not be processed until you confirm the order using the returned `ConfirmationId`.

## 3. Confirm Order

You need to confirm each order after creating before they will be processed. For more detail on confirming orders, see the [analogous documentation for the Order Submit API](https://www.whcc.com/developer/docs/order-submit-api/order-submit/index.html.md).

> The needed `ConfirmationID` value is returned from the `/oas/orders/create` call.

### POST `/oas/orders/[ConfirmationId]/confirm`

### curl

#### Example Request

```shell
curl https://prospector.dragdrop.design/api/v1/oas/orders/a3ff9b4a-3112-4101-88ab-6ba025fd7600/confirm \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.r3udhowqndkwqneoiqwndjwndei12u390912hrbfhaslkdjbqwiei21nbrhewiuornqwjkfhbaiwodnqwjkbdawuosdhowqubdfjkwbdusandbiwquebio12nedbwbaodpqwnebou12rbwkjalndawuobdnwqndfqwbdfoiwqndpiqwhfiwqnkjdlnwqdnioqwhniorqw3nfjwbaodnwdnqwopd" \
-X POST
```

#### Example Response

```json
{
	"Confirmation": "Entry ID=a3ff9b4a-3112-4101-88ab-6ba025fd7600: Confirmed order submitted.",
	"ConfirmationID": "a3ff9b4a-3112-4101-88ab-6ba025fd7600",
	"ConfirmedOrders": 1,
	"Received": "8/19/2018 5:00:17 PM Central Time"
}
```

> ### What's Next
>
> Integrate [Webhooks](https://www.whcc.com/developer/docs/editor-api/webhooks/index.html.md) to be updated on the processing status of an order as well as possible errors.