> 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.

# Create External POS Sale

POST https://api.npretail.app/{tenant}/{environment}/{company}/pos/externalsale
Content-Type: application/json

Reference: https://docs.navipartner.com/apis/api-reference/pos/externalsale/create-external-pos-sale

## 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)

### Body (application/json)

This endpoint expects a CreateExternalPOSSale.

- `startedAt` (datetime, required)
- `posStore` (string, required)
- `posUnit` (string, required)
- `pricesIncludeVAT` (boolean, required)
- `saleLines` (list of CreateExternalPOSSaleLine, required)
- `paymentLines` (list of CreateExternalPOSPaymentLine, required)
- `receiptNo` (string, optional) — Determines the receipt number that is known by the customer. If omitted the system will generate one for you.
- `salespersonCode` (string, optional) — Determines the code of the salesperson performing the external sale. If omitted the system will attempt to use the one assigned to the API user.
- `customerId` (UUID, optional)
- `externalDocumentNo` (string, optional) — Determines the external document number of the sale. This could for example be a web order ID that the external sale was converted into.

## Response

### 201

- `saleId` (UUID, required)
- `startedAt` (datetime, required)
- `posStore` (string, required)
- `posUnit` (string, required)
- `pricesIncludeVAT` (boolean, required)
- `convertedToPOSEntry` (boolean, required)
- `saleLines` (list of ExternalPOSSaleLine, required)
- `paymentLines` (list of ExternalPOSPaymentLine, required)
- `receiptNo` (string, optional) — Determines the receipt number that is known by the customer. If omitted the system will generate one for you.
- `salespersonCode` (string, optional) — Determines the code of the salesperson performing the external sale. If omitted the system will attempt to use the one assigned to the API user.
- `customerId` (UUID, optional)
- `externalDocumentNo` (string, optional) — Determines the external document number of the sale. This could for example be a web order ID that the external sale was converted into.
- `posEntryId` (UUID, optional) — Determines the POS Entry Id that the external sale was converted to. Not included if the sale is not yet converted.

## Types

### CreateExternalPOSSaleLine

- `type` (enum, required)
  - Allowed values: `Item`, `Item Category`, `BOM List`, `Customer Deposit`, `Comment`, `Rounding`, `G/L Payment`, `Issue Voucher`
- `code` (string, required) — The identifier for the sales line being added. This can for example be an item number or an item reference.
- `qty` (double, required)
- `unitPrice` (double, required)
- `amountIncludingVAT` (double, required)
- `discountAmount` (double, required)
- `description` (string, required)
- `variantCode` (string, optional)
- `vatPercent` (double, optional)
- `amount` (double, optional)
- `discountType` (enum, optional)
  - Allowed values: `Campaign`, `Mix`, `Quantity`, `Manual`, `BOM List`, `Rounding`, `Combination`, `Customer`
- `unitOfMeasureCode` (string, optional)
- `description2` (string, optional)
- `returnReasonCode` (string, optional)

### CreateExternalPOSPaymentLine

A payment line in the representation of the external system.

- `paymentMethodCode` (string, required)
- `description` (string, required)
- `amountIncludingVAT` (double, required)
- `currencyAmount` (double, optional) — If the payment is done in a different currency than the one of the sale, then the amount paid in the foreign currency should be provided in this field.
- `additionalEftData` (AdditionalEftData, optional) — Additional data about the payment, if it's an EFT transaction, can be provided here. The data format will be specific to the individual EFT type.

### ExternalPOSSaleLine

- `lineId` (UUID, required)
- `type` (enum, required)
  - Allowed values: `Item`, `Item Category`, `BOM List`, `Customer Deposit`, `Comment`, `Rounding`, `G/L Payment`, `Issue Voucher`
- `code` (string, required) — The identifier for the sales line being added. This can for example be an item number or an item reference.
- `qty` (double, required)
- `unitPrice` (double, required)
- `vatPercent` (double, required)
- `amount` (double, required)
- `amountIncludingVAT` (double, required)
- `discountAmount` (double, required)
- `description` (string, required)
- `variantCode` (string, optional)
- `discountType` (enum, optional)
  - Allowed values: `Campaign`, `Mix`, `Quantity`, `Manual`, `BOM List`, `Rounding`, `Combination`, `Customer`
- `unitOfMeasureCode` (string, optional)
- `description2` (string, optional)
- `returnReasonCode` (string, optional)

### ExternalPOSPaymentLine

- `lineId` (UUID, required)
- `paymentMethodCode` (string, required)
- `description` (string, required)
- `amountIncludingVAT` (double, required)
- `currencyAmount` (double, optional) — If the payment is done in a different currency than the one of the sale, then the amount paid in the foreign currency should be provided in this field.

### AdditionalEftData

- `eftType` (string, required)
- `eftData` (string, required)

## Examples

**Request**

