Why these endpoints matter
Creating a B2B order does not take an address. It takes a reference:Get all resolves the ids you already have, Create in bulk registers the ones you do not.
Ids are yours or ours
Both a business and a location accept anexternal_id — your own identifier. When you provide one, it is what the API returns and what you use when creating orders, so you never have to store a Melonn id on your side. When you do not, the responses fall back to Melonn’s internal id and you use that instead.
One active location at a time
A business can accumulate several delivery locations over time — an address changes, a branch closes — while only one is current. Each location reportsactive so you can tell which one to send orders to. Use it rather than assuming the first or the most recent entry is the right one.
Endpoints
-
Get all— every business registered for you, each with its delivery locations. The response is not truncated, regardless of how many you have. Filter byemailwhen you are looking for a specific one. -
Create in bulk— register several businesses in one request, each with its delivery locations. Beyond contact details it takeslogo_url(must resolve to a.jpg,.jpegor.png; the image is fetched and stored on our side) andbusiness_vas(ids of value-added services to associate — these are validated, so an unknown id fails the request).