Catalog
Your catalog is the Shopify store or product feed you connected in your Bench, under Branding. The API reads your products from it when you ask and keeps no copy of your photos: each product links to your store's own photo. The call takes your secret API key alone, with no customer token, since the catalog belongs to your store. A customer can then start a design from a product.
List products
Returns one page of your catalog, up to 24 products, best match first. Products with no photo are left out. A Shopify catalog shows only the collection and filters you chose when you connected it.
https://api.diamra.com/v1/catalog/productsThe parameters go in the query string. All are optional.
curl https://api.diamra.com/v1/catalog/products \ -H "Authorization: Bearer $DIAMRA_API_KEY"HTTP/2 200content-type: application/jsonrequest-id: req_9a4f1c7e03b85d26{ "object": "list", "url": "/v1/catalog/products", "has_more": true, "next_page": "eyJsYXN0X2lkIjo4MTIzNDU2Nzg5MDE0fQ", "filters": [ { "label": "Product type", "primary": true, "values": [ { "id": "eyJwcm9kdWN0VHlwZSI6IlJpbmdzIn0", "label": "Rings" }, { "id": "eyJwcm9kdWN0VHlwZSI6IkVhcnJpbmdzIn0", "label": "Earrings" }, { "id": "eyJwcm9kdWN0VHlwZSI6IlBlbmRhbnRzIn0", "label": "Pendants" } ] } ], "data": [ { "object": "catalog_product", "id": "8123456789012", "title": "Oval Halo Engagement Ring", "code": null, "image_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/oval-halo.jpg?width=1600", "thumbnail_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/oval-halo.jpg?width=800" }, { "object": "catalog_product", "id": "8123456789013", "title": "Hidden Halo Solitaire", "code": null, "image_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/hidden-halo.jpg?width=1600", "thumbnail_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/hidden-halo.jpg?width=800" }, { "object": "catalog_product", "id": "8123456789014", "title": "Emerald Drop Earrings", "code": null, "image_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/emerald-drops.jpg?width=1600", "thumbnail_url": "https://cdn.shopify.com/s/files/1/0612/3458/9001/files/emerald-drops.jpg?width=800" } ]}To narrow the list, send words, one or more filter values, or both:
curl -G https://api.diamra.com/v1/catalog/products \ -H "Authorization: Bearer $DIAMRA_API_KEY" \ -d search=oval \ -d filter=eyJwcm9kdWN0VHlwZSI6IlJpbmdzIn0A product feed is read about once every six hours, so a new product can take that long to show. A Shopify catalog shows changes at once.
Start a design from a product
Send the product in reference_images when you create a design, as { "catalog_product": { "id": "..." } }. Diamra looks the product up in your catalog and the design follows its photo. Nothing is copied. A product and the customer's own images can go in the same list, up to ten in all.
curl https://api.diamra.com/v1/designs \ -H "Authorization: Bearer $DIAMRA_API_KEY" \ -H "Diamra-Customer-Token: $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "prompt": "The same ring with a pear diamond", "reference_images": [ { "catalog_product": { "id": "8123456789012" } } ] }'Limits
Up to 120 calls a minute to List products for your store. Past that, the call answers a 429 rate_limit, with Retry-After: 60.
Errors
HTTP/2 404content-type: application/jsonrequest-id: req_5e2c8b1d74a09f36{ "error": { "type": "invalid_request_error", "code": "catalog_not_connected", "message": "Your store has no catalog connected. Connect one in your Bench, under Branding." }}