Orders API
An order is used to purchase one or more products for fulfillment. An order is created by sending an order object using a POST request to the Orders API endpoint. Product details, email address, and shipping address are included in each order.
API Key
The API Key is a secret key that is
used to access the API. Create and manage your API Keys in account
settings.
The API Key must be specified as a HTTP header or as a HTTP Request parameter (GET or POST).
APIKEY: 3F85171053542361488CF28E
https://integrations.cgproprints.com/v1/orders/12354238?apikey=3F85171053542361488CF28E
External ID
External ID is an optional
feature that allows you to link your CG Pro Prints Integrations order
with the Order ID from your system without the need to store
additional data on your side. Each order's External ID must be unique
within the store or else order creation will not be successful. To use
the External ID feature, set the external_id attribute when creating
the order.
Order Resource Endpoints
The CG Pro Prints
Integrations API lets you do the following with the Order resource.
GET/v1/orders
Retrieve a List of Orders
limit |
Limit the number of results (default: 20) (maximum: 100) |
next_result |
Start returning results at the specified order ID |
created_at_min |
Show orders created after date (format: 2012-12-31 03:00) |
created_at_max |
Show orders created before date (format: 2012-12-31 03:00) |
shipped_at_min |
Show orders shipped after date (format: 2012-12-31 03:00) |
shipped_at_max |
Show orders shipped before date (format: 2012-12-31 03:00) |
status |
|
shipping_status |
|
List All Orders:
GET https://integrations.cgproprints.com/v1/orders
HTTP/1.1 200 Success
{
"orders": [
{
"id": 12354238,
"external_id": "681",
"status": "open",
"shipping_status": "open",
"created": "2015-05-05T19:42:23",
"total_quantity": 2,
"shipping_method": 94,
"shipping_info": {
"company": "ABC Photography",
"name": "Elizabeth",
"address1": "321 Main St.",
"address2": "",
"city": "Denver",
"state": "CO",
"zip": "80123",
"country": "US",
"email": "liz@photos.com",
"phone": "555-555-1235"
},
"items": [
{
"order_id": 12354238,
"item_id": 5059870,
"product_id": 509,
"weight": 1.4,
"customer_sku": "SKU311",
"image_url": "",
"quantity": 1,
"shipped": false
"shipping_date": null,
"tracking_number": null
},
{
"order_id": 12354238,
"item_id": 5059871,
"product_id": 404,
"weight": 0.8,
"customer_sku": null,
"image_url": "https://example.com/path/to/art.jpg",
"quantity": 1,
"shipped": true,
"ship_date": "2015-05-05T19:42:23",
"tracking_number": "1Z58283419539"
}
]
}
]
}
Retrieve Order by Id
Retrieve a Single Order By CG Pro Prints Order Id
GET/v1/orders/#{order_id} { "order": { "id": 12521262, "external_id": "1407", "created": "2015-07-31T13:19:52", "total_quantity": 1, "shipping_method": 94, "shipping_info": { "company": "Thomas Aquinas", "name": "Thomas Aquinas", "address1": "123 W 3RD ST", "address2": "", "city": "LONGMONT", "state": "CO", "zip": "80501", "country": "US", "email": "", "phone": "555-555-5555" }, "status": "closed", "shipping_status": "shipped", "items": [ { "order_id": 12521262, "item_id": 5364110, "product_id": 370, "customer_sku": null, "image_url": "http://example.com/test.jpg", "quantity": 1, "shipped": true, "ship_date": "2015-07-31T14:49:26", "tracking_number": "999TRACKINGIDHERE", "carrier": "SurePost", "weight": 3 } ] } }
Retrieve a Single Order By Your Order Id
external_id |
Set to true to designate that the specified order ID is an External ID Valid values are "true" and "false." Default: false |
GET/v1/orders/#{your order id}?external_id=true { "orders": [ { "id": 12521262, "external_id": "1407", "created": "2015-07-31T13:19:52", "total_quantity": 1, "shipping_method": 94, "shipping_info": { "company": "John Kimble", "name": "John Kimble", "address1": "100 W 4RD ST", "address2": "", "city": "LONGMONT", "state": "CO", "zip": "80501", "country": "US", "email": "", "phone": "555-555-5555" }, "status": "closed", "shipping_status": "shipped", "items": [ { "order_id": 12521262, "item_id": 5364110, "product_id": 370, "customer_sku": null, "image_url": "http://example.com/test.jpg", "quantity": 1, "shipped": true, "ship_date": "2015-07-31T14:49:26", "tracking_number": "999TRACKINGINTEGTEST", "carrier": "SurePost", "weight": 3 } ] } ], "next_result": false }
Create An Order
order |
Specify the order object in the HTTP request body |
Create a New Order Using an External Image URL
The Image URL is an absolute URL where the print-ready image is hosted. This URL must be accessible by the CG Pro Prints Integrations order processing servers.
Use an empty string "" for ship_method to use default ship method.
Specify what the return address on the shipping label should be using the "return_address" object. If the return_address object is empty the default address will be from our factory.
POST https://integrations.cgproprints.com/v1/orders/ { "order": { "shipping_method": 94, "shipping_info": { "company": "Marketing Solutions", "name": "William Smith", "address1": "55 Fifth St.", "address2": "Apt 403", "city": "Denver", "state": "CO", "zip": "80123", "country": "US", "email": "will@marketing.com", "phone": "555-555-6666" }, "return_address": { "company": "ACME TEST", "name": "Wiley Coyote", "address1": "123 Main St.", "address2": "Apt 403", "city": "Beverly Hills", "state": "CA", "zip": "90210", "phone": "555-555-5555" }, "items": [ { "image_url": "https://example.com/path/to/art.jpg", "product_id": 509, "quantity": 1 } ] } } HTTP/1.1 201 Created { "id": 12325524, "order": { "id": 12325524, "status": "open", "shipping_status": "open", "created": "2015-05-15T10:07:22", "total_quantity": 1, "shipping_method": 94, "shipping_info": { "company": "Marketing Solutions", "name": "William Smith", "address1": "55 Fifth St.", "address2": "Apt 403", "city": "Denver", "state": "CO", "zip": "80123", "country": "US", "email": "will@marketing.com", "phone": "555-555-6666" }, "return_address": { "company": "ACME TEST", "name": "Wiley Coyote", "address1": "123 Main St.", "address2": "Apt 403", "city": "Beverly Hills", "state": "CA", "zip": "90210", "phone": "555-555-5555" }, "items": [ { "order_id": 12325524, "item_id": 5053261, "product_id": 509, "customer_sku": null, "image_url": "https://example.com/path/to/art.jpg", "quantity": 1, "shipped": false, "ship_date": null, "tracking_number": null, "carrier": null, "weight": null } ] } }
Create a New Order Using an image from your Image Library
The print_id is the id shown in your library image. This print_id must be from your own library. Use the Mock Generator to generate library images.
If a print_id is used then you do not need to provide a product_id, customer_sku, or image_url.
In the example below we specify what the return address on the shipping label should be using the "return_address" object. If the return_address object is empty the default address will be from our factory.
POST https://integrations.cgproprints.com/v1/orders/ { "order": { "shipping_method": 94, "shipping_info": { "company": "Marketing Solutions", "name": "William Smith", "address1": "55 Fifth St.", "address2": "Apt 403", "city": "Denver", "state": "CO", "zip": "80123", "country": "US", "email": "will@marketing.com", "phone": "555-555-6666" }, "return_address": { "company": "ACME TEST", "name": "Wiley Coyote", "address1": "123 Main St.", "address2": "Apt 403", "city": "Beverly Hills", "state": "CA", "zip": "90210", "phone": "555-555-5555" }, "items": [ { "print_id": "14EA0DF6-9655-5956-934B-7589A05A9394" "quantity": 1 } ] } } HTTP/1.1 201 Created { "id": 12325524, "order": { "id": 12325524, "status": "open", "shipping_status": "open", "created": "2015-05-15T10:07:22", "total_quantity": 1, "shipping_method": 94, "shipping_info": { "company": "Marketing Solutions", "name": "William Smith", "address1": "55 Fifth St.", "address2": "Apt 403", "city": "Denver", "state": "CO", "zip": "80123", "country": "US", "email": "will@marketing.com", "phone": "555-555-6666" }, "return_address": { "company": "ACME TEST", "name": "Wiley Coyote", "address1": "123 Main St.", "address2": "Apt 403", "city": "Beverly Hills", "state": "CA", "zip": "90210", "phone": "555-555-5555" }, "items": [ { "order_id": 12325524, "item_id": 5053261, "product_id": 509, "customer_sku": null, "print_id": "14EA0DF6-9655-5956-934B-7589A05A9394", "image_url": null, "quantity": 1, "shipped": false, "ship_date": null, "tracking_number": null, "carrier": null, "weight": null } ] } }
Create a New Order Using a Customer SKU
The Customer SKU option is only valid for customers who have an image library hosted by Circle Graphics. Please contact us for information on hosting your image file library.
Use an empty string "" for ship_method to use default ship method.
POST https://integrations.cgproprints.com/v1/orders/
{
"order": {
"external_id": "ABC123",
"shipping_method": 94,
"shipping_info": {
"company": "Marketing Solutions",
"name": "William Smith",
"address1": "55 Fifth St.",
"address2": "Apt 403",
"city": "Denver",
"state": "CO",
"zip": "80123",
"country": "US",
"email": "will@marketing.com",
"phone": "555-555-6666"
},
"items": [
{
"customer_sku": "CG1234",
"quantity": 1
}
]
}
}
HTTP/1.1 201 Created
{
"id": 12325524,
"order": {
"id": 12325524,
"external_id": "ABC123",
"status": "open",
"shipping_status": "open",
"created": "2015-05-15T10:07:22",
"total_quantity": 1,
"shipping_method": 94,
"shipping_info": {
"company": "Marketing Solutions",
"name": "William Smith",
"address1": "55 Fifth St.",
"address2": "Apt 403",
"city": "Denver",
"state": "CO",
"zip": "80123",
"country": "US",
"email": "will@marketing.com",
"phone": "555-555-6666"
},
"items": [
{
"order_id": 12325524,
"item_id": 5053261,
"product_id": null,
"customer_sku": "CG1234",
"image_url": null,
"quantity": 1,
"shipped": false,
"ship_date": null,
"tracking_number": null,
"carrier": null,
"weight": null
}
]
}
}
JSONP
You may request data using JSONP by
specifying a callback method with the "_jsonp" request parameter.
Pretty Print
Format JSON output for easier
reading by specifying the "prettyprint" request parameter.
Products
Get All Products
GET https://integrations.cgproprints.com/v1/products { "products": [ { "terms": [ 12 ], "product_id": "365", "price": "9.99", "name": "5"x7"x0.5" Premium Canvas Gallery Wrap", "shipping_methods": { ...
List All Orders:
Get Single Product
GET /products/370 { "product": { "terms": [ 12 ], "product_id": "370", "price": "31.99", "name ": "16"x24"x1.25" Premium Canvas Gallery Wrap", "shipping_methods": { "60": "14.72", "62": "23.23", "80": "35.08", "94": "11.08", "99": "25.47" }, "shipping_default": 94, "weight": "5.26", "product_types": [], "live_width": "16", "live_length": "24", "depth": "1.25", "bleed": "0.25", "overall_image_width": "19", "overall_image_length": "27", "minimum_resolution": "150" } }
List All Orders:
Get Product Types
/product/types
{
"10": "Fine Art Print",
"12": "Premium Canvas Gallery Wrap",
"13": "Framed Premium Canvas Gallery Wrap",
"14": "Rolled Canvas Poster",
"15": "Cling",
"16": "Gallery Mini",
"17": "Holiday Memento Ornament"
}