Developer docs

B2B portal API

A company that buys wholesale through a supplier's SaleHero B2B portal can place orders and follow them from its own shop or ERP, and pull the supplier's catalog as a feed. This page is for that buyer. It is separate from the organization API keys: a token here belongs to one buyer account and opens one supplier only.

Access

  • Sign in to the supplier's B2B portal and open Settings, API access. Create a token and copy it: it starts with b2bk_ and is shown once.
  • Send it as Authorization: Bearer b2bk_… to https://salehero.ro/api/b2b-portal/SUPPLIER_SLUG, where SUPPLIER_SLUG is the supplier's slug from its portal address.
  • The token works only against the supplier that issued it, and only for your account; revoke it in the same place.
  • Limit: 120 requests per minute per token. Errors are { "error", "code" } with 401 for a missing or revoked token, 404 for an unknown order, 400 for invalid input, credit, stock or product problems.

Orders

GET/api/b2b-portal/{supplier}/orders

Your orders with this supplier, with the total count.

Parameters

takeinteger 1–200
Page size, default 50.
skipinteger
Rows to skip.
qstring
Text search.
statusDefIdstring
Only orders in this status.
paymentpaid | unpaid
Filter on payment.

Request

curl -s "https://salehero.ro/api/b2b-portal/SUPPLIER_SLUG/orders?take=2&payment=unpaid" \
  -H "Authorization: Bearer $B2B_TOKEN"

Response

{
  "total": 1,
  "orders": [
    {
      "id": "cm…", "number": "B2B-1042",
      "statusDef": { "id": "…", "name": "Processing" },
      "paymentMethod": "BANK_TRANSFER", "shippingMethod": "DELIVERY", "paymentReceived": false,
      "invoice": { "label": "SER #1234", "paid": false }, "awbNumber": null,
      "total": 1250.5, "currency": "RON", "lineCount": 1,
      "lines": [ { "sku": "SKU-001", "productName": "Example product", "quantity": 4 } ],
      "createdAt": "2026-11-05T10:00:00.000Z", "forwardedAt": null
    }
  ]
}
POST/api/b2b-portal/{supplier}/orders

Place an order. Pricing, stock and credit are validated on the server, the same way as in the portal's cart.

Parameters

linesarray 1–200 · required
Items: { sku, quantity }.
paymentMethodCREDIT | BANK_TRANSFER | CASH_ON_DELIVERY | PAY_ON_PICKUP | PAY_ON_TERMS · required
Which of these is allowed depends on the shipping method, see the table below.
shippingMethodPICKUP | DROPSHIP | DELIVERY
How the goods reach you. Omitted means courier delivery to your own address.
notestring, up to 2000 characters
A note for the supplier.

Request

curl -s -X POST https://salehero.ro/api/b2b-portal/SUPPLIER_SLUG/orders \
  -H "Authorization: Bearer $B2B_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [ { "sku": "SKU-001", "quantity": 4 } ],
    "paymentMethod": "BANK_TRANSFER",
    "shippingMethod": "DELIVERY",
    "note": "Deliver before Friday"
  }'

Response

{ "id": "cm…", "number": "B2B-1043", "total": 1250.5, "deliveryPrice": 25, "forwarded": true }
  • 201 on success. forwarded says whether the order already went on to the supplier's warehouse. There is no idempotency key: do not blindly retry a POST whose answer you did not get; read GET /orders first.
Shipping methodPayment methods allowed
DELIVERYCREDIT, BANK_TRANSFER, PAY_ON_TERMS, CASH_ON_DELIVERY
DROPSHIPCREDIT, BANK_TRANSFER, PAY_ON_TERMS
PICKUPCREDIT, BANK_TRANSFER, PAY_ON_TERMS, PAY_ON_PICKUP
EndpointWhat it gives
GET /orders/{id}One of your orders in full: parties, payment and invoice state, priced lines, courier label and parcel tracking. 404 not_found for an order that is not yours.
GET /orders/{id}/eventsIts status history as { events }. Staff comments and internal edits are left out.

Catalog feed link

To keep a product catalog in sync, create a feed link in the portal and point your shop or marketplace tool at it. It is a plain GET, with no header:

GET https://salehero.ro/api/feeds/FEED_SECRET
  • Up to 10 live links per account; 60 pulls per hour per link; the answer may be cached for 5 minutes.
  • A revoked link, or an account that is not approved, answers 404.
  • The link is the password: whoever has it can read the feed. Do not publish it; revoke and recreate it if it leaks.

Get an API key

Create an account, connect your tools, then create a key in Settings.