Products
Products are the foundation of items in SourceOrders. Products list required attributes for adding an item when creating new orders, adding new items to an existing order, or updating an item's associated product. Required attributes examples include art link, url, encoding, or variant. On this page, we'll look at how to retrieve and use product information for your orders and items.
The product model
The product model contains all the information about a product, including required attributes, the product's name and description.
Properties
- Name
merchantId- Type
- string
- Description
Unique identifier for the merchant. The merchantId will always begin with
som.
- Name
productName- Type
- string
- Description
Short, descriptive name for the product.
- Name
requiredAttributes- Type
- object[]
- Description
An array of Objects for a product. If required attributes exist for a product, each Object contains keys "name" and "valueType". These attributes are required when trying to add or update items to a new or existing order. Eg. quantity, encoding, art links, etc.
- Name
skuCode- Type
- string
- Description
Unique identifier for the product. The skuCode will always begin with
sop.
Get a product
This endpoint allows you to retrieve a product from a skuCode. The response includes requiredAttributes, an array of Objects or an empty array if none exist, all of which must be present when adding this product as an item.
Request
curl -G https://api.sourceorders.com/v1/products/sop_0123456789 \
-H "Content-Type: application/json" \
-H "X-API-KEY: {API KEY}" \
Response
{
"merchantId": "som_0123456789",
"productName": "Promotional NFC Display - 8.5 x 11",
"requiredAttributes": [
{
"name": "link",
"valueType": "string"
},
{
. . .
}
],
"skuCode": "sop_0123456789"
}
Get all products
This endpoint allows you to retrieve all products for your merchantId. The response includes an array of products, each with requiredAttributes, an array of Objects or an empty array if none exist, all of which must be present when adding this product as an item.
Request
curl -G https://api.sourceorders.com/v1/products \
-H "Content-Type: application/json" \
-H "X-API-KEY: {API KEY}" \
Response
[
{
"merchantId": "som_0123456789",
"productName": "Promotional NFC Display - 8.5 x 11",
"requiredAttributes": [
{
"name": "link",
"valueType": "string"
},
{
. . .
}
],
"skuCode": "sop_0123456789"
},
{
. . .
}
]