Skip to main content

Sync Products

Push your product information to OpenSolar so that customers can view & order your products on our platform.


Authentication​

Requests must include a bearer token in the HTTP Authorization header.


Endpoint​

MethodEndpointDescription
GET/api/orgs/:org_id/productsRetrieve list of synced products
POST/api/orgs/:org_id/productsSync (upload) products
PATCH/api/orgs/:org_id/productsEdit existing product details, pricing and stock information
  • :org_id — your OpenSolar Organization ID

GET Products Request​

Request Body​

No request body is required.

curl -X GET 'http://api.opensolar.com/api/orgs/<ORG_ID>/products/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE'

Optional Query Parameters​

  • page - The page number to retrieve (default: 1)
  • limit - The number of products to return per page (default: 20)

Example Request with Query Parameters​

curl -X GET 'http://api.opensolar.com/api/orgs/<ORG_ID>/products/?page=2&limit=10' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE'

Explanation:

  • page=2 - returns the second page of results
  • limit=10 - returns up to 10 products per page

Response​

{
"products": [
{
"product_code": "12345",
"title": "Product Title",
"description": "Product Description",
"product_type": "other",
"product_image_url": "http://product_url.com",
"price": 99.99,
"currency_code": "GBP",
"manufacturer": "Manufacturer Name",
"stock_level": 10,
"price_tiers": {
"price_tier_1": 89.99,
"price_tier_2": 79.99
},
"location_stock_levels": {
"nottingham_warehouse": 5,
"london_warehouse": 3
},
"discounts": {
"value": 49.99,
"type": "discount_price",
"starts_at": "01/03/2026",
"ends_at": "31/03/2026"
}
}
]
}

Sync Products Request​

The body of your POST and PATCH request must include the following schema:

Request Body​

{
"products": [
{
"product_code": "12345",
"title": "Product Title",
"description": "Product Description",
"product_image_url": "http://product_url.com",
"price": 99.99,
"currency_code": "GBP",
"manufacturer": "Manufacturer Name",
"stock_level": 10,
"price_tiers": {
"price_tier_1": 89.99,
"price_tier_2": 79.99
},
"location_stock_levels": {
"nottingham_warehouse": 5,
"london_warehouse": 3
}
}
]
}

When syncing products, be sure to include all products you wish to show on the OpenSolar platform in every sync. If any products previously synced are not in subsequent syncs, they will be removed from the platform.

In order to remove products, simply exclude them from the request body.

Note: All prices, including price and price_tiers, must be exclusive of sales tax. When defining location_stock_levels, ensure that the total quantity across all locations does not exceed the global stock_level.


API Responses​

200 — All Products Synced Successfully​

All the products included in the payload were successfully synced.

{
"message": "Successfully synced all products",
"data": {
"updated_products": {
"total": 2,
"skus": [
"JAM54S31-405/MR",
"DM450M10RT-B54HBT"
]
},
"unchanged_products": {
"total": 3,
"skus": [
"SR125",
"MC122WG",
"AIKO-A465-MAH54Mb"
]
},
"failed_products": {
"total": 0,
"skus": []
}
}
}

206 — Partial Success​

Some of your products could not be synced to OpenSolar.

This occurs when some of your product SKUs (product_code) do not exist on the OpenSolar platform.

If you have any SKUs that are not represented in the OpenSolar product database, please share the product details with your account manager and product manager.

{
"message": "Partial sync failure: The following SKUs could not be synced",
"data": {
"updated_products": {
"total": 2,
"skus": [
"JAM54S31-405/MR",
"DM450M10RT-B54HBT"
]
},
"unchanged_products": {
"total": 3,
"skus": [
"SR125",
"MC122WG",
"AIKO-A465-MAH54Mb"
]
},
"failed_products": {
"total": 1,
"skus": [
"SDM120D",
]
}
}
}

400 — Complete Failure (All Products Failed)​

None were synced to OpenSolar. This occurs when the product SKUs (product_code) do not exist on the OpenSolar platform. If none of your SKUs are represented in the OpenSolar product database, please share the product details with your account manager and product manager.

{
"message": "Complete sync failure: The following SKUs could not be synced",
"data": {
"updated_products": {
"total": 0,
"skus": []
},
"unchanged_products": {
"total": 0,
"skus": []
},
"failed_products": {
"total": 5,
"skus": [
"FFR5-560B",
"5014701001",
"F-BEC",
"EP3-10YR",
"SPH3600TL BL-UP"
]
}
}
}

400 — Bad Request (Validation Errors)​

Example 1: Invalid Field Value​

{
"products": [
{
"title": [
"This field may not be null."
]
}
]
}

Example 2: Invalid Price Value​

{
"products": [
{
"price": [
"Ensure that there are no more than 2 decimal places."
]
}
]
}

Example 3: Invalid Price Tier Reference​

{
"products": {
"price_tiers": [
"Invalid price tier: wrong_tier"
]
}
}

Example 4: Invalid Stock Location Reference​

{
"products": {
"location_stock_levels": [
"Invalid location stock level: manchester"
]
}
}

Example 5: Invalid Discount Type​

{
"products": {
"discounts": {
"type": [
"\"wrong_discount\" is not a valid choice."
]
}
}
}

Example: Successful Product Sync​

Request​

curl -X POST "https://api.opensolar.com/api/orgs/<ORG_ID>/products" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data '{
"products": [
{
"product_code": "11353",
"title": "450W HALF-CUT MONO SOLAR PANEL 36V (D:2094*1038*35mm)",
"description": "High Power Output: Generates an impressive power output of 450W...",
"product_image_url": "https://staging-os.com/media/catalog/product/1/1/11353-p1.jpg",
"price": 10.00,
"currency_code": "GBP",
"manufacturer": "ZHEJIANG AUSTA GREEN ENERGY TE",
"stock_level": 10,
"price_tiers": {
"price_tier_1": 5.99,
"price_tier_2": 4.99
},
"location_stock_levels": {
"nottingham_warehouse": 5,
"london_warehouse": 3
}
}
]
}'

Response​

{
"message": "Successfully synced all products",
"data": {
"updated_products": {
"total": 1,
"skus": [
"11353"
]
},
"unchanged_products": {
"total": 0,
"skus": []
},
"failed_products": {
"total": 0,
"skus": []
}
}
}