Repository navigation
Provider API
Besides answering webhooks, your service can call Selldone to read connected shops, products and orders, or to push stock updates. Using the APIs is optional and depends on your service. The sample panel's APIs page is a small tester for these calls.
Calls to the provider API use the secret key from Selldone > Your provider > APIs (SD_PROVIDER_SECRET_KEY). The sample front end sets it as a default header for every request:
// resources/js/app.js
window.axios.defaults.headers.common["Authorization"] = "Basic " + window.SD_CONFIG.secret_key;The base URL comes from SD_PROVIDER_API (config('selldone.provider-api')), exposed to the page as SD_CONFIG.service_url.
Warning
The sample passes the secret key to the browser so you can experiment. In a real bridge, call the provider API from your server only and never expose the secret key.
These endpoints are defined in resources/js/pages/APIs.vue. Paths are relative to SD_PROVIDER_API.
| Method | Path | Sample params | Description |
|---|---|---|---|
GET |
/shops |
offset=0, limit=10
|
Get the list of connected shops. |
GET |
/shops/{shop_id}/products |
offset=0, limit=10
|
Get the list of connected products in a specific shop. |
GET |
/shops/{shop_id}/orders |
offset=0, limit=10
|
Get the list of fulfillments in a specific shop. |
POST |
/products/{mpn} |
{ "quantity": 12 } |
Update the product in all shops by MPN. |
POST |
/variants/{mpn} |
{ "quantity": 12 } |
Update the product variant in all shops by MPN. |
GET |
/shops/token |
access_token=<token> |
Get shop info by its access token. The access token must be unique for each shop; its structure depends on the provider's auth mode. |
The tester defaults to shop_id = 1 and mpn = 1001, and shows the request headers and JSON response.
For the full and current list of endpoints and fields, see the Selldone API documentation.
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Authorization' => 'Basic ' . config('selldone.provider-secret-key'),
])
->get(config('selldone.provider-api') . '/shops', ['offset' => 0, 'limit' => 10]);
$shops = $response->json();The same pattern applies to the other endpoints, for example Http::withHeaders([...])->post($base . "/products/$mpn", ['quantity' => 5]) to update stock after a sale on another channel.