> 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 Global Entry

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

Endpoint for adding a new sale to Global Entry. The sale is identified by the combination of Store, POS Unit and Document No. This combination must be unique for the sale to be added.

Reference: https://docs.navipartner.com/apis/api-reference/pos/globalentry/post-global-entry

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

- `posStore` (string, required) — Identification of the store
- `posUnit` (string, required) — Identification of the POS unit
- `documentNo` (string, required) — Sales ticket no.
- `entryTime` (datetime, required)
- `entryType` (enum, required)
  - Allowed values: `Direct Sale`, `Credit Sale`
- `postingDate` (date, required)
- `fiscalNumber` (string, required)
- `salesAmount` (double, required)
- `discountAmount` (double, required)
- `totalAmountExclVAT` (double, required)
- `totalAmountInclVAT` (double, required)
- `totalVATAmount` (double, required)
- `company` (string, optional)
- `customerNo` (string, optional)
- `salesperson` (string, optional)
- `currencyCode` (string, optional)
- `currencyFactor` (double, optional)
- `salesLines` (list of CreateGlobalEntrySaleLine, optional) — List of sold items
- `paymentLines` (list of GlobalEntryPaymentLine, optional) — List of payments
- `posInfos` (list of POSInfo, optional) — List of Info entries
- `extensionFields` (list of ExtensionField, optional) — Additional data. Definition of fieldId and format of data in fieldValue have to be agreed with receiver of data

## Response

### 200

- `id` (UUID, required) — Unique identifier of the added entry

## Types

### CreateGlobalEntrySaleLine

- `lineNo` (integer, required)
- `type` (enum, required)
  - Allowed values: ` `, `G/L Account`, `Item`, `Customer`, `Voucher`, `Payout`, `Rounding`
- `code` (string, required)
- `quantity` (double, required)
- `baseQuantity` (double, required)
- `unitPrice` (double, required)
- `vatPct` (double, required)
- `lineDiscountPct` (double, required)
- `lineDiscountAmountExclVAT` (double, required)
- `lineDiscountAmountInclVAT` (double, required)
- `lineAmount` (double, required)
- `amountExclVAT` (double, required)
- `amountInclVAT` (double, required)
- `lineDiscountAmountExclVATLCY` (double, required)
- `lineDiscountAmountInclVATLCY` (double, required)
- `amountExclVATLCY` (double, required)
- `amountInclVATLCY` (double, required)
- `variantCode` (string, optional)
- `referenceNumber` (string, optional)
- `bomItemCode` (string, optional)
- `locationCode` (string, optional)
- `description` (string, optional)
- `description2` (string, optional)
- `unitOfMeasureCode` (string, optional)
- `currencyCode` (string, optional)
- `globalReference` (string, optional) — A unique reference to the sales line.
- `extensionFields` (list of ExtensionField, optional) — Additional data. Definition of fieldId and format of data in fieldValue have to be agreed with receiver of data

### GlobalEntryPaymentLine

- `lineNo` (integer, required)
- `paymentMethod` (string, required)
- `amountLCY` (double, required)
- `amount` (double, required)
- `documentNo` (string, optional) — Sales ticket no.
- `description` (string, optional)
- `currencyCode` (string, optional)
- `extensionFields` (list of ExtensionField, optional) — Additional data. Definition of fieldId and format of data in fieldValue have to be agreed with receiver of data

### POSInfo

- `lineNo` (integer, required)
- `saleLineNo` (integer, optional)
- `infoCode` (string, optional)
- `code` (string, optional)
- `description` (string, optional)
- `quantity` (double, optional)
- `price` (double, optional)
- `netAmount` (double, optional)
- `grossAmount` (double, optional)
- `discountAmount` (double, optional)
- `extensionFields` (list of ExtensionField, optional) — Additional data. Definition of fieldId and format of data in fieldValue have to be agreed with receiver of data

### ExtensionField

additional data. Definition of fieldId and format of data in fieldvalue have to be agreed

- `fieldId` (integer, required)
- `fieldValue` (string, required)

## Examples

**Request**

