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

# Get Order Metrics

GET https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics

Reference: https://walmart.postmansolutions.com/us-marketplace/api-reference/seller-finances/sales/get-order-metrics

## Servers

- `https://marketplace.walmart.com/seller/v1` (Production, default)
- `https://sandbox.marketplace.walmart.com/seller/v1` (Sandbox)

## Request

### Query parameters

- `marketplaceIds` (list of string, required) — A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified
- `interval` (string, required) — A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone.
- `granularityTimeZone` (string, optional) — An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone.
- `granularity` (enum, required) — The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone.
  - Allowed values: `Hour`, `Day`, `Week`, `Month`, `Year`, `Total`
- `buyerType` (enum, optional) — Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers.
  - Allowed values: `B2B`, `B2C`, `All`
- `fulfillmentNetwork` (string, optional) — Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (marketplace fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only the marketplace fulfillment network.
- `firstDayOfWeek` (enum, optional) — Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sund
  - Allowed values: `Monday`, `Sunday`
- `asin` (string, optional) — Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN.
- `sku` (string, optional) — Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU.
- `sp-apiProgram` (string, optional) — Filters the results by the program that you specify. Do not include this filter if you want the response to inclu

## Response

### 200

Success

- `map from string to any`

## Errors

### 400 Bad Request Error

Bad Request

- `errors` (list of Error, required)

### 403 Forbidden Error

Forbidden

- `errors` (list of Error, required)

### 404 Not Found Error

Not Found

- `errors` (list of Error, required)

### 429 Too Many Requests Error

Rate limit exceeded

- `errors` (list of Error, required)

### 500 Internal Server Error

Internal Server Error

- `errors` (list of Error, required)

## Types

### Error

- `code` (string, required)
- `message` (string, required)
- `details` (string, optional)

## Examples

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics"

querystring = {"granularity":"Hour","interval":"interval","marketplaceIds":"[\"string\"]"}

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

print(response.json())
```

```javascript
const url = 'https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D';
const options = {method: 'GET'};

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://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D"

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

	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://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D")

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

request = Net::HTTP::Get.new(url)

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://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D');

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

```csharp
using RestSharp;

var client = new RestClient("https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://marketplace.walmart.com/seller/v1/sales/v4/orderMetrics?granularity=Hour&interval=interval&marketplaceIds=%5B%22string%22%5D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```