Pull a shop's catalogue
const url = 'https://example.com/shops/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/pull';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"settings":{"importImages":true,"importDescriptions":true,"importCylinderCharges":true,"suggestGasTypes":true,"reviewGasTypes":true},"externalIds":["example"],"previewHash":"example","links":[{"externalId":"example","productId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/shops/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/pull \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "settings": { "importImages": true, "importDescriptions": true, "importCylinderCharges": true, "suggestGasTypes": true, "reviewGasTypes": true }, "externalIds": [ "example" ], "previewHash": "example", "links": [ { "externalId": "example", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ] }'Creates what is new and updates what is already here, matched on the shop’s own id. Prices are taken for products this is the first sight of, and left alone afterwards: Bottle holds the rates agreed with particular customers and the shop knows nothing about them. Each price is kept exactly as the shop quotes it, flagged as including VAT or not: by the shop’s own setting, by the business’s pricesIncludeVat when the shop will not say, or by the priceBasis set on this connection. The response says which. Pictures come in through the same pipeline as uploaded ones. Each description comes in with its formatting (the long description, else the short one), sanitised, and replaces the one here only while nobody has changed that in Bottle since the last pull; descriptionsKept lists the products where the shop’s newer words were not taken. Listings sent in links are tied to a product already in Bottle instead of being added, and change nothing on it. When another shop is the main shop and also sells a product, this shop’s pull keeps its listing linked and leaves the product’s name, description, pictures, weight and maker to the main shop.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Body
Section titled “Request Body”object
object
object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fResponses
Section titled “Responses”What the pull did
object
object
UUID v7
Shop: read the shop’s own setting (WooCommerce prices include tax, Shopify taxes included), and the business’s pricesIncludeVat when it will not say. inc: every price from this shop includes VAT. ex: none of them do.
object
Setup_required: order feed still needs authenticating; receiving: it has received or reconciled orders; error: the latest attempt failed; off: automatic order import is switched off.
object
object
UUID v7
Example
{ "shop": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "source": "woocommerce", "name": "Main shop", "customerName": "Thameside Trade Gas", "url": "https://acmegas.co.uk", "priceBasis": "shop", "orderSyncStatus": "setup_required" }, "skipped": [ { "reason": "external" } ], "productIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "priceBasisUsed": "shop", "picturesFailed": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "descriptionsKept": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "descriptionsTooLong": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not allowed to manage shops, or asking for a key to do it
object
Example
{ "error": "not_found", "message": "Customer not found"}No such shop
object
Example
{ "error": "not_found", "message": "Customer not found"}The catalogue changed after preview; review it again
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}The shop could not be reached, or refused the credentials
object
Example
{ "error": "not_found", "message": "Customer not found"}