Using the B2B Purchasing API (buyer catalog, prices and quotes)
The B2B Purchasing API (/api/v1/b2b/suppliers) lets a buyer search the catalogs of the suppliers it is a client of on ReceiptRoller B2B EC. The prices it returns are the ones that apply to your business account: your own prices, rate-based prices and volume prices. A quote tells you what a quantity would cost and whether it can be ordered. It is meant for purchasing systems and ordering apps that read a supplier's catalog.
Prerequisites
- The scope
b2b.catalog.read(OAuth Scopes Reference and Availability). - The business account you connect (the buyer) is registered as a client of the supplier and has accepted the invitation.
- The supplier's B2B EC store is live. Product and quote calls are refused while the store is still being prepared.
- Base URL:
https://receiptroller.io
Who the buyer is
- The buyer is the business account the token was issued for: the account chosen when the app was authorized.
- On every call the server checks that this account is an active client of the supplier and that the store is taking orders.
- This API is for buyers. Seller scopes such as
store.products.readcannot call it, andb2b.catalog.readcannot call the seller's Products API. - With a user token that is not bound to a business account, name the buyer with
buyerOrganizationId. If the user is not a member of that account, the call returns403.
Registering the app, and plans
An app whose only requested scope is b2b.catalog.read can be authorized whatever plan the buyer's business account is on, because B2B EC is paid for on the supplier's plan. An app that also requests other scopes, such as store.*, still needs the connecting account to be on a plan that includes the developer API. We recommend registering a separate app for buyer integrations (Create a new app).
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/b2b/suppliers | The suppliers you are a client of, with their B2B EC stores |
| GET | /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/products | Search the products you may order, with your prices |
| GET | /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/products/{productId} | Product detail, variant prices and volume prices |
| POST | /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/quote | Price quantities and check they can be ordered |
All four need b2b.catalog.read. Every call only reads: nothing reserves stock or places an order.
List your suppliers and their stores
GET /api/v1/b2b/suppliers
Authorization: Bearer {access_token}
{
"count": 1,
"suppliers": [
{
"sellerOrganizationId": "2732635b-...",
"sellerName": "Sample Trading Co.",
"isActive": true,
"stores": [
{ "storeId": "sIE2QNA0...", "storeName": "Sample Trading Wholesale", "isOpen": true, "state": "Live" }
]
}
]
}
- A supplier with
isActive: falsehas stopped trading with you. - A store with
isOpen: falseis not taking orders.statesays why:Preparing(being prepared),Off(not using B2B EC),Suspended, orLivewhen the supplier's plan no longer includes B2B EC. - A supplier whose invitation you have not accepted yet is not listed.
Search products
GET /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/products?sku=POCHITTO-TEST-001
| Parameter | Meaning |
|---|---|
search | Keywords, matched against the product name, description, brand, category, SKU, JAN, model number and variant SKUs. Specification fields such as size and material are not searched. |
sku | An exact SKU. A variant's SKU returns its parent product. When given, search, category and brand are not used. |
category / brand | Exact-match filters. |
page / pageSize | Page number from 1, and items per page (50 by default, at most 100). |
Only products the supplier has published and that are in your catalog are returned. Drafts, unpublished products and products left out of your client catalog never appear.
{
"page": 1,
"pageSize": 50,
"totalCount": 1,
"items": [
{
"productId": "24bb16be-...",
"productName": "Test product",
"sku": "POCHITTO-TEST-001",
"janCode": "",
"category": "Food",
"brand": "",
"unit": "piece",
"imageUrl": "https://...",
"hasVariants": false,
"unitPrice": 100,
"unitPriceIncludingTax": 110,
"taxRate": 0.10,
"currency": "JPY",
"priceSource": "store",
"minimumQuantity": 1,
"quantityStep": 1,
"orderByCase": false,
"casePackSize": "",
"stockPolicy": "limited",
"availability": "in_stock",
"detail": null
}
]
}
| Field | Meaning |
|---|---|
unitPrice | Your price for one, before tax, in yen. null for a product with variants; each variant's price is on the product detail. |
unitPriceIncludingTax | A guide price with tax, rounded to the yen. An order totals tax per rate and rounds once, so treat the quote's tax as the figure. |
priceSource | contract: you have your own price or rate for the product. store: the store's regular price. |
minimumQuantity | The first quantity you can order: the minimum order quantity, rounded up to whole cases. |
quantityStep | Quantities must be a multiple of this: the case size for products sold by the case, otherwise 1. |
stockPolicy | untracked: stock is not checked. limited: while stock lasts. backorder: can be ordered without stock and ships when it arrives. |
availability | in_stock, low, backorder or out_of_stock (cannot be ordered). null when stock is not tracked. |
Get a product's detail
GET /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/products/{productId}
The same fields as the search, plus detail:
- Description, image list, model number, series, color, size, weight, content volume, material, specification, country of origin, lead time, storage requirements and certifications
volumeTiers: volume prices. For example{"minQuantity": 12, "unitPrice": 450}means 450 yen each from 12. Rate-based tiers are returned in yen too.variants: each variant'svariantId, SKU, JAN, label, attributes, image and your price
A product outside your catalog answers exactly like one that does not exist: 404 with product_not_found.
Quote prices and check an order can be filled
A quote prices lines with the same calculation checkout uses: volume prices by the line's quantity, and rates against the variant's price. It reserves nothing and places no order.
POST /api/v1/b2b/suppliers/{sellerOrganizationId}/stores/{storeId}/quote
Content-Type: application/json
{ "items": [ { "productId": "24bb16be-...", "quantity": 11 } ] }
{
"lines": [
{
"productId": "24bb16be-...",
"variantId": null,
"quantity": 11,
"orderable": false,
"refusal": { "code": "insufficient_stock", "message": "..." },
"productName": "Test product",
"sku": "POCHITTO-TEST-001",
"unitPrice": 100,
"amount": 1100,
"taxRate": 0.10,
"minimumQuantity": 1,
"quantityStep": 1,
"availability": "in_stock"
}
],
"orderable": false,
"subtotal": 0,
"tax": 0,
"total": 0,
"currency": "JPY"
}
- A product with variants needs
variantId. - At most 100 lines per call.
subtotal,taxandtotalcover only the lines that can be ordered. Shipping is not included.- Lines for the same product, different variants included, count together when stock is checked.
Values of refusal.code for a line that cannot be ordered:
| Code | Meaning |
|---|---|
product_not_available | The product does not exist or is not published |
not_in_catalog | The product is not in your catalog |
variant_not_available | No variant was given, or the variant is not on sale |
below_minimum | Below the minimum order quantity |
not_whole_cases | A product sold by the case, and the quantity is not a multiple of the case size |
insufficient_stock | A while-stock-lasts product ordered beyond what is available |
Why stock counts are not returned
A supplier's stock count is not shared with its clients. Products carry a stock status (availability), and a quote says only whether the quantity you asked for can be filled. To find how many you can order, quote again with a different quantity.
What is never returned
Cost prices, internal memos, the supplier's own supplier, other stores' prices, other clients' prices, stock counts, and warehouse or location details are not in any response.
Error responses
Status and error | Cause | What to do |
|---|---|---|
401 (no body) | The token is missing, invalid or expired | Refresh the token and try again |
403 (no body) | No b2b.catalog.read, or the buyer's business account could not be determined | Check the scope and buyerOrganizationId (403/401 responses) |
403 not_a_client | Not a client of the supplier, or the invitation has not been accepted | Ask the supplier for an invitation and accept it |
403 client_inactive | The supplier has stopped trading with you | Contact the supplier |
403 store_not_open | The store is not taking orders; storeState says which state it is in | Wait for the store to go live |
404 store_not_found | The store does not exist or does not use B2B EC | Check the storeId in the supplier list |
404 product_not_found | The product does not exist, is not published, or is not in your catalog | Search for the product again |
400 invalid_request | A quote with no lines, more than 100 lines, or a line without productId | Read message and fix the body |
Error bodies look like {"error": "...", "message": "...", "storeState": "..."}. The message of a refusal, like a quote line's refusal.message, is written in Japanese for people; branch on error and refusal.code in your code.
Related articles
-
Using the Store Information APIA guide to the REST API for fetching and updating a store's basic information (store name, store type, contact details, and address). Lets you implement a store information editing screen from token-authenticated clients such as staff apps.
-
PosTransactionDto specification — field reference for transaction dataA complete field reference for PosTransactionDto, the canonical model for the transaction data ReceiptRoller handles. For each category — identifiers, dates, amounts, line items, payments, staff, status, and CRM linkage — it summarizes the field names, types, meanings, and how each POS vendor populates them. A reference for developers and external-system integrators. Also referenced from the Smaregi and Square mapping articles.
-
Purchase and receipt data integrationExplains the structure of the purchase and receipt data ReceiptRoller handles, how to retrieve it, related scopes, Webhooks, and common use cases.
-
Using the Orders / OMS APIA guide to CRUD operations on the orders under a business account using ReceiptRoller's Orders / OMS API (/api/v1/orders). Covers creating, updating, transitioning status (confirm, process, cancel), and deleting orders, plus the flow for Android / iOS apps and server integrations.
-
Using the Business Hours APIA guide to ReceiptRoller's Business Hours API (/api/v1/stores/{storeId}/business-hours). Covers retrieving and updating per-day business hours, registering special business days (temporary closures and hour changes), configuring a store's workable hours (the upper bound for shift creation), and determining whether the store is currently open.