> This page is for API Reference.

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

# Find Sales Documents

GET https://api.npretail.app/{tenant}/{environment}/{company}/ecommerce/documents

Returns the incoming e-commerce sales documents that match one e-mail address, newest first. Pass exactly one of email (matched against the document's sell-to e-mail) or invoiceEmail (matched against the document's sell-to invoice e-mail). The match is case-insensitive on a bare address. Hits are compact summaries by default; withDetails=true returns the full SalesDocumentDTO without its payments array.

Reference: https://docs.navipartner.com/apis/api-reference/sales-documents/ecommerce/find-sales-documents

## Authentication

- `x-np-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required) — Your Entra Tenant ID. [More details.](/paths#1-tenant)
- `environment` (string, required) — Your Business Central Environment. [More details.](/paths#2-environment)
- `company` (string, required) — Your Business Central Company. [More details.](/paths#3-company)

### Query parameters

- `email` (string, optional) — The sell-to e-mail address to search for. Exactly one of email and invoiceEmail may carry a value; passing neither, or both with a value, returns 400. Max. length 80 symbols.
- `invoiceEmail` (string, optional) — The sell-to invoice e-mail address to search for. Exactly one of email and invoiceEmail must be given. Max. length 80 symbols.
- `withDetails` (boolean, optional) — Pass true to receive full SalesDocumentDTO items instead of the compact summary shape.
- `pageSize` (integer, optional) — Documents per page. Defaults to 100, which is also the maximum. A value below 1 falls back to the default, a higher value is capped at 100, and a non-numeric value returns 400.
- `pageKey` (string, optional) — Continuation key taken from a previous response's nextPageKey.

## Response

### 200

- `morePages` (boolean, required) — True when further pages follow. Pass nextPageKey to retrieve them.
- `nextPageKey` (string, required) — Continuation key for the next page, blank on the last page.
- `nextPageURL` (string, required) — Ready-made URL for the next page, blank on the last page.
- `salesDocuments` (list of FindSalesDocumentsHit, required)

## Types

### FindSalesDocumentsHit

A hit is the compact SalesDocumentSummaryDTO by default, or the full SalesDocumentDTO without its payments array when the request passes withDetails=true. Payment details are available through Get Sales Document only.

- Sales Document Summary Dto: SalesDocumentSummaryDTO
- Sales Document Dto: SalesDocumentDTO

### SalesDocumentSummaryDTO

The compact shape returned by Find Sales Documents. Request withDetails=true to receive full SalesDocumentDTO items in the same array instead.

- `id` (UUID, required)
- `externalNo` (string, required)
- `externalDocumentNo` (string, required)
- `documentType` (enum, required)
  - Allowed values: `order`, `returnOrder`
- `creationStatus` (enum, required)
  - Allowed values: `created`, `error`, `canceled`, `pending`
- `postingStatus` (enum, required)
  - Allowed values: `partiallyInvoiced`, `invoiced`, `pending`
- `captureProcessingStatus` (enum, required)
  - Allowed values: `error`, `partiallyProcessed`, `processed`, `pending`
- `currencyCode` (string, required)
- `createdAt` (datetime, required)
- `createdDocumentNo` (string, required)
- `postedDocumentNos` (list of string, required)
- `sellToCustomer` (SalesDocumentSummarySellToCustomerDTO, required)

### SalesDocumentDTO

- `externalNo` (string, required)
- `id` (UUID, required)
- `documentType` (enum, required)
  - Allowed values: `order`, `returnOrder`
- `creationStatus` (enum, required)
  - Allowed values: `created`, `error`, `canceled`, `pending`
- `postingStatus` (enum, required)
  - Allowed values: `partiallyInvoiced`, `invoiced`, `pending`
- `currencyCode` (string, required)
- `currencyExchangeRate` (double, required)
- `externalDocumentNo` (string, required)
- `locationCode` (string, required)
- `yourReference` (string, required)
- `languageTag` (string, required)
- `pricesExcludingVat` (boolean, required)
- `ticketReservationToken` (string, required)
- `captureProcessingStatus` (enum, required)
  - Allowed values: `error`, `partiallyProcessed`, `processed`, `pending`
- `lastCaptureErrorMessage` (string, required)
- `createdAt` (datetime, required)
- `createdDocumentNo` (string, required)
- `postedDocumentNos` (list of string, required)
- `sellToCustomer` (SalesDocumentSellToCustomerDTO, required)
- `shipToCustomer` (SalesDocumentShipToCustomerDTO, required)
- `shipment` (SalesDocumentShipmentDTO, required)
- `comments` (list of SalesDocumentCommentsDTO, required)
- `salesDocumentLines` (list of SalesDocumentLinesDTO, required)
- `payments` (list of SalesDocumentPaymentsDTO, optional) — Present on Get Sales Document when the document has payment lines. Never present on Find Sales Documents hits, which carry no payment details.
- `dimensions` (list of SalesDocumentDimensionDTO, optional) — List of dimensions stored on the document header, as supplied when the document was created or added by an extension to the incoming document. This is the document's own dimension set, not the effective set the created sales header posts with: dimensions that come from default dimension setup are not included, and neither are dimensions an extension put directly on the created sales header.
- `customFields` (SalesDocumentCustomFieldsRequest, optional) — This section allows you to add custom fields as key-value pairs. You can handle these fields by subscribing to our extension publishers and implementing custom serialization logic.

### SalesDocumentSummarySellToCustomerDTO

- `no` (string, required)
- `name` (string, required)
- `email` (string, required)
- `phone` (string, required)

### SalesDocumentSellToCustomerDTO

- `no` (string, required)
- `name` (string, required)
- `name2` (string, required)
- `address` (string, required)
- `address2` (string, required)
- `postCode` (string, required)
- `county` (string, required)
- `city` (string, required)
- `countryCode` (string, required)
- `contact` (string, required)
- `email` (string, required)
- `phone` (string, required)
- `ean` (string, required)
- `vatRegistrationNo` (string, required)
- `invoiceEmail` (string, required)
- `customerTemplate` (string, required)
- `configurationTemplate` (string, required)

### SalesDocumentShipToCustomerDTO

- `name` (string, required)
- `name2` (string, required)
- `address` (string, required)
- `address2` (string, required)
- `postCode` (string, required)
- `county` (string, required)
- `city` (string, required)
- `countryCode` (string, required)
- `contact` (string, required)

### SalesDocumentShipmentDTO

- `shipmentMethod` (string, required)
- `shipmentService` (string, required)

### SalesDocumentCommentsDTO

- `id` (UUID, required)
- `comment` (string, required)

### SalesDocumentLinesDTO

- `id` (UUID, required)
- `type` (enum, required)
  - Allowed values: `item`, `comment`, `shipmentFee`, `paymentFee`, `voucher`
- `no` (string, required)
- `variantCode` (string, required)
- `barcodeNo` (string, required)
- `description` (string, required)
- `unitPrice` (double, required)
- `quantity` (double, required)
- `unitOfMeasure` (string, required)
- `vatPercent` (double, required)
- `lineAmount` (double, required)
- `requestedDeliveryDate` (date, required)
- `invoicedQuantity` (double, required)
- `invoicedAmount` (double, required)
- `captured` (boolean, required)
- `virtualItemProcessStatus` (enum, required)
  - Allowed values: ``, `processed`, `error`
- `virtualItemProcessErrorMessage` (string, required)
- `attractionWalletProcessStatus` (enum, required)
  - Allowed values: ``, `processed`, `error`
- `attractionWalletProcessErrorMessage` (string, required)
- `ticketReservationLineId` (UUID, required)
- `membershipId` (UUID, required)
- `membershipOperation` (string, required)
- `memberFirstName` (string, required)
- `memberLastName` (string, required)
- `memberMiddleName` (string, required)
- `memberEmail` (string, required)
- `memberPhoneNo` (string, required)
- `memberBirthday` (date, required)
- `memberGender` (string, required)
- `memberAddress` (string, required)
- `memberCity` (string, required)
- `memberCountry` (string, required)
- `memberPostCode` (string, required)
- `memberNewsletter` (string, required)
- `memberGdprApproval` (string, required)
- `membershipActivationDate` (date, required)
- `subscription` (boolean, required)
- `externalLineId` (string, optional)
- `parentExternalLineId` (string, optional)
- `dimensions` (list of SalesDocumentDimensionDTO, optional) — List of dimensions stored on this line, as supplied when the document was created or added by an extension to the incoming line. This is the line's own dimension set, not the effective set the created sales line posts with: dimensions inherited from the document header or from default dimension setup are not included, and neither are dimensions an extension put directly on the created sales line.
- `issuedAssets` (list of IssuedAssetDTO, optional) — Array of issued assets linked to this sales line. When a single asset is present, the legacy fields on the sales line are still populated to maintain backward compatibility with existing integrations. However, the `issuedAssets` array is the primary and recommended data source and supports multiple assets per line.
- `customFields` (SalesDocumentCustomFieldsRequest, optional) — This section allows you to add custom fields as key-value pairs. You can handle these fields by subscribing to our extension publishers and implementing custom serialization logic.

### SalesDocumentPaymentsDTO

- `id` (UUID, required)
- `paymentMethodType` (enum, required)
  - Allowed values: `paymentGateway`, `voucher`
- `externalPaymentMethodCode` (string, required)
- `externalPaymentType` (string, required)
- `paymentReference` (string, required)
- `paymentAmount` (double, required)
- `parToken` (string, required)
- `pspToken` (string, required)
- `cardBrand` (string, required)
- `maskedCardNumber` (string, required)
- `cardExpiryDate` (string, required)
- `cardAliasToken` (string, required) — Max. length 80 symbols.
- `capturedPaymentAmount` (double, required)
- `customFields` (SalesDocumentCustomFieldsRequest, optional) — This section allows you to add custom fields as key-value pairs. You can handle these fields by subscribing to our extension publishers and implementing custom serialization logic.

### SalesDocumentDimensionDTO

- `code` (string, required)
- `valueCode` (string, required)

### SalesDocumentCustomFieldsRequest

- `myCustomField1` (string, optional)
- `myCustomField2` (string, optional)

### IssuedAssetDTO

- `id` (UUID, required) — System ID of the asset.
- `type` (enum, required)
  - Allowed values: `wallet`, `ticket`, `voucher`, `coupon`, `membership`
- `referenceNo` (string, required) — Asset reference number based on type.

## Examples

**Response**

```json
{
  "morePages": true,
  "nextPageKey": "eyJ2aWV3IjoiU09SVElORyguLi4pIn0",
  "nextPageURL": "https://api.npretail.app/ecommerce/documents?email=jane.doe%40acme.com&pageKey=eyJ2aWV3IjoiU09SVElORyguLi4pIn0",
  "salesDocuments": [
    {
      "id": "4ca28ccc-e84b-4788-973c-c8ce5a59383b",
      "externalNo": "WEBP000000001",
      "externalDocumentNo": "WEBORD-123",
      "documentType": "order",
      "creationStatus": "created",
      "postingStatus": "invoiced",
      "captureProcessingStatus": "processed",
      "currencyCode": "DKK",
      "createdAt": "2026-09-09T08:14:22Z",
      "createdDocumentNo": "SO-104213",
      "postedDocumentNos": [
        "PSI-100871"
      ],
      "sellToCustomer": {
        "no": "C00432",
        "name": "Jane Doe",
        "email": "jane.doe@acme.com",
        "phone": "+4512345678"
      }
    }
  ]
}
```

**SDK Code**

```python Example Find Sales Documents Response
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents"

querystring = {"email":"jane.doe@acme.com","pageSize":"2"}

headers = {"x-np-api-key": "<NaviPartner API Key>"}

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

print(response.json())
```

```javascript Example Find Sales Documents Response
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2';
const options = {method: 'GET', headers: {'x-np-api-key': '<NaviPartner API Key>'}};

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

```go Example Find Sales Documents Response
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2"

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

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")

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

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

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

}
```

```ruby Example Find Sales Documents Response
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2")

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

request = Net::HTTP::Get.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'

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

```java Example Find Sales Documents Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

```php Example Find Sales Documents Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Example Find Sales Documents Response
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2");
var request = new RestRequest(Method.GET);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift Example Find Sales Documents Response
import Foundation

let headers = ["x-np-api-key": "<NaviPartner API Key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents?email=jane.doe%40acme.com&pageSize=2")! 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()
```