```json
{
  "posStore": "0321",
  "posUnit": "POS-031",
  "documentNo": "12345678",
  "entryTime": "2024-12-25T12:43:56Z",
  "entryType": "Direct Sale",
  "postingDate": "2024-12-25",
  "fiscalNumber": "F0078865",
  "salesAmount": 649.9,
  "discountAmount": 80,
  "totalAmountExclVAT": 519.92,
  "totalAmountInclVAT": 649.9,
  "totalVATAmount": 129.98,
  "company": "Sales Company",
  "customerNo": "D000188",
  "salesperson": "CLARK",
  "currencyCode": "",
  "currencyFactor": 1,
  "salesLines": [
    {
      "lineNo": 1,
      "type": "Item",
      "code": "80005",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 249.9,
      "vatPct": 25,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 249.9,
      "amountExclVAT": 199.92,
      "amountInclVAT": 249.9,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 199.92,
      "amountInclVATLCY": 249.9,
      "variantCode": "025",
      "referenceNumber": "9780201379624",
      "bomItemCode": "66",
      "locationCode": "LOC-01",
      "description": "Hummel Hamar Leggings",
      "description2": "Co:BLUE Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "D6E88A5E52E542F0AAA96F08F40B6EC9",
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to the custom field on sales line"
        }
      ]
    },
    {
      "lineNo": 2,
      "type": "Item",
      "code": "80006",
      "quantity": 2,
      "baseQuantity": 2,
      "unitPrice": 250,
      "vatPct": 25,
      "lineDiscountPct": 20,
      "lineDiscountAmountExclVAT": 80,
      "lineDiscountAmountInclVAT": 100,
      "lineAmount": 400,
      "amountExclVAT": 320,
      "amountInclVAT": 400,
      "lineDiscountAmountExclVATLCY": 80,
      "lineDiscountAmountInclVATLCY": 100,
      "amountExclVATLCY": 320,
      "amountInclVATLCY": 400,
      "variantCode": "L",
      "referenceNumber": "9780201379648",
      "locationCode": "LOC-01",
      "description": "Hummel Alta T-shirt",
      "description2": "Co:RED Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "84E18BA8D5494605B605CD6192068FC2"
    },
    {
      "lineNo": 3,
      "type": "Rounding",
      "code": "ROUNDINGS",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 0.1,
      "vatPct": 0,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 0,
      "amountExclVAT": 0.1,
      "amountInclVAT": 0.1,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 0.1,
      "amountInclVATLCY": 0.1,
      "locationCode": "LOC-01",
      "description": "Rounding",
      "unitOfMeasureCode": "",
      "currencyCode": ""
    }
  ],
  "paymentLines": [
    {
      "lineNo": 1,
      "paymentMethod": "CASH",
      "amountLCY": 650,
      "amount": 650,
      "documentNo": "12345678",
      "description": "Cash payment",
      "currencyCode": "",
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on payment line"
        }
      ]
    }
  ],
  "posInfos": [
    {
      "lineNo": 4,
      "saleLineNo": 1,
      "infoCode": "AFK",
      "code": "123-ABC",
      "description": "description",
      "quantity": 1,
      "price": 249.9,
      "netAmount": 199.92,
      "grossAmount": 249.9,
      "discountAmount": 0,
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on pos info"
        }
      ]
    }
  ],
  "extensionFields": [
    {
      "fieldId": 50100,
      "fieldValue": "value to apply to the custom field on pos entry"
    }
  ]
}
```

**Response**

```json
{
  "id": "4ca28ccc-e84b-4788-973c-c8ce5a59383b"
}
```

**SDK Code**

