Download OpenAPI specification:Download
Welcome to the Partner API by BuyBay, designed to streamline interactions between partners and BuyBay's return management system.
This API provides programmatic access to manage authentication, return item announcements, batches, deliveries, counted and graded returns, stock batches, orders, and stock license plates.
The Partner API is available in three environments: Test, Staging, and Production. Below are the base URLs for each environment:
| Environment | Base URL |
|---|---|
| Test | https://partner-api.test.buybay.com |
| Staging | https://partner-api.staging.buybay.com |
| Production | https://partner-api.prod.buybay.com |
All endpoints listed in this specification are relative to these base URLs. For example, the /api/v1/orders endpoint can be accessed as:
https://partner-api.test.buybay.com/api/v1/ordershttps://partner-api.staging.buybay.com/api/v1/ordershttps://partner-api.prod.buybay.com/api/v1/ordersThis API uses Bearer Token Authentication. Include this token in the Authorization header of subsequent requests as Bearer <token>.
Explore the endpoints below to learn more about each feature and how to integrate them into your workflows.
Gets the list of deliveries belonging to the user's owner from the Partner Portal. They can be filtered by a delivery date interval.
| start_date | string <date> Filter deliveries from the start_date onwards |
| end_date | string <date> Filter deliveries up until the end_date |
| scope | string Enum: "all" "active" "cancelled" Filter deliveries depending on the cancelled state. If scope is not provided, it will default to |
| reference | string <text> Filter deliveries based on reference |
| page | integer Example: page=1 The results' data page |
| per_page | integer Default: 50 Example: per_page=20 The results' data page size |
{- "data": [
- {
- "reference": "DR-a9460636",
- "delivery_date": "2022-04-22",
- "delivery_time": "afternoon",
- "pallet_count": 1,
- "locked": true,
- "locked_on": "2022-04-21",
- "batches": [
- {
- "reference": "n1ltie4cc5",
- "status": "processed",
- "pallet_count": null,
- "items": 7,
- "error_messages": [ ]
}, - {
- "reference": "w3gbbhraju",
- "status": "processed",
- "pallet_count": null,
- "items": 5,
- "error_messages": [ ]
}, - {
- "reference": "71zf2qwqyp",
- "status": "processed",
- "pallet_count": null,
- "items": 3,
- "error_messages": [ ]
}
], - "has_pallet_references": false,
- "cancelled": false
}, - {
- "reference": "DR-a2d921df",
- "delivery_date": "2022-05-02",
- "delivery_time": "morning",
- "pallet_count": 3,
- "locked": false,
- "locked_on": "2022-05-01",
- "batches": [
- {
- "reference": "rqrir4nx6l",
- "status": "processed",
- "pallet_count": null,
- "items": 12,
- "error_messages": [ ]
}
], - "has_pallet_references": false,
- "cancelled": false
}
], - "meta": {
- "page": 1,
- "per_page": 20,
- "count": 2
}
}Creates a batch of items from Partner Portal which will result in bulk return announcements
| delivered_on required | string <date> |
| delivery_time required | string Enum: "morning" "afternoon" |
| pallet_count required | integer |
| publisher_reference | string or null |
| reference required | string |
Array of objects |
{- "delivered_on": "2022-01-01",
- "delivery_time": "morning",
- "pallet_count": 3,
- "publisher_reference": "",
- "reference": "PURCHASE-REF-1111",
- "items": [
- {
- "ean": "4000530651181",
- "asin": null,
- "other_reference": null,
- "product_name": "Coffee machine",
- "product_price": {
- "amount": 33.1,
- "currency": "EUR"
}, - "quantity": 2,
- "owner_reference": "1Abc",
- "owner_price": {
- "amount": 23.1,
- "currency": "EUR"
}, - "return_reason": "wrong_color",
- "customer_remark": "I received the wrong color.",
- "custom_attributes": {
- "bol_order_number": "1235",
- "bol_order_date": "may 21"
}
}
]
}{- "data": {
- "job_id": "string",
- "delivery_reference": "string"
}
}Gets the list of sales belonging to the user. These can be filtered by a date range or by specific license plate code.
| date_from | string <date> Example: date_from=2025-11-01 Limit the sales report base on a start date |
| date_to | string <date> Example: date_to=2025-11-30 Limit the sales report base on an end date |
| page | integer Example: page=1 Limit the sales report to the desired page. Works alongside items param. |
| items | integer Example: items=30 Determines how many license plates are returned per request. Defaults to 100. |
| code | string Example: code=BW221201110425 Limit the sales report to a specific license plate |
{- "data": {
- "license_plates": [
- {
- "license_plate": "BW221201110425",
- "ean": "4710886053132",
- "owner_reference": "OWNER-REF-001B",
- "purchase_reference": "PURCHASE-REF-001A",
- "product_name": "ACER ASPIRE 3 A315-23-R0QE",
- "calculated_at": "2025-11-01T01:00:00.000+01:00"
}
]
}, - "meta": {
- "total": 1,
- "items": 1,
- "page": 1
}
}Gets the list of stocks belonging to the user. They can be filtered by specific license plate code.
| page | integer Example: page=1 Limit the stocks report to the desired page. Works alongside items param. |
| items | integer Example: items=30 Determines how many license plates are returned per request. Defaults to 100. |
| code | string Example: code=BW221201110425 Limit the stocks report to a specific license plate |
{- "data": {
- "license_plates": [
- {
- "license_plate": "BW221201110425",
- "ean": "4710886053132",
- "owner_reference": "OWNER-REF-001B",
- "status": "in_stock"
}
]
}, - "meta": {
- "total": 1,
- "items": 1,
- "page": 1
}
}Allow partners to create returns (partner_direct_returns)
required | object |
{- "announcement": {
- "return_reference": "return_reference",
- "publisher_reference": "publisher_reference",
- "ean": "5397063839032",
- "asin": "B000Q71WNG",
- "other_reference": "OR-9138814",
- "product_name": "product_name",
- "product_price": "1000.99",
- "return_reason": "Damaged",
- "customer_remark": "It does not work",
- "tracking_code": "6767676767676",
- "carrier_name": "DPD",
- "customer_name": "Donald M",
- "customer_email": "customer@partner.com",
- "customer_address": "434 Azielaan",
- "customer_city": "Utrecht",
- "customer_country_code": "NL",
- "customer_postal_code": "1016BK",
- "customer_phone": "+318379992",
- "supplier_name": "JM",
- "owner_reference": "owner_reference",
- "product_price_cents": 19999,
- "custom_attributes": {
- "contorion_sku": "ABC123"
}
}
}{- "data": {
- "return_reference": "qwe123"
}
}| date required | string Example: date=2022-12-01 The returns counting date |
| page | integer Example: page=1 The results' data page |
| per_page | integer Default: 50 Example: per_page=20 The results' data page size |
{- "data": [
- {
- "your_reference": "YR-123",
- "license_plate": "BW221201110425",
- "product_reference": "4957054510053",
- "product_name": "Razer Huntsman Mini Gaming Toetsenbord",
- "offline_sale_yn": true
}, - {
- "your_reference": "YR-124",
- "license_plate": "BW221201115216",
- "product_reference": "8710103951728",
- "product_name": "Philips Airfryer Essential HD9200/90",
- "offline_sale_yn": true
}
], - "meta": {
- "page": 1,
- "per_page": 20,
- "count": 2
}
}| date required | string Example: date=2022-12-01 The returns grading date |
| page | integer Example: page=1 The results' data page |
| per_page | integer Default: 50 Example: per_page=20 The results' data page size |
{- "data": [
- {
- "your_reference": "YR-123",
- "license_plate": "BW221201110425",
- "product_reference": "4957054510053",
- "product_name": "Razer Huntsman Mini Gaming Toetsenbord",
- "grade": "B1",
- "grading_remark": "There are multiple scratches or stains on this product. With that: Other scratches or stains",
- "custom_attributes": {
- "bol_order_number": 1235,
- "bol_order_date": "may 21"
}, - "owner_reference": "OWNER_REF",
- "ean": 4000530651181,
- "asin": null,
- "other_reference": null
}, - {
- "your_reference": "YR-124",
- "license_plate": "BW221201115216",
- "product_reference": "8710103951728",
- "product_name": "Philips Airfryer Essential HD9200/90",
- "grade": "B2",
- "grading_remark": "There are multiple scratches or stains on this product. With that: Other scratches or stains",
- "custom_attributes": {
- "bol_order_number": 1235,
- "bol_order_date": "may 21"
}, - "owner_reference": "OWNER_REF",
- "ean": 4000530651181,
- "asin": null,
- "other_reference": null
}
], - "meta": {
- "page": 1,
- "per_page": 20,
- "count": 1
}
}| page | integer Example: page=1 The results' data page |
| per_page | integer Default: 50 Example: per_page=10 The results' data page size |
{- "data": [
- {
- "id": 2,
- "type": "stock_batches",
- "attributes": {
- "reference": "STOCK_BATCH_1",
- "status": "draft",
- "created_at": "2022-11-02T12:47:33.438+01:00",
- "no_of_items": 0
}
}, - {
- "id": 3,
- "type": "stock_batches",
- "attributes": {
- "reference": "STOCK_BATCH_2",
- "status": "draft",
- "created_at": "2022-11-08T06:59:51.617+01:00",
- "no_of_items": 0
}
}
], - "meta": {
- "page": 1,
- "per_page": 50,
- "count": 2
}
}object |
{- "data": {
- "type": "stock_batches",
- "attributes": {
- "reference": "STOCK_BATCH_1",
- "items": [
- {
- "ean": 8712876104530,
- "asin": null,
- "other_reference": null,
- "product_name": "Inventum ST306RZA - Stofzuiger met zak - Rood",
- "product_price": {
- "currency": "EUR",
- "amount": 69.99
}, - "quantity": 1,
- "owner_reference": "RID-01262350",
- "owner_price": null,
- "return_reason": "Klacht over artikel",
- "customer_remark": "anders",
- "custom_attributes": {
- "bol_order_number": 1235,
- "bol_order_date": "may 21"
}, - "license_plate": "UMHB0EEA08-021118",
- "grade": "C",
- "grade_remark": "Test remark 1"
}, - {
- "ean": 8712876104537,
- "asin": null,
- "other_reference": null,
- "product_name": "TV",
- "product_price": {
- "currency": "EUR",
- "amount": 169.99
}, - "quantity": 1,
- "owner_reference": "RID-01262350",
- "owner_price": null,
- "return_reason": "Klacht over artikel",
- "customer_remark": "anders",
- "custom_attributes": {
- "bol_order_number": 1235,
- "bol_order_date": "may 21"
}, - "license_plate": "UMHB0EEA08-021118",
- "grade": "B",
- "grade_remark": "Test remark 2"
}
]
}
}
}{- "data": {
- "id": 510,
- "type": "stock_batches",
- "attributes": {
- "reference": "STOCK_BATCH_1",
- "status": "draft",
- "created_at": "2023-10-20T07:26:47.533+02:00",
- "no_of_items": 2
}
}
}| id required | integer <int64> Reference of the stock batch |
{- "data": {
- "id": 2,
- "type": "stock_batches",
- "attributes": {
- "reference": "STOCK_BATCH_1",
- "status": "draft",
- "created_at": "2022-11-02T12:47:33.438+01:00",
- "no_of_items": 6
}
}
}| status | string Example: status=open The type of order requested. Can either be |
| page | integer Example: page=1 The results' data page |
| per_page | integer Default: 50 Example: per_page=10 The results' data page size |
{- "data": [
- {
- "order_id": 1000,
- "order_reference": "ABC113OL123456",
- "your_reference": "BOL-RO-12345678",
- "license_plate": "190900423627",
- "title": "Nikon PROSTAFF 5 10X42 - Verrekijker",
- "ean": "4571137585877",
- "order_date": "2022-12-15",
- "shipped_at": "2022-12-16",
- "status": "allocated"
}
], - "meta": {
- "page": 1,
- "per_page": 50,
- "count": 1
}
}| reference required | string Reference of the order. |
{- "data": {
- "id": 235434,
- "type": "sales_order_lines",
- "attributes": {
- "tracking_code": 5112063468209,
- "order_reference": "BO309171OL245856",
- "delivery_address": {
- "name": "Clark Kent",
- "address": "Amazonlaan 23",
- "city": "Amsterdam",
- "postal_code": "1234 AA",
- "country": "NETHERLANDS",
- "phone": 23452342
}, - "billing_address": {
- "name": "Clark Kent",
- "address": "Amazonlaan 23",
- "city": "Amsterdam",
- "postal_code": "1234 AA",
- "country": "NETHERLANDS",
- "phone": 23452342
}, - "license_plate": "YY231003117092",
- "grade": "C",
- "ean": 5702017399683,
- "custom_attributes": {
- "other_reference": "value"
}, - "title": "LEGO NINJAGO Lloyd's Mech Battle EVO - 71781",
- "owner_reference": "lego 1234",
- "ordered_on": "2023-10-03",
- "shipped_at": "2024-01-18T17:52:31+01:00",
- "retail_price": {
- "currency": "EUR",
- "value": 15.03
}, - "sales_price": {
- "currency": "EUR",
- "value": 195
}, - "shipping_method": "DPD",
- "carrier_code": "DPD",
- "carrier_name": "DPD",
- "additional_reference_1": "FC231020071120",
- "additional_reference_2": "FC2310200732u21",
- "additional_reference_3": "FC2310200234380",
- "additional_reference_4": null
}
}
}| reference required | string Reference of the order. |
| carrier_code | string |
| tracking_code | string |
{- "carrier_code": "DPD",
- "tracking_code": 5112063468209
}{- "data": {
- "order_reference": "BO227283OL123456",
- "message": "Order successfully shipped."
}
}| license_plate | string |
{- "license_plate": "LOC-231215-99239-45"
}{- "data": {
- "message": "Stock job has been created."
}
}