> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# List Ordered Products

GET https://api-b2b.bigcommerce.com/api/v2/ordered-products

Retrieves information related to products that a Company user has purchased. The information returned by this endpoint is different from the detailed product information returned by [Get Order Details](#get-order-details). However, it does include unique information like how many times a product was ordered and when it was last ordered.

The response includes all products purchased by the Company user, but you can filter for a subset of products by using parameters. Common use cases include:

* Retrieving products purchased within a date range by using `beginDateAt` and `endDateAt`
* Retrieving products ordered a specific number of times by using `minOrderedTimes` and `maxOrderedTimes`
* Retrieving information on similarly-named products by entering a partial product name as a `q` value
* Retrieving information on a specific product by using `productID`

Equivalent Storefront GraphQL API Query: `orderedProducts`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/storefront/orders/get-ordered-products

## Authentication

- `Authorization` header (bearer token, required) — ### Authentication header | Header | Argument | Description | | :-------------- | :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Authorization` | `Bearer {{B2B_JWT_TOKEN}}` | You can obtain this token using the steps described in the [REST Storefront API](/developer/docs/b2b-edition/getting-started/authentication#rest-storefront-api) section\[...] |

## Request

### Query parameters

- `offset` (integer, optional, default: 0) — The number of results to skip before returning the first result. If left blank, this defaults to 0.
- `limit` (integer, optional, default: 10) — Determines the number of records to return per page. If left blank, this defaults to 10.
- `beginDateAt` (datetime, optional) — Enter a date in `%m/%d/%Y` format to retrieve all orders placed after that time. If the parameter is not included in the request, the resposne includes orders placed 30 days before the current date.
- `endDateAt` (datetime, optional) — Enter a date in `%m/%d/%Y` format to retrieve all orders placed before that time. If the parameter is not included in the request, the current date is used.
- `minOrderedTimes` (double, optional) — Enter a number to return products that have been ordered at least that many times by the Company user.
- `maxOrderedTimes` (double, optional) — Enter a number to return products that have been ordered at least that many times by the Company user.
- `productID` (double, optional) — The unique identifier for the product.
- `q` (string, optional) — Enter order information to return partial and exact matches. Accepted information fields include order ID, order status name, Purchase Order (PO) number, and total order value including tax.

## Response

### 200

OK

- `code` (integer, required, default: 200) — HTTP Response Code
- `message` (string, required, default: SUCCESS) — Response message
- `data` (OrderedProductsGetResponsesContentApplicationJsonSchemaData, required)

## Types

### OrderedProductsGetResponsesContentApplicationJsonSchemaData

- `paginator` (paginator, required) — Contains pagination information for the response.
- `list` (list of OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItems, required) — Contains information fields associated with each product in the response.

### paginator

Contains pagination information for the response.

- `totalCount` (integer, optional) — The total number of items in the response.
- `offset` (integer, optional) — The number of items skipped in the response before the first result.
- `limit` (integer, optional) — The maximum number of items that can be returned.

### OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItems

- `orderProductId` (string, required) — The unique identifier for the product appearing on the order. Note that this is different from the `productId`.
- `productName` (string, required) — The name of the product as it appears on the order.
- `sku` (string, required) — The product's SKU.
- `productId` (string, required) — The unique identifier for the base product.
- `variantId` (string, required) — The unique identifier for the product variant.
- `lastOrdered` (string, required) — The [Unix timestamp](https://www.unixtimestamp.com/) for the last time the buyer ordered the product.
- `orderedTimes` (string, required) — The number of times that the buyer has ordered the product.
- `lastOrderedItems` (string, required) — The quantity of the product purchased in the buyer's most recent order.
- `productBrandName` (string, required) — The name of the brand associated with the product.
- `optionList` (list of OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItemsOptionListItems, optional) — Contains information about the product's options.
- `optionSelections` (list of OptionListSimpleItems, optional) — Contains information about the product's options.
- `ordersInfo` (list of OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItemsOrdersInfoItems, optional) — Contains information about all orders containing the product.
- `imageUrl` (string, optional) — The image URL for a product in the order.

### OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItemsOptionListItems

- `id` (integer, required) — The unique numerical ID of the option; increments sequentially.
- `option_id` (integer, required) — The numeric ID of the associated option.
- `order_product_id` (integer, required) — The numeric ID of the option within the order.
- `product_option_id` (integer, required) — The unique identifier for the product's variant or modifier option.
- `display_name` (string, required) — Alias for `displayNameCustomer`. The product option name that is shown to customer in the storefront.
- `display_name_customer` (string, required) — The product option name that is shown to customer in storefront.
- `display_name_merchant` (string, required) — The internal option name in the control panel.
- `display_value` (string, required) — Alias for `displayValueCustomer`. The product option value that is shown to customer in storefront.
- `display_value_customer` (string, required) — The product option value that is shown to customer in storefront.
- `display_value_merchant` (string, required) — The internal option value name in the control panel.
- `value` (string, required) — The unique identifier for the product's selected option value.
- `type` (string, required) — The type of option, which determines how it will display on the storefront.
- `name` (string, required) — The option's name, as used internally. Options given a duplicate name have a numeric string added to them.
- `display_style` (string, required) — Indicates how a multiple choice option is displayed on the storefront.

### OptionListSimpleItems

- `optionId` (integer, optional) — The unique identifier for the product's variant or modifier option.
- `optionValue` (string, optional) — The unique identifier for the product's selected option value.
- `type` (string, optional) — The type of option, which determines how it will display on the storefront.

### OrderedProductsGetResponsesContentApplicationJsonSchemaDataListItemsOrdersInfoItems

- `order_id` (double, optional) — The unique identifier for the B2B Edition order record
- `quantity` (double, optional) — The quantity of the product in the order.
- `ordered_at` (double, optional) — The [Unix timestamp](https://www.unixtimestamp.com/) for when the order was placed.
- `bc_order_id` (string, optional) — The B2B Edition internal order ID. Note that this is different from the BigCommerce order ID returned in the `bcOrderId` field.

## Examples

**Response**

```json
{
  "code": 200,
  "message": "SUCCESS",
  "data": {
    "paginator": {
      "totalCount": 1,
      "offset": 0,
      "limit": 10
    },
    "list": [
      {
        "orderProductId": "12345",
        "productName": "Sansevieria",
        "sku": "SAN-PL",
        "productId": "321",
        "variantId": "74669",
        "lastOrdered": "1744894371",
        "orderedTimes": "1",
        "lastOrderedItems": "5",
        "productBrandName": "Rustic Roots",
        "optionList": [
          {
            "id": 1595,
            "option_id": 32,
            "order_product_id": 1461,
            "product_option_id": 3773,
            "display_name": "Size",
            "display_name_customer": "Size",
            "display_name_merchant": "Size",
            "display_value": "Small",
            "display_value_customer": "Small",
            "display_value_merchant": "Small",
            "value": "95",
            "type": "Multiple choice",
            "name": "Color1736973439-63261",
            "display_style": "Rectangle"
          }
        ],
        "optionSelections": [
          {
            "optionId": 3773,
            "optionValue": "18836",
            "type": "Multiple choice"
          }
        ],
        "ordersInfo": [
          {
            "order_id": 23318773,
            "quantity": 5,
            "ordered_at": 1744894371,
            "bc_order_id": 123
          }
        ],
        "imageUrl": "https://mybcstore.com/images/products/12345/main.jpg"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-b2b.bigcommerce.com/api/v2/ordered-products"

querystring = {"beginDateAt":"01/01/2025","endDateAt":"01/01/2025","limit":"20","maxOrderedTimes":"10","minOrderedTimes":"5","offset":"10","productID":"123","q":"Awaiting Payment"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v2/ordered-products?beginDateAt=01%2F01%2F2025&endDateAt=01%2F01%2F2025&limit=20&maxOrderedTimes=10&minOrderedTimes=5&offset=10&productID=123&q=Awaiting+Payment")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```