Suppliers
List Suppliers
Section titled “List Suppliers”Returns a list of suppliers configured for your account.
GET
/api/v1/suppliersQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name |
string | - | Filter suppliers by name (case-insensitive substring match). For example, name=acme matches “Acme Corp”, “ACME Supplies”, etc. |
Example Request
Section titled “Example Request”curl -X GET "https://api.prediko.io/api/v1/suppliers" \ -H "Authorization: Bearer YOUR_API_KEY"
# With name filtercurl -X GET "https://api.prediko.io/api/v1/suppliers?name=acme" \ -H "Authorization: Bearer YOUR_API_KEY"import requests
# All suppliersresponse = requests.get( "https://api.prediko.io/api/v1/suppliers", headers={"Authorization": "Bearer YOUR_API_KEY"})suppliers = response.json()
# With name filterresponse = requests.get( "https://api.prediko.io/api/v1/suppliers", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={"name": "acme"})suppliers = response.json()const response = await fetch( "https://api.prediko.io/api/v1/suppliers", { headers: { "Authorization": "Bearer YOUR_API_KEY" } });const suppliers = await response.json();
// With name filterconst filtered = await fetch( "https://api.prediko.io/api/v1/suppliers?name=acme", { headers: { "Authorization": "Bearer YOUR_API_KEY" } });const filteredSuppliers = await filtered.json();Response
Section titled “Response”{ "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Acme Corp", "emails": ["contact@acmecorp.com"], "address": { "address1": "123 Supplier St", "address2": null, "city": "Shenzhen", "province": "Guangdong", "country": "CN", "zip": "518000" }, "lead_time": 14, "currency": "USD", "minimum_order_quantity": 100, "minimum_order_type": "QUANTITY", "moqs": [ { "warehouse_name": "Main Warehouse", "minimum_order_quantity": 100, "minimum_order_type": "QUANTITY" } ], "lead_times": [ { "warehouse_name": "Main Warehouse", "lead_time": 14 } ] }, { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "name": "Global Supplies Ltd", "emails": null, "address": { "address1": "456 Trade Ave", "address2": "Building B", "city": "London", "province": null, "country": "GB", "zip": "EC1A 1BB" }, "lead_time": 21, "currency": "GBP", "minimum_order_quantity": 500, "minimum_order_type": "VALUE", "moqs": [], "lead_times": [] } ], "total": 2}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
data |
array | List of supplier objects |
total |
integer | Total number of suppliers |
Supplier Object
Section titled “Supplier Object”| Field | Type | Description |
|---|---|---|
id |
string | Unique supplier identifier (UUID) |
name |
string | Supplier name (unique identifier) |
emails |
array | Supplier contact emails (may be null if not configured in the Prediko app) |
address |
object | Address details (see Address Object below) |
lead_time |
integer | Default lead time in days |
currency |
string | Default currency for transactions |
minimum_order_quantity |
number | Default minimum order quantity |
minimum_order_type |
string | MOQ type: QUANTITY (units) or VALUE (order value) |
moqs |
array | Warehouse-specific MOQs (see MOQ Object below) |
lead_times |
array | Warehouse-specific lead times (see Lead Time Object below) |
Address Object
Section titled “Address Object”| Field | Type | Description |
|---|---|---|
address1 |
string | Primary address line |
address2 |
string | Secondary address line |
city |
string | City name |
province |
string | State/province |
country |
string | Country code |
zip |
string | Postal/ZIP code |
MOQ Object
Section titled “MOQ Object”| Field | Type | Description |
|---|---|---|
warehouse_name |
string | Warehouse name |
minimum_order_quantity |
number | Minimum order quantity for this warehouse |
minimum_order_type |
string | MOQ type: QUANTITY (units) or VALUE (order value) |
Lead Time Object
Section titled “Lead Time Object”| Field | Type | Description |
|---|---|---|
warehouse_name |
string | Warehouse name |
lead_time |
integer | Lead time in days for this warehouse |
Error Responses
Section titled “Error Responses”| Status | Description |
|---|---|
| 401 | Invalid or missing API key |
| 500 | Internal server error |
Create Supplier
Section titled “Create Supplier”Creates a supplier.
POST
/api/v1/suppliersRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Supplier name. Must be unique (case-insensitive) |
emails |
string[] | no | Contact emails |
address |
object | no | number, line1, city, zip_code, province, country (all optional) |
currency |
string | no | ISO 4217 code, e.g. USD |
lead_time |
integer | no | Default lead time in days |
minimum_order_quantity |
integer | no | MOQ |
minimum_order_type |
string | no | QUANTITY (units) or VALUE (order value) |
notes |
string | no | Free-text notes |
Example Request
Section titled “Example Request”curl -X POST "https://api.prediko.io/api/v1/suppliers" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Distribution", "emails": ["orders@acme.com"], "currency": "USD", "lead_time": 14, "minimum_order_quantity": 100, "minimum_order_type": "QUANTITY" }'Response
Section titled “Response”201 Created with the supplier object (see Supplier Object), including its id.
| Status | Description |
|---|---|
| 409 | A supplier with the same name already exists. Nothing is created |
| 422 | Invalid body (for example an unknown currency) |
To link SKUs to the new supplier, use patch.supplier_id on Update SKUs.
Update Supplier
Section titled “Update Supplier”Updates a supplier. Omitted fields are left untouched; at least one field must be supplied.
PATCH
/api/v1/suppliers/{supplier_id}The body takes the same fields as Create Supplier, all optional. address is merged field by field.
curl -X PATCH "https://api.prediko.io/api/v1/suppliers/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"lead_time": 21}'Returns the updated supplier. 404 if the supplier does not exist, 409 if the new name is taken.