```json
{
  "startedAt": "2024-01-01T10:00:00Z",
  "posStore": "01",
  "posUnit": "0101",
  "pricesIncludeVAT": true,
  "saleLines": [
    {
      "type": "Item",
      "code": "ITEM-01",
      "qty": 1,
      "unitPrice": 100,
      "amountIncludingVAT": 100,
      "discountAmount": 0,
      "description": "Super awesome item",
      "vatPercent": 25,
      "amount": 80
    }
  ],
  "paymentLines": [
    {
      "paymentMethodCode": "CASH",
      "description": "Cash payment",
      "amountIncludingVAT": 100,
      "additionalEftData": {
        "eftType": "adyen",
        "eftData": "Base64EncodedResponse"
      }
    }
  ],
  "receiptNo": "123ABCD",
  "salespersonCode": "1234",
  "customerId": "0053e689-81bb-403d-be15-e05332ceb85f"
}
```

**Response**

```json
{
  "saleId": "4ca28ccc-e84b-4788-973c-c8ce5a59383b",
  "startedAt": "2024-01-01T10:00:00Z",
  "posStore": "01",
  "posUnit": "0101",
  "pricesIncludeVAT": true,
  "convertedToPOSEntry": true,
  "saleLines": [
    {
      "lineId": "43aef219-60d9-4827-9e3e-4cc63b420548",
      "type": "Item",
      "code": "ITEM-01",
      "qty": 1,
      "unitPrice": 100,
      "vatPercent": 25,
      "amount": 80,
      "amountIncludingVAT": 100,
      "discountAmount": 0,
      "description": "Super awesome item"
    }
  ],
  "paymentLines": [
    {
      "lineId": "f77b05de-cf16-461a-b330-15188b34b6fd",
      "paymentMethodCode": "CASH",
      "description": "Cash payment",
      "amountIncludingVAT": 100
    }
  ],
  "receiptNo": "123ABCD",
  "salespersonCode": "1234",
  "customerId": "0053e689-81bb-403d-be15-e05332ceb85f",
  "posEntryId": "e3ddb678-30e8-45e3-9e88-96d7cf703ac1"
}
```

**SDK Code**