```python
import requests

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

payload = {
    "posStore": "0321",
    "posUnit": "POS-031",
    "documentNo": "12345678",
    "entryTime": "2024-12-25T12:43:56Z",
    "entryType": "Direct Sale",
    "postingDate": "2024-12-25",
    "fiscalNumber": "F0078865",
    "salesAmount": 649.9,
    "discountAmount": 80,
    "totalAmountExclVAT": 519.92,
    "totalAmountInclVAT": 649.9,
    "totalVATAmount": 129.98,
    "company": "Sales Company",
    "customerNo": "D000188",
    "salesperson": "CLARK",
    "currencyCode": "",
    "currencyFactor": 1,
    "salesLines": [
        {
            "lineNo": 1,
            "type": "Item",
            "code": "80005",
            "quantity": 1,
            "baseQuantity": 1,
            "unitPrice": 249.9,
            "vatPct": 25,
            "lineDiscountPct": 0,
            "lineDiscountAmountExclVAT": 0,
            "lineDiscountAmountInclVAT": 0,
            "lineAmount": 249.9,
            "amountExclVAT": 199.92,
            "amountInclVAT": 249.9,
            "lineDiscountAmountExclVATLCY": 0,
            "lineDiscountAmountInclVATLCY": 0,
            "amountExclVATLCY": 199.92,
            "amountInclVATLCY": 249.9,
            "variantCode": "025",
            "referenceNumber": "9780201379624",
            "bomItemCode": "66",
            "locationCode": "LOC-01",
            "description": "Hummel Hamar Leggings",
            "description2": "Co:BLUE Sz:L",
            "unitOfMeasureCode": "PCS",
            "currencyCode": "",
            "globalReference": "D6E88A5E52E542F0AAA96F08F40B6EC9",
            "extensionFields": [
                {
                    "fieldId": 50100,
                    "fieldValue": "value to apply to the custom field on sales line"
                }
            ]
        },
        {
            "lineNo": 2,
            "type": "Item",
            "code": "80006",
            "quantity": 2,
            "baseQuantity": 2,
            "unitPrice": 250,
            "vatPct": 25,
            "lineDiscountPct": 20,
            "lineDiscountAmountExclVAT": 80,
            "lineDiscountAmountInclVAT": 100,
            "lineAmount": 400,
            "amountExclVAT": 320,
            "amountInclVAT": 400,
            "lineDiscountAmountExclVATLCY": 80,
            "lineDiscountAmountInclVATLCY": 100,
            "amountExclVATLCY": 320,
            "amountInclVATLCY": 400,
            "variantCode": "L",
            "referenceNumber": "9780201379648",
            "locationCode": "LOC-01",
            "description": "Hummel Alta T-shirt",
            "description2": "Co:RED Sz:L",
            "unitOfMeasureCode": "PCS",
            "currencyCode": "",
            "globalReference": "84E18BA8D5494605B605CD6192068FC2"
        },
        {
            "lineNo": 3,
            "type": "Rounding",
            "code": "ROUNDINGS",
            "quantity": 1,
            "baseQuantity": 1,
            "unitPrice": 0.1,
            "vatPct": 0,
            "lineDiscountPct": 0,
            "lineDiscountAmountExclVAT": 0,
            "lineDiscountAmountInclVAT": 0,
            "lineAmount": 0,
            "amountExclVAT": 0.1,
            "amountInclVAT": 0.1,
            "lineDiscountAmountExclVATLCY": 0,
            "lineDiscountAmountInclVATLCY": 0,
            "amountExclVATLCY": 0.1,
            "amountInclVATLCY": 0.1,
            "locationCode": "LOC-01",
            "description": "Rounding",
            "unitOfMeasureCode": "",
            "currencyCode": ""
        }
    ],
    "paymentLines": [
        {
            "lineNo": 1,
            "paymentMethod": "CASH",
            "amountLCY": 650,
            "amount": 650,
            "documentNo": "12345678",
            "description": "Cash payment",
            "currencyCode": "",
            "extensionFields": [
                {
                    "fieldId": 50100,
                    "fieldValue": "value to apply to custom field on payment line"
                }
            ]
        }
    ],
    "posInfos": [
        {
            "lineNo": 4,
            "saleLineNo": 1,
            "infoCode": "AFK",
            "code": "123-ABC",
            "description": "description",
            "quantity": 1,
            "price": 249.9,
            "netAmount": 199.92,
            "grossAmount": 249.9,
            "discountAmount": 0,
            "extensionFields": [
                {
                    "fieldId": 50100,
                    "fieldValue": "value to apply to custom field on pos info"
                }
            ]
        }
    ],
    "extensionFields": [
        {
            "fieldId": 50100,
            "fieldValue": "value to apply to the custom field on pos entry"
        }
    ]
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/globalentry';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"posStore":"0321","posUnit":"POS-031","documentNo":"12345678","entryTime":"2024-12-25T12:43:56Z","entryType":"Direct Sale","postingDate":"2024-12-25","fiscalNumber":"F0078865","salesAmount":649.9,"discountAmount":80,"totalAmountExclVAT":519.92,"totalAmountInclVAT":649.9,"totalVATAmount":129.98,"company":"Sales Company","customerNo":"D000188","salesperson":"CLARK","currencyCode":"","currencyFactor":1,"salesLines":[{"lineNo":1,"type":"Item","code":"80005","quantity":1,"baseQuantity":1,"unitPrice":249.9,"vatPct":25,"lineDiscountPct":0,"lineDiscountAmountExclVAT":0,"lineDiscountAmountInclVAT":0,"lineAmount":249.9,"amountExclVAT":199.92,"amountInclVAT":249.9,"lineDiscountAmountExclVATLCY":0,"lineDiscountAmountInclVATLCY":0,"amountExclVATLCY":199.92,"amountInclVATLCY":249.9,"variantCode":"025","referenceNumber":"9780201379624","bomItemCode":"66","locationCode":"LOC-01","description":"Hummel Hamar Leggings","description2":"Co:BLUE Sz:L","unitOfMeasureCode":"PCS","currencyCode":"","globalReference":"D6E88A5E52E542F0AAA96F08F40B6EC9","extensionFields":[{"fieldId":50100,"fieldValue":"value to apply to the custom field on sales line"}]},{"lineNo":2,"type":"Item","code":"80006","quantity":2,"baseQuantity":2,"unitPrice":250,"vatPct":25,"lineDiscountPct":20,"lineDiscountAmountExclVAT":80,"lineDiscountAmountInclVAT":100,"lineAmount":400,"amountExclVAT":320,"amountInclVAT":400,"lineDiscountAmountExclVATLCY":80,"lineDiscountAmountInclVATLCY":100,"amountExclVATLCY":320,"amountInclVATLCY":400,"variantCode":"L","referenceNumber":"9780201379648","locationCode":"LOC-01","description":"Hummel Alta T-shirt","description2":"Co:RED Sz:L","unitOfMeasureCode":"PCS","currencyCode":"","globalReference":"84E18BA8D5494605B605CD6192068FC2"},{"lineNo":3,"type":"Rounding","code":"ROUNDINGS","quantity":1,"baseQuantity":1,"unitPrice":0.1,"vatPct":0,"lineDiscountPct":0,"lineDiscountAmountExclVAT":0,"lineDiscountAmountInclVAT":0,"lineAmount":0,"amountExclVAT":0.1,"amountInclVAT":0.1,"lineDiscountAmountExclVATLCY":0,"lineDiscountAmountInclVATLCY":0,"amountExclVATLCY":0.1,"amountInclVATLCY":0.1,"locationCode":"LOC-01","description":"Rounding","unitOfMeasureCode":"","currencyCode":""}],"paymentLines":[{"lineNo":1,"paymentMethod":"CASH","amountLCY":650,"amount":650,"documentNo":"12345678","description":"Cash payment","currencyCode":"","extensionFields":[{"fieldId":50100,"fieldValue":"value to apply to custom field on payment line"}]}],"posInfos":[{"lineNo":4,"saleLineNo":1,"infoCode":"AFK","code":"123-ABC","description":"description","quantity":1,"price":249.9,"netAmount":199.92,"grossAmount":249.9,"discountAmount":0,"extensionFields":[{"fieldId":50100,"fieldValue":"value to apply to custom field on pos info"}]}],"extensionFields":[{"fieldId":50100,"fieldValue":"value to apply to the custom field on pos entry"}]}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"posStore\": \"0321\",\n  \"posUnit\": \"POS-031\",\n  \"documentNo\": \"12345678\",\n  \"entryTime\": \"2024-12-25T12:43:56Z\",\n  \"entryType\": \"Direct Sale\",\n  \"postingDate\": \"2024-12-25\",\n  \"fiscalNumber\": \"F0078865\",\n  \"salesAmount\": 649.9,\n  \"discountAmount\": 80,\n  \"totalAmountExclVAT\": 519.92,\n  \"totalAmountInclVAT\": 649.9,\n  \"totalVATAmount\": 129.98,\n  \"company\": \"Sales Company\",\n  \"customerNo\": \"D000188\",\n  \"salesperson\": \"CLARK\",\n  \"currencyCode\": \"\",\n  \"currencyFactor\": 1,\n  \"salesLines\": [\n    {\n      \"lineNo\": 1,\n      \"type\": \"Item\",\n      \"code\": \"80005\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 249.9,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 249.9,\n      \"amountExclVAT\": 199.92,\n      \"amountInclVAT\": 249.9,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 199.92,\n      \"amountInclVATLCY\": 249.9,\n      \"variantCode\": \"025\",\n      \"referenceNumber\": \"9780201379624\",\n      \"bomItemCode\": \"66\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Hamar Leggings\",\n      \"description2\": \"Co:BLUE Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"D6E88A5E52E542F0AAA96F08F40B6EC9\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to the custom field on sales line\"\n        }\n      ]\n    },\n    {\n      \"lineNo\": 2,\n      \"type\": \"Item\",\n      \"code\": \"80006\",\n      \"quantity\": 2,\n      \"baseQuantity\": 2,\n      \"unitPrice\": 250,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 20,\n      \"lineDiscountAmountExclVAT\": 80,\n      \"lineDiscountAmountInclVAT\": 100,\n      \"lineAmount\": 400,\n      \"amountExclVAT\": 320,\n      \"amountInclVAT\": 400,\n      \"lineDiscountAmountExclVATLCY\": 80,\n      \"lineDiscountAmountInclVATLCY\": 100,\n      \"amountExclVATLCY\": 320,\n      \"amountInclVATLCY\": 400,\n      \"variantCode\": \"L\",\n      \"referenceNumber\": \"9780201379648\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Alta T-shirt\",\n      \"description2\": \"Co:RED Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"84E18BA8D5494605B605CD6192068FC2\"\n    },\n    {\n      \"lineNo\": 3,\n      \"type\": \"Rounding\",\n      \"code\": \"ROUNDINGS\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 0.1,\n      \"vatPct\": 0,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 0,\n      \"amountExclVAT\": 0.1,\n      \"amountInclVAT\": 0.1,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 0.1,\n      \"amountInclVATLCY\": 0.1,\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Rounding\",\n      \"unitOfMeasureCode\": \"\",\n      \"currencyCode\": \"\"\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"lineNo\": 1,\n      \"paymentMethod\": \"CASH\",\n      \"amountLCY\": 650,\n      \"amount\": 650,\n      \"documentNo\": \"12345678\",\n      \"description\": \"Cash payment\",\n      \"currencyCode\": \"\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on payment line\"\n        }\n      ]\n    }\n  ],\n  \"posInfos\": [\n    {\n      \"lineNo\": 4,\n      \"saleLineNo\": 1,\n      \"infoCode\": \"AFK\",\n      \"code\": \"123-ABC\",\n      \"description\": \"description\",\n      \"quantity\": 1,\n      \"price\": 249.9,\n      \"netAmount\": 199.92,\n      \"grossAmount\": 249.9,\n      \"discountAmount\": 0,\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on pos info\"\n        }\n      ]\n    }\n  ],\n  \"extensionFields\": [\n    {\n      \"fieldId\": 50100,\n      \"fieldValue\": \"value to apply to the custom field on pos entry\"\n    }\n  ]\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
require 'uri'
require 'net/http'

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

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  \"posStore\": \"0321\",\n  \"posUnit\": \"POS-031\",\n  \"documentNo\": \"12345678\",\n  \"entryTime\": \"2024-12-25T12:43:56Z\",\n  \"entryType\": \"Direct Sale\",\n  \"postingDate\": \"2024-12-25\",\n  \"fiscalNumber\": \"F0078865\",\n  \"salesAmount\": 649.9,\n  \"discountAmount\": 80,\n  \"totalAmountExclVAT\": 519.92,\n  \"totalAmountInclVAT\": 649.9,\n  \"totalVATAmount\": 129.98,\n  \"company\": \"Sales Company\",\n  \"customerNo\": \"D000188\",\n  \"salesperson\": \"CLARK\",\n  \"currencyCode\": \"\",\n  \"currencyFactor\": 1,\n  \"salesLines\": [\n    {\n      \"lineNo\": 1,\n      \"type\": \"Item\",\n      \"code\": \"80005\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 249.9,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 249.9,\n      \"amountExclVAT\": 199.92,\n      \"amountInclVAT\": 249.9,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 199.92,\n      \"amountInclVATLCY\": 249.9,\n      \"variantCode\": \"025\",\n      \"referenceNumber\": \"9780201379624\",\n      \"bomItemCode\": \"66\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Hamar Leggings\",\n      \"description2\": \"Co:BLUE Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"D6E88A5E52E542F0AAA96F08F40B6EC9\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to the custom field on sales line\"\n        }\n      ]\n    },\n    {\n      \"lineNo\": 2,\n      \"type\": \"Item\",\n      \"code\": \"80006\",\n      \"quantity\": 2,\n      \"baseQuantity\": 2,\n      \"unitPrice\": 250,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 20,\n      \"lineDiscountAmountExclVAT\": 80,\n      \"lineDiscountAmountInclVAT\": 100,\n      \"lineAmount\": 400,\n      \"amountExclVAT\": 320,\n      \"amountInclVAT\": 400,\n      \"lineDiscountAmountExclVATLCY\": 80,\n      \"lineDiscountAmountInclVATLCY\": 100,\n      \"amountExclVATLCY\": 320,\n      \"amountInclVATLCY\": 400,\n      \"variantCode\": \"L\",\n      \"referenceNumber\": \"9780201379648\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Alta T-shirt\",\n      \"description2\": \"Co:RED Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"84E18BA8D5494605B605CD6192068FC2\"\n    },\n    {\n      \"lineNo\": 3,\n      \"type\": \"Rounding\",\n      \"code\": \"ROUNDINGS\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 0.1,\n      \"vatPct\": 0,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 0,\n      \"amountExclVAT\": 0.1,\n      \"amountInclVAT\": 0.1,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 0.1,\n      \"amountInclVATLCY\": 0.1,\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Rounding\",\n      \"unitOfMeasureCode\": \"\",\n      \"currencyCode\": \"\"\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"lineNo\": 1,\n      \"paymentMethod\": \"CASH\",\n      \"amountLCY\": 650,\n      \"amount\": 650,\n      \"documentNo\": \"12345678\",\n      \"description\": \"Cash payment\",\n      \"currencyCode\": \"\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on payment line\"\n        }\n      ]\n    }\n  ],\n  \"posInfos\": [\n    {\n      \"lineNo\": 4,\n      \"saleLineNo\": 1,\n      \"infoCode\": \"AFK\",\n      \"code\": \"123-ABC\",\n      \"description\": \"description\",\n      \"quantity\": 1,\n      \"price\": 249.9,\n      \"netAmount\": 199.92,\n      \"grossAmount\": 249.9,\n      \"discountAmount\": 0,\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on pos info\"\n        }\n      ]\n    }\n  ],\n  \"extensionFields\": [\n    {\n      \"fieldId\": 50100,\n      \"fieldValue\": \"value to apply to the custom field on pos entry\"\n    }\n  ]\n}"

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.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/globalentry")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"posStore\": \"0321\",\n  \"posUnit\": \"POS-031\",\n  \"documentNo\": \"12345678\",\n  \"entryTime\": \"2024-12-25T12:43:56Z\",\n  \"entryType\": \"Direct Sale\",\n  \"postingDate\": \"2024-12-25\",\n  \"fiscalNumber\": \"F0078865\",\n  \"salesAmount\": 649.9,\n  \"discountAmount\": 80,\n  \"totalAmountExclVAT\": 519.92,\n  \"totalAmountInclVAT\": 649.9,\n  \"totalVATAmount\": 129.98,\n  \"company\": \"Sales Company\",\n  \"customerNo\": \"D000188\",\n  \"salesperson\": \"CLARK\",\n  \"currencyCode\": \"\",\n  \"currencyFactor\": 1,\n  \"salesLines\": [\n    {\n      \"lineNo\": 1,\n      \"type\": \"Item\",\n      \"code\": \"80005\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 249.9,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 249.9,\n      \"amountExclVAT\": 199.92,\n      \"amountInclVAT\": 249.9,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 199.92,\n      \"amountInclVATLCY\": 249.9,\n      \"variantCode\": \"025\",\n      \"referenceNumber\": \"9780201379624\",\n      \"bomItemCode\": \"66\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Hamar Leggings\",\n      \"description2\": \"Co:BLUE Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"D6E88A5E52E542F0AAA96F08F40B6EC9\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to the custom field on sales line\"\n        }\n      ]\n    },\n    {\n      \"lineNo\": 2,\n      \"type\": \"Item\",\n      \"code\": \"80006\",\n      \"quantity\": 2,\n      \"baseQuantity\": 2,\n      \"unitPrice\": 250,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 20,\n      \"lineDiscountAmountExclVAT\": 80,\n      \"lineDiscountAmountInclVAT\": 100,\n      \"lineAmount\": 400,\n      \"amountExclVAT\": 320,\n      \"amountInclVAT\": 400,\n      \"lineDiscountAmountExclVATLCY\": 80,\n      \"lineDiscountAmountInclVATLCY\": 100,\n      \"amountExclVATLCY\": 320,\n      \"amountInclVATLCY\": 400,\n      \"variantCode\": \"L\",\n      \"referenceNumber\": \"9780201379648\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Alta T-shirt\",\n      \"description2\": \"Co:RED Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"84E18BA8D5494605B605CD6192068FC2\"\n    },\n    {\n      \"lineNo\": 3,\n      \"type\": \"Rounding\",\n      \"code\": \"ROUNDINGS\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 0.1,\n      \"vatPct\": 0,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 0,\n      \"amountExclVAT\": 0.1,\n      \"amountInclVAT\": 0.1,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 0.1,\n      \"amountInclVATLCY\": 0.1,\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Rounding\",\n      \"unitOfMeasureCode\": \"\",\n      \"currencyCode\": \"\"\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"lineNo\": 1,\n      \"paymentMethod\": \"CASH\",\n      \"amountLCY\": 650,\n      \"amount\": 650,\n      \"documentNo\": \"12345678\",\n      \"description\": \"Cash payment\",\n      \"currencyCode\": \"\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on payment line\"\n        }\n      ]\n    }\n  ],\n  \"posInfos\": [\n    {\n      \"lineNo\": 4,\n      \"saleLineNo\": 1,\n      \"infoCode\": \"AFK\",\n      \"code\": \"123-ABC\",\n      \"description\": \"description\",\n      \"quantity\": 1,\n      \"price\": 249.9,\n      \"netAmount\": 199.92,\n      \"grossAmount\": 249.9,\n      \"discountAmount\": 0,\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on pos info\"\n        }\n      ]\n    }\n  ],\n  \"extensionFields\": [\n    {\n      \"fieldId\": 50100,\n      \"fieldValue\": \"value to apply to the custom field on pos entry\"\n    }\n  ]\n}")
  .asString();
```

