Order Search

Orders submitted to Spectrum can be queried for their details and status.

Note about Partners

If you work with Partners and need this functionality to limit what a client sees when calling either of the methods below, then you need to be sure that each of your Partners are issued a unique API Key and that API Key is associated with their Partner registration in the Spectrum System. Your Spectrum customer representitive will be able to help you get this set up.

Single Purchase Order

To query for a single purchase order within Spectrum, use the following API:

GET https://{SpectrumEnvironment}/api/order/order-number/{PurchaseOrderNumber} HTTP/1.1
SPECTRUM_API_TOKEN: {SpectrumApiToken}

The available {SpectrumEnvironment} base URLs are listed in the Environments page.

See example response below.

Multiple Purchase Orders

To query for multiple purchase orders within Spectrum, use the following API to search for orders with line items of a defined status. By default, only 31 days of orders are able to be search at one time. This can be overridden by the ignoreDateRetriction parameter, but should only be used when the client will wait for a response beyond normal timeout ranges.

POST https://{SpectrumEnvironment}/api/orders/search HTTP/1.1
SPECTRUM_API_TOKEN: {SpectrumApiToken}
Content-Type: application/json

POST https://{SpectrumEnvironment}/api/orders/search

Search for orders within a time range with defined statuses. Note: a Spectrum API Key must be sent via the header to enable this API call.

Headers

NameTypeDescription

SPECTRUM_API_TOKEN*

String

{SpectrumApiToken}

Content-Type*

String

application/json

Request Body

NameTypeDescription

*

JSON

JSON payload (see below example)

{
    // Response
}

Required

  • lastModificationStartDate (ISO 8601 date string)

  • workflowStatuses (array of Workflow Status strings)

Optional

  • lastModificationEndDate (ISO 8601 date string default: current DateTime)

  • ignoreDateRestriction (Boolean, default: false): set to true when searching over 1 month of orders. Note: API response may take more than 30 seconds to return.

Workflow Statuses

  • not-started

  • in-progress

  • completed

  • revision

  • on-hold

  • approved

  • delivered

  • cancelled

Example request body

The call below will return all orders that have line items with a workflow status of "in-progress" or "completed" within the defined dates.

{
    "lastModificationStartDate": "2022-01-31T00:00:00.00000-00:00",
    "lastModificationEndDate": "2022-02-02T00:00:00.00000-00:00",
    "workflowStatuses": ["in-progress", "completed"]
}

See example response below.

Order Search Response Example

For a single purchase order search, up to one order is returned. For multiple purchase order search, an array of matching orders would be returned.

{
	"clientHandle": "spectrum",
	"purchaseOrderNumber": "SP-US02141505",
	"orderDateTime": "2022-01-31T13:15:05.2151663-05:00"",
	"locale": "en-US",
	"orderType": "self",
	"orderStatus": "completed",
 	"emailAddress": "john.smith@acme.com",
	"phoneNumber": "1015551212",
	"lineItems": [{
		"recipeSetId": "W7WU2TWC",
		"giftMessage": "",
		"workflowStatus": "in-progress",
		"isReorder": false,
		"lastModification": "2021-05-01T13:31:21.057",
		"shipmentTracking": "1Z9R62E60219095885",
	        "serialNumbers": ["BR7MWPKFZP76NK8U"],
		"unitPrice": 25.00,
		"skuQuantities": [{
			"sku": "T-Shirt",
			"quantity": 1
		}]
	}],
	"customerAddress": {
		"firstName": "John",
		"lastName": "Smith",
		"address1": "123 Fake Street",
		"address2": "",
		"city": "Portland",
		"state": "OR",
		"province": "",
		"postalCode": "97205",
		"country": "US"
	},
	"shippingAddress": {
		"firstName": "John",
		"lastName": "Smith",
		"address1": "123 Fake Street",
		"address2": "",
		"city": "Portland",
		"state": "OR",
		"province": "",
		"postalCode": "97205",
		"country": "US"
	}
}

Last updated