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:

  1. Export Editors
  2. Create Order
  3. Confirm Order

If you have an existing Order Submit API integration, that can be used for submitting orders by leveraging data from the Editor API

1. Export Editors

For more detail on exporting editors, see the Exporting Editors for Ordering 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.

1
2
3
4
5
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
    "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.

POST /oas/orders/create

Content-type: application/json

curl

CURL Example Request
1
2
3
4
5
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":96},{"AttributeUID":545}],"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}]}]}]}'

Example Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
	"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": "3.48",
			"ProductDescription": "Fulfillment Shipping - Economy",
			"Quantity": 1
		}],
		"SequenceNumber": "1",
		"SubTotal": "4.13",
		"Tax": "0.29",
		"Total": "4.42"
	}],
	"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.

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

POST /oas/orders/[ConfirmationId]/confirm

curl

Example Request
1
2
3
curl https://prospector.dragdrop.design/api/v1/oas/orders/a3ff9b4a-3112-4101-88ab-6ba025fd7600/confirm \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.r3udhowqndkwqneoiqwndjwndei12u390912hrbfhaslkdjbqwiei21nbrhewiuornqwjkfhbaiwodnqwjkbdawuosdhowqubdfjkwbdusandbiwquebio12nedbwbaodpqwnebou12rbwkjalndawuobdnwqndfqwbdfoiwqndpiqwhfiwqnkjdlnwqdnioqwhniorqw3nfjwbaodnwdnqwopd" \
-X POST
Example Response
1
2
3
4
5
6
{
	"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 to be updated on the processing status of an order as well as possible errors.

Back to Top 👆
Get in Touch

Interested in integrating with WHCC? Tell us more about what you’re looking for and we’ll be in touch.