A vendor type is a group of customers with its own prices, for example wholesale buyers. The panel side is described in Vendor types.
Seven POST endpoints under /api/webhook manage them. All need Vendor type webhook on. See the Webhooks/Pushers tab.
Everything is matched by your own ids:
| Id in the request | Matches |
|---|
vendor_type_external_id | The external_id you sent to /vendor-type-store |
item_external_id | The item_id you sent to /item-create |
customer_external_id | The external_id you sent to /user-create |
The vendor type: /vendor-type-store
| Field | Required | Meaning |
|---|
external_id | Yes | Your id for the vendor type, up to 255 characters |
name | Yes | Name, up to 255 characters |
description | No | Up to 1000 characters |
is_active | No | true or false |
Answers "Vendor type created successfully" or "Vendor type updated successfully".
Prices
/vendor-type-product-store sets one price.
| Field | Required | Meaning |
|---|
vendor_type_external_id | Yes | The vendor type |
item_external_id | Yes | The product |
price | Yes | Price for this vendor type, 0 or more |
old_price | No | Price before discount |
is_active | No | Offer the product to this vendor type |
/vendor-type-product-bulk-store takes vendor_type_external_id and a products list. Each entry has the same item_external_id, price, old_price and is_active.
The bulk answer is "Bulk vendor type products processed" with successful, errors, total_processed, successful_count and error_count. A product that is not found is listed under errors with "Item not found". The other products are still saved.
Customers
| Endpoint | Body | Effect |
|---|
/vendor-type-customer-store | vendor_type_external_id, customer_external_id | Adds one customer |
/vendor-type-customer-bulk-store | vendor_type_external_id, customers[] with customer_external_id | Adds many |
/vendor-type-customer-remove | vendor_type_external_id, customer_external_id | Removes one customer |
/vendor-type-customer-bulk-remove | vendor_type_external_id, customers[] with customer_external_id | Removes many |
A customer belongs to one vendor type at a time. To move a customer, remove them first, then add them to the new one.
Errors
| Status | Message | Cause |
|---|
| 400 | "Vendor webhook is not enabled for this shop" | Vendor type webhook is off. Turn it on and select Save Settings |
| 404 | "Vendor type not found" | No vendor type has that external_id in your shop |
| 404 | "Item not found" | No product has that external id |
| 404 | "Customer not found" | No customer of your shop has that external id |
| 409 | "Customer is already assigned to a vendor type" | The answer names the current vendor type |
| 409 | "Customer is not assigned to this vendor type" | A remove call for a customer who is in another vendor type, or in none |
| 422 | "Validation failed" | A required field is missing or has the wrong type |
In the bulk calls, a customer or product that fails is reported per entry and does not stop the rest.