```php
<?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/globalentry', [
  'body' => '{
  "posStore": "0321",
  "posUnit": "POS-031",
  "documentNo": "12345678",
  "entryTime": "2024-12-25T12:43:56Z",
  "entryType": "Direct Sale",
  "postingDate": "2024-12-25",
  "fiscalNumber": "F0078865",
  "salesAmount": 649.9,
  "discountAmount": 80,
  "totalAmountExclVAT": 519.92,
  "totalAmountInclVAT": 649.9,
  "totalVATAmount": 129.98,
  "company": "Sales Company",
  "customerNo": "D000188",
  "salesperson": "CLARK",
  "currencyCode": "",
  "currencyFactor": 1,
  "salesLines": [
    {
      "lineNo": 1,
      "type": "Item",
      "code": "80005",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 249.9,
      "vatPct": 25,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 249.9,
      "amountExclVAT": 199.92,
      "amountInclVAT": 249.9,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 199.92,
      "amountInclVATLCY": 249.9,
      "variantCode": "025",
      "referenceNumber": "9780201379624",
      "bomItemCode": "66",
      "locationCode": "LOC-01",
      "description": "Hummel Hamar Leggings",
      "description2": "Co:BLUE Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "D6E88A5E52E542F0AAA96F08F40B6EC9",
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to the custom field on sales line"
        }
      ]
    },
    {
      "lineNo": 2,
      "type": "Item",
      "code": "80006",
      "quantity": 2,
      "baseQuantity": 2,
      "unitPrice": 250,
      "vatPct": 25,
      "lineDiscountPct": 20,
      "lineDiscountAmountExclVAT": 80,
      "lineDiscountAmountInclVAT": 100,
      "lineAmount": 400,
      "amountExclVAT": 320,
      "amountInclVAT": 400,
      "lineDiscountAmountExclVATLCY": 80,
      "lineDiscountAmountInclVATLCY": 100,
      "amountExclVATLCY": 320,
      "amountInclVATLCY": 400,
      "variantCode": "L",
      "referenceNumber": "9780201379648",
      "locationCode": "LOC-01",
      "description": "Hummel Alta T-shirt",
      "description2": "Co:RED Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "84E18BA8D5494605B605CD6192068FC2"
    },
    {
      "lineNo": 3,
      "type": "Rounding",
      "code": "ROUNDINGS",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 0.1,
      "vatPct": 0,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 0,
      "amountExclVAT": 0.1,
      "amountInclVAT": 0.1,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 0.1,
      "amountInclVATLCY": 0.1,
      "locationCode": "LOC-01",
      "description": "Rounding",
      "unitOfMeasureCode": "",
      "currencyCode": ""
    }
  ],
  "paymentLines": [
    {
      "lineNo": 1,
      "paymentMethod": "CASH",
      "amountLCY": 650,
      "amount": 650,
      "documentNo": "12345678",
      "description": "Cash payment",
      "currencyCode": "",
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on payment line"
        }
      ]
    }
  ],
  "posInfos": [
    {
      "lineNo": 4,
      "saleLineNo": 1,
      "infoCode": "AFK",
      "code": "123-ABC",
      "description": "description",
      "quantity": 1,
      "price": 249.9,
      "netAmount": 199.92,
      "grossAmount": 249.9,
      "discountAmount": 0,
      "extensionFields": [
        {
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on pos info"
        }
      ]
    }
  ],
  "extensionFields": [
    {
      "fieldId": 50100,
      "fieldValue": "value to apply to the custom field on pos entry"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./pos/globalentry");
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  \"posStore\": \"0321\",\n  \"posUnit\": \"POS-031\",\n  \"documentNo\": \"12345678\",\n  \"entryTime\": \"2024-12-25T12:43:56Z\",\n  \"entryType\": \"Direct Sale\",\n  \"postingDate\": \"2024-12-25\",\n  \"fiscalNumber\": \"F0078865\",\n  \"salesAmount\": 649.9,\n  \"discountAmount\": 80,\n  \"totalAmountExclVAT\": 519.92,\n  \"totalAmountInclVAT\": 649.9,\n  \"totalVATAmount\": 129.98,\n  \"company\": \"Sales Company\",\n  \"customerNo\": \"D000188\",\n  \"salesperson\": \"CLARK\",\n  \"currencyCode\": \"\",\n  \"currencyFactor\": 1,\n  \"salesLines\": [\n    {\n      \"lineNo\": 1,\n      \"type\": \"Item\",\n      \"code\": \"80005\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 249.9,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 249.9,\n      \"amountExclVAT\": 199.92,\n      \"amountInclVAT\": 249.9,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 199.92,\n      \"amountInclVATLCY\": 249.9,\n      \"variantCode\": \"025\",\n      \"referenceNumber\": \"9780201379624\",\n      \"bomItemCode\": \"66\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Hamar Leggings\",\n      \"description2\": \"Co:BLUE Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"D6E88A5E52E542F0AAA96F08F40B6EC9\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to the custom field on sales line\"\n        }\n      ]\n    },\n    {\n      \"lineNo\": 2,\n      \"type\": \"Item\",\n      \"code\": \"80006\",\n      \"quantity\": 2,\n      \"baseQuantity\": 2,\n      \"unitPrice\": 250,\n      \"vatPct\": 25,\n      \"lineDiscountPct\": 20,\n      \"lineDiscountAmountExclVAT\": 80,\n      \"lineDiscountAmountInclVAT\": 100,\n      \"lineAmount\": 400,\n      \"amountExclVAT\": 320,\n      \"amountInclVAT\": 400,\n      \"lineDiscountAmountExclVATLCY\": 80,\n      \"lineDiscountAmountInclVATLCY\": 100,\n      \"amountExclVATLCY\": 320,\n      \"amountInclVATLCY\": 400,\n      \"variantCode\": \"L\",\n      \"referenceNumber\": \"9780201379648\",\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Hummel Alta T-shirt\",\n      \"description2\": \"Co:RED Sz:L\",\n      \"unitOfMeasureCode\": \"PCS\",\n      \"currencyCode\": \"\",\n      \"globalReference\": \"84E18BA8D5494605B605CD6192068FC2\"\n    },\n    {\n      \"lineNo\": 3,\n      \"type\": \"Rounding\",\n      \"code\": \"ROUNDINGS\",\n      \"quantity\": 1,\n      \"baseQuantity\": 1,\n      \"unitPrice\": 0.1,\n      \"vatPct\": 0,\n      \"lineDiscountPct\": 0,\n      \"lineDiscountAmountExclVAT\": 0,\n      \"lineDiscountAmountInclVAT\": 0,\n      \"lineAmount\": 0,\n      \"amountExclVAT\": 0.1,\n      \"amountInclVAT\": 0.1,\n      \"lineDiscountAmountExclVATLCY\": 0,\n      \"lineDiscountAmountInclVATLCY\": 0,\n      \"amountExclVATLCY\": 0.1,\n      \"amountInclVATLCY\": 0.1,\n      \"locationCode\": \"LOC-01\",\n      \"description\": \"Rounding\",\n      \"unitOfMeasureCode\": \"\",\n      \"currencyCode\": \"\"\n    }\n  ],\n  \"paymentLines\": [\n    {\n      \"lineNo\": 1,\n      \"paymentMethod\": \"CASH\",\n      \"amountLCY\": 650,\n      \"amount\": 650,\n      \"documentNo\": \"12345678\",\n      \"description\": \"Cash payment\",\n      \"currencyCode\": \"\",\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on payment line\"\n        }\n      ]\n    }\n  ],\n  \"posInfos\": [\n    {\n      \"lineNo\": 4,\n      \"saleLineNo\": 1,\n      \"infoCode\": \"AFK\",\n      \"code\": \"123-ABC\",\n      \"description\": \"description\",\n      \"quantity\": 1,\n      \"price\": 249.9,\n      \"netAmount\": 199.92,\n      \"grossAmount\": 249.9,\n      \"discountAmount\": 0,\n      \"extensionFields\": [\n        {\n          \"fieldId\": 50100,\n          \"fieldValue\": \"value to apply to custom field on pos info\"\n        }\n      ]\n    }\n  ],\n  \"extensionFields\": [\n    {\n      \"fieldId\": 50100,\n      \"fieldValue\": \"value to apply to the custom field on pos entry\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "posStore": "0321",
  "posUnit": "POS-031",
  "documentNo": "12345678",
  "entryTime": "2024-12-25T12:43:56Z",
  "entryType": "Direct Sale",
  "postingDate": "2024-12-25",
  "fiscalNumber": "F0078865",
  "salesAmount": 649.9,
  "discountAmount": 80,
  "totalAmountExclVAT": 519.92,
  "totalAmountInclVAT": 649.9,
  "totalVATAmount": 129.98,
  "company": "Sales Company",
  "customerNo": "D000188",
  "salesperson": "CLARK",
  "currencyCode": "",
  "currencyFactor": 1,
  "salesLines": [
    [
      "lineNo": 1,
      "type": "Item",
      "code": "80005",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 249.9,
      "vatPct": 25,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 249.9,
      "amountExclVAT": 199.92,
      "amountInclVAT": 249.9,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 199.92,
      "amountInclVATLCY": 249.9,
      "variantCode": "025",
      "referenceNumber": "9780201379624",
      "bomItemCode": "66",
      "locationCode": "LOC-01",
      "description": "Hummel Hamar Leggings",
      "description2": "Co:BLUE Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "D6E88A5E52E542F0AAA96F08F40B6EC9",
      "extensionFields": [
        [
          "fieldId": 50100,
          "fieldValue": "value to apply to the custom field on sales line"
        ]
      ]
    ],
    [
      "lineNo": 2,
      "type": "Item",
      "code": "80006",
      "quantity": 2,
      "baseQuantity": 2,
      "unitPrice": 250,
      "vatPct": 25,
      "lineDiscountPct": 20,
      "lineDiscountAmountExclVAT": 80,
      "lineDiscountAmountInclVAT": 100,
      "lineAmount": 400,
      "amountExclVAT": 320,
      "amountInclVAT": 400,
      "lineDiscountAmountExclVATLCY": 80,
      "lineDiscountAmountInclVATLCY": 100,
      "amountExclVATLCY": 320,
      "amountInclVATLCY": 400,
      "variantCode": "L",
      "referenceNumber": "9780201379648",
      "locationCode": "LOC-01",
      "description": "Hummel Alta T-shirt",
      "description2": "Co:RED Sz:L",
      "unitOfMeasureCode": "PCS",
      "currencyCode": "",
      "globalReference": "84E18BA8D5494605B605CD6192068FC2"
    ],
    [
      "lineNo": 3,
      "type": "Rounding",
      "code": "ROUNDINGS",
      "quantity": 1,
      "baseQuantity": 1,
      "unitPrice": 0.1,
      "vatPct": 0,
      "lineDiscountPct": 0,
      "lineDiscountAmountExclVAT": 0,
      "lineDiscountAmountInclVAT": 0,
      "lineAmount": 0,
      "amountExclVAT": 0.1,
      "amountInclVAT": 0.1,
      "lineDiscountAmountExclVATLCY": 0,
      "lineDiscountAmountInclVATLCY": 0,
      "amountExclVATLCY": 0.1,
      "amountInclVATLCY": 0.1,
      "locationCode": "LOC-01",
      "description": "Rounding",
      "unitOfMeasureCode": "",
      "currencyCode": ""
    ]
  ],
  "paymentLines": [
    [
      "lineNo": 1,
      "paymentMethod": "CASH",
      "amountLCY": 650,
      "amount": 650,
      "documentNo": "12345678",
      "description": "Cash payment",
      "currencyCode": "",
      "extensionFields": [
        [
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on payment line"
        ]
      ]
    ]
  ],
  "posInfos": [
    [
      "lineNo": 4,
      "saleLineNo": 1,
      "infoCode": "AFK",
      "code": "123-ABC",
      "description": "description",
      "quantity": 1,
      "price": 249.9,
      "netAmount": 199.92,
      "grossAmount": 249.9,
      "discountAmount": 0,
      "extensionFields": [
        [
          "fieldId": 50100,
          "fieldValue": "value to apply to custom field on pos info"
        ]
      ]
    ]
  ],
  "extensionFields": [
    [
      "fieldId": 50100,
      "fieldValue": "value to apply to the custom field on pos entry"
    ]
  ]
] 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/globalentry")! 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()
```