```python ExampleExternalPOSSaleRequest
import requests

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

payload = {
    "startedAt": "2024-01-01T10:00:00Z",
    "posStore": "01",
    "posUnit": "0101",
    "pricesIncludeVAT": True,
    "saleLines": [
        {
            "type": "Item",
            "code": "ITEM-01",
            "qty": 1,
            "unitPrice": 100,
            "amountIncludingVAT": 100,
            "discountAmount": 0,
            "description": "Super awesome item",
            "vatPercent": 25,
            "amount": 80
        }
    ],
    "paymentLines": [
        {
            "paymentMethodCode": "CASH",
            "description": "Cash payment",
            "amountIncludingVAT": 100,
            "additionalEftData": {
                "eftType": "adyen",
                "eftData": "Base64EncodedResponse"
            }
        }
    ],
    "receiptNo": "123ABCD",
    "salespersonCode": "1234",
    "customerId": "0053e689-81bb-403d-be15-e05332ceb85f"
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript ExampleExternalPOSSaleRequest
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"startedAt":"2024-01-01T10:00:00Z","posStore":"01","posUnit":"0101","pricesIncludeVAT":true,"saleLines":[{"type":"Item","code":"ITEM-01","qty":1,"unitPrice":100,"amountIncludingVAT":100,"discountAmount":0,"description":"Super awesome item","vatPercent":25,"amount":80}],"paymentLines":[{"paymentMethodCode":"CASH","description":"Cash payment","amountIncludingVAT":100,"additionalEftData":{"eftType":"adyen","eftData":"Base64EncodedResponse"}}],"receiptNo":"123ABCD","salespersonCode":"1234","customerId":"0053e689-81bb-403d-be15-e05332ceb85f"}'
};

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

```go ExampleExternalPOSSaleRequest
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"startedAt\": \"2024-01-01T10:00:00Z\",\n  \"posStore\": \"01\",\n  \"posUnit\": \"0101\",\n  \"pricesIncludeVAT\": true,\n  \"saleLines\": [\n    {\n      \"type\": \"Item\",\n      \"code\": \"ITEM-01\",\n      \"qty\": 1,\n      \"unitPrice\": 100,\n      \"amountIncludingVAT\": 100,\n      \"discountAmount\": 0,\n      \"description\": \"Super awesome item\",\n      \"vatPercent\": 25,\n      \"amount\": 80\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"paymentMethodCode\": \"CASH\",\n      \"description\": \"Cash payment\",\n      \"amountIncludingVAT\": 100,\n      \"additionalEftData\": {\n        \"eftType\": \"adyen\",\n        \"eftData\": \"Base64EncodedResponse\"\n      }\n    }\n  ],\n  \"receiptNo\": \"123ABCD\",\n  \"salespersonCode\": \"1234\",\n  \"customerId\": \"0053e689-81bb-403d-be15-e05332ceb85f\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale")

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

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"startedAt\": \"2024-01-01T10:00:00Z\",\n  \"posStore\": \"01\",\n  \"posUnit\": \"0101\",\n  \"pricesIncludeVAT\": true,\n  \"saleLines\": [\n    {\n      \"type\": \"Item\",\n      \"code\": \"ITEM-01\",\n      \"qty\": 1,\n      \"unitPrice\": 100,\n      \"amountIncludingVAT\": 100,\n      \"discountAmount\": 0,\n      \"description\": \"Super awesome item\",\n      \"vatPercent\": 25,\n      \"amount\": 80\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"paymentMethodCode\": \"CASH\",\n      \"description\": \"Cash payment\",\n      \"amountIncludingVAT\": 100,\n      \"additionalEftData\": {\n        \"eftType\": \"adyen\",\n        \"eftData\": \"Base64EncodedResponse\"\n      }\n    }\n  ],\n  \"receiptNo\": \"123ABCD\",\n  \"salespersonCode\": \"1234\",\n  \"customerId\": \"0053e689-81bb-403d-be15-e05332ceb85f\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"startedAt\": \"2024-01-01T10:00:00Z\",\n  \"posStore\": \"01\",\n  \"posUnit\": \"0101\",\n  \"pricesIncludeVAT\": true,\n  \"saleLines\": [\n    {\n      \"type\": \"Item\",\n      \"code\": \"ITEM-01\",\n      \"qty\": 1,\n      \"unitPrice\": 100,\n      \"amountIncludingVAT\": 100,\n      \"discountAmount\": 0,\n      \"description\": \"Super awesome item\",\n      \"vatPercent\": 25,\n      \"amount\": 80\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"paymentMethodCode\": \"CASH\",\n      \"description\": \"Cash payment\",\n      \"amountIncludingVAT\": 100,\n      \"additionalEftData\": {\n        \"eftType\": \"adyen\",\n        \"eftData\": \"Base64EncodedResponse\"\n      }\n    }\n  ],\n  \"receiptNo\": \"123ABCD\",\n  \"salespersonCode\": \"1234\",\n  \"customerId\": \"0053e689-81bb-403d-be15-e05332ceb85f\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale', [
  'body' => '{
  "startedAt": "2024-01-01T10:00:00Z",
  "posStore": "01",
  "posUnit": "0101",
  "pricesIncludeVAT": true,
  "saleLines": [
    {
      "type": "Item",
      "code": "ITEM-01",
      "qty": 1,
      "unitPrice": 100,
      "amountIncludingVAT": 100,
      "discountAmount": 0,
      "description": "Super awesome item",
      "vatPercent": 25,
      "amount": 80
    }
  ],
  "paymentLines": [
    {
      "paymentMethodCode": "CASH",
      "description": "Cash payment",
      "amountIncludingVAT": 100,
      "additionalEftData": {
        "eftType": "adyen",
        "eftData": "Base64EncodedResponse"
      }
    }
  ],
  "receiptNo": "123ABCD",
  "salespersonCode": "1234",
  "customerId": "0053e689-81bb-403d-be15-e05332ceb85f"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp ExampleExternalPOSSaleRequest
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"startedAt\": \"2024-01-01T10:00:00Z\",\n  \"posStore\": \"01\",\n  \"posUnit\": \"0101\",\n  \"pricesIncludeVAT\": true,\n  \"saleLines\": [\n    {\n      \"type\": \"Item\",\n      \"code\": \"ITEM-01\",\n      \"qty\": 1,\n      \"unitPrice\": 100,\n      \"amountIncludingVAT\": 100,\n      \"discountAmount\": 0,\n      \"description\": \"Super awesome item\",\n      \"vatPercent\": 25,\n      \"amount\": 80\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"paymentMethodCode\": \"CASH\",\n      \"description\": \"Cash payment\",\n      \"amountIncludingVAT\": 100,\n      \"additionalEftData\": {\n        \"eftType\": \"adyen\",\n        \"eftData\": \"Base64EncodedResponse\"\n      }\n    }\n  ],\n  \"receiptNo\": \"123ABCD\",\n  \"salespersonCode\": \"1234\",\n  \"customerId\": \"0053e689-81bb-403d-be15-e05332ceb85f\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift ExampleExternalPOSSaleRequest
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "startedAt": "2024-01-01T10:00:00Z",
  "posStore": "01",
  "posUnit": "0101",
  "pricesIncludeVAT": true,
  "saleLines": [
    [
      "type": "Item",
      "code": "ITEM-01",
      "qty": 1,
      "unitPrice": 100,
      "amountIncludingVAT": 100,
      "discountAmount": 0,
      "description": "Super awesome item",
      "vatPercent": 25,
      "amount": 80
    ]
  ],
  "paymentLines": [
    [
      "paymentMethodCode": "CASH",
      "description": "Cash payment",
      "amountIncludingVAT": 100,
      "additionalEftData": [
        "eftType": "adyen",
        "eftData": "Base64EncodedResponse"
      ]
    ]
  ],
  "receiptNo": "123ABCD",
  "salespersonCode": "1234",
  "customerId": "0053e689-81bb-403d-be15-e05332ceb85f"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/externalsale")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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