> 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 Sales Document

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

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

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

- `externalNo` (string, required) — Max. length 20 symbols.
- `documentType` (enum, required)
  - Allowed values: `order`, `returnOrder`
- `sellToCustomer` (SalesDocumentSellToCustomerRequest, required)
- `payments` (list of SalesDocumentPaymentsRequest, required)
- `salesDocumentLines` (list of SalesDocumentLinesRequest, required)
- `currencyCode` (string, optional) — Max. length 10 symbols.
- `currencyExchangeRate` (double, optional)
- `externalDocumentNo` (string, optional) — Max. length 35 symbols.
- `locationCode` (string, optional) — Max. length 10 symbols.
- `yourReference` (string, optional)
- `languageTag` (string, optional) — IETF BCP 47 / RFC 5646 language tag (e.g. "da-DK", "en-US").
- `pricesExcludingVat` (boolean, optional)
- `ticketReservationToken` (string, optional) — Used to link the sales document to a ticket reservation, enabling the system to associate ordered ticket items with their pre-reserved admissions. Obtained as the token from the Ticket Reservation API.
- `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 deserialization logic.
- `shipToCustomer` (SalesDocumentShipToCustomerRequest, optional)
- `shipment` (SalesDocumentShipmentRequest, optional)
- `comments` (list of SalesDocumentCommentsRequest, optional)
- `dimensions` (list of SalesDocumentDimensionRequest, optional) — List of dimensions to attach to the created document. Item, shipment fee and voucher lines inherit these unless the line supplies the same dimension code itself; comment lines do not inherit them. An empty or omitted array attaches nothing; a null value is treated the same as omitting the property. Supplying the same dimension code twice in one array rejects the whole request.

## Response

### 201

- `id` (UUID, required)

## Types

### SalesDocumentSellToCustomerRequest

- `name` (string, required) — Max. length 150 symbols.
- `address` (string, required) — Max. length 100 symbols.
- `postCode` (string, required) — Max. length 20 symbols.
- `city` (string, required) — Max. length 30 symbols.
- `email` (string, required) — Max. length 80 symbols.
- `no` (string, optional) — Max. length 10 symbols.
- `address2` (string, optional) — Max. length 50 symbols.
- `county` (string, optional) — Max. length 30 symbols.
- `countryCode` (string, optional) — Max. length 10 symbols.
- `contact` (string, optional) — Max. length 100 symbols.
- `phone` (string, optional) — Max. length 20 symbols.
- `ean` (string, optional) — Max. length 13 symbols.
- `vatRegistrationNo` (string, optional) — Max. length 20 symbols.
- `invoiceEmail` (string, optional) — Max. length 80 symbols.
- `customerTemplate` (string, optional) — Max. length 20 symbols. Customer template code to apply customer-specific defaults. If both customerTemplate and configurationTemplate are provided, this takes priority.
- `configurationTemplate` (string, optional) — Max. length 10 symbols. Configuration template code to apply customer setup defaults. Ignored if customerTemplate is also provided.

### SalesDocumentPaymentsRequest

- `paymentMethodType` (enum, required) — PaymentMethodType voucher is not supported with returnOrder. PaymentMethodType voucher is not supported when the document uses a foreign currency (currencyCode is set to a non-LCY value).
  - Allowed values: `paymentGateway`, `voucher`
- `externalPaymentMethodCode` (string, required) — Max. length 50 symbols. This field is required if payment method type is set to payment gateway.
- `paymentReference` (string, required) — Max. length 250 symbols. This field is required if payment method type is set to voucher.
- `paymentAmount` (double, required)
- `externalPaymentType` (string, optional) — Max. length 50 symbols.
- `parToken` (string, optional) — Max. length 50 symbols.
- `pspToken` (string, optional) — Max. length 64 symbols.
- `cardBrand` (string, optional) — Max. length 30 symbols.
- `maskedCardNumber` (string, optional) — Max. length 30 symbols.
- `cardExpiryDate` (string, optional) — Card expiry date in MM/YYYY format. Max. length 50 symbols.
- `cardAliasToken` (string, optional) — Max. length 80 symbols.
- `customFields` (SalesDocumentPaymentsCustomFieldsRequest, 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 deserialization logic.

### SalesDocumentLinesRequest

- `type` (enum, required) — When type comment is selected, the api will create comments that are going to be visible on the sales order lines. Type voucher is not supported with returnOrder. Type voucher is not supported when the document uses a foreign currency (currencyCode is set to a non-LCY value).
  - Allowed values: `item`, `comment`, `shipmentFee`, `voucher`
- `unitPrice` (double, required)
- `quantity` (double, required)
- `vatPercent` (double, required)
- `lineAmount` (double, required)
- `no` (string, optional) — Max. length 20 symbols, for lines with type shipmentFee 50 symbols. The no field or the barcodeNo field has to be populated.
- `variantCode` (string, optional) — Max. length 10 symbols.
- `barcodeNo` (string, optional) — Max. length 50 symbols. The item no and the variant code are going to be populated based on the barcodeNo field. The no field or the barcodeNo field has to be populated for type Item.
- `description` (string, optional) — Max. length 150 symbols.
- `unitOfMeasure` (string, optional)
- `requestedDeliveryDate` (date, optional)
- `voucherType` (string, optional) — Relevant for type voucher. It has to be populated if the barcodeNo is populated.
- `ticketReservationLineId` (UUID, optional) — Links this sales line to a specific ticket reservation request created through the Ticket Reservation APIs. Must be populated when the header-level Ticket Reservation Token is set. The value should match the lineId returned by the Ticket Reservation API when the reservation was created.
- `membershipId` (UUID, optional) — Links this sales line to a pre-existing membership. If no membership Id is provided and the sales line represents a membership sale, a new membership is created from the member information on the line.
- `membershipLifeCycleOptionId` (UUID, optional) — Links this sales line to a specific membership life cycle option. Must be populated when the when the sales line reshapes a membership with a specific life cycle option. The value should match the optionId returned by the Membership Life Cycle Options API.
- `memberFirstName` (string, optional) — Relevant for membership lines without a membershipId. Max. length 50 symbols.
- `memberLastName` (string, optional) — Relevant for membership lines without a membershipId. Max. length 50 symbols.
- `memberMiddleName` (string, optional) — Relevant for membership lines without a membershipId. Max. length 50 symbols.
- `memberEmail` (string, optional) — Relevant for membership lines without a membershipId. Max. length 80 symbols. A longer value, or one that is not a valid e-mail address, is rejected with 400 (earlier releases truncated a longer value to 80 characters).
- `memberPhoneNo` (string, optional) — Relevant for membership lines without a membershipId. Max. length 30 symbols.
- `memberBirthday` (date, optional) — Relevant for membership lines without a membershipId.
- `memberGender` (string, optional) — Relevant for membership lines without a membershipId. Accepted values - male, female, other. If omitted or set to any other value, it is treated as not specified.
- `memberAddress` (string, optional) — Relevant for membership lines without a membershipId. Max. length 100 symbols.
- `memberCity` (string, optional) — Relevant for membership lines without a membershipId. Max. length 50 symbols.
- `memberCountry` (string, optional) — Relevant for membership lines without a membershipId. Max. length 50 symbols.
- `memberPostCode` (string, optional) — Relevant for membership lines without a membershipId. Max. length 20 symbols.
- `memberNewsletter` (string, optional) — Relevant for membership lines without a membershipId. Accepted values - yes, no. If omitted or set to any other value, it is treated as not specified.
- `memberGdprApproval` (string, optional) — Relevant for membership lines without a membershipId. Accepted values - pending, accepted, rejected. If omitted, it is treated as not specified.
- `membershipActivationDate` (date, optional) — Relevant for membership lines without a membershipId. The date from which the membership should be active. Setup can dictate and override this date.
- `subscription` (boolean, optional) — Sells the membership as a subscription: the card is stored as the default member payment method and the membership is enrolled in internal auto-renewal. Defaults to false. Applies to membership lines that create, confirm, renew, upgrade or extend a membership; ignored on other lines. Requires a captured card payment carrying pspToken and parToken, a customer email on the header, and recurring payments configured on the membership type the line results in - for an upgrade, the life cycle option's target type. With several captured cards, the last one becomes the default; only a card on a subscription-capable gateway - today Adyen - can be charged at renewal. The line is rejected when those requirements are not met, or when the membership's subscription is blocked or has a pending partial-regret refund.
- `externalLineId` (string, optional) — Unique external identifier for the line within this order. This is required if you want to reference this line as the parent of another line in the document. The provided value must be unique within the document and must not exceed 100 characters.
- `parentExternalLineId` (string, optional) — Parent line identifier. This is required if this line is a component of a bundle. The value provided must be specified in the `externalLineId` field of another line in the same document.
- `dimensions` (list of SalesDocumentDimensionRequest, optional) — List of dimensions to attach to this line. When the sales document is created, these dimensions are merged on top of the dimensions the line inherits from the document header and from default dimension setup, and a dimension supplied here wins when the same dimension code comes from both sides. Comment lines inherit nothing, so they carry only the dimensions supplied here. An empty or omitted array changes nothing and cannot remove inherited dimensions; a null value is treated the same as omitting the property. Supplying the same dimension code twice in one array rejects the whole request. Dimensions supplied on a shipment fee line that is converted to a comment (zero quantity and amount) are stored but not applied.
- `customFields` (SalesDocumentLinesCustomFieldsRequest, 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 deserialization logic.

### SalesDocumentCustomFieldsRequest

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

### SalesDocumentShipToCustomerRequest

- `name` (string, required) — Max. length 150 symbols.
- `address` (string, required) — Max. length 100 symbols.
- `postCode` (string, required) — Max. length 20 symbols.
- `city` (string, required) — Max. length 30 symbols.
- `address2` (string, optional) — Max. length 50 symbols.
- `county` (string, optional) — Max. length 30 symbols.
- `countryCode` (string, optional) — Max. length 10 symbols.
- `contact` (string, optional) — Max. length 100 symbols.

### SalesDocumentShipmentRequest

- `shipmentMethod` (string, required) — Max. length 50 symbols.
- `shipmentService` (string, optional) — Max. length 50 symbols.

### SalesDocumentCommentsRequest

- `comment` (string, required) — These are internal comments that are going to appear on the record links of the document. Max. length 1024 symbols.

### SalesDocumentDimensionRequest

- `code` (string, required) — Max. length 20 symbols. Surrounding whitespace is trimmed and the value is upper-cased before it is validated.
- `valueCode` (string, required) — Max. length 20 symbols. Must be an existing, non-blocked value for the given dimension code, and one that can be posted to. Surrounding whitespace is trimmed and the value is upper-cased before it is validated. Only the individual values are checked when the document is received - a blocked combination of dimensions, or another posting rule, surfaces later when the document is processed or posted rather than on this request.

### SalesDocumentPaymentsCustomFieldsRequest

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

### SalesDocumentLinesCustomFieldsRequest

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

## Examples

### Example Sales Document Request

**Request**

```json
{
  "externalNo": "WEBP000000001",
  "documentType": "order",
  "sellToCustomer": {
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  },
  "payments": [
    {
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 2000,
      "externalPaymentType": "mc",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    },
    {
      "paymentMethodType": "voucher",
      "externalPaymentMethodCode": "",
      "paymentReference": "2807000107658",
      "paymentAmount": 500,
      "externalPaymentType": "",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "salesDocumentLines": [
    {
      "type": "item",
      "unitPrice": 2000,
      "quantity": 2,
      "vatPercent": 25,
      "lineAmount": 2000,
      "no": "1100",
      "variantCode": "",
      "barcodeNo": "",
      "description": "test item",
      "unitOfMeasure": "",
      "externalLineId": "ABCDEFGH-1234567890",
      "parentExternalLineId": "",
      "dimensions": [
        {
          "code": "PROJECT",
          "valueCode": "P-001"
        }
      ],
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "currencyCode": "DKK",
  "currencyExchangeRate": 1,
  "externalDocumentNo": "WEBORD-123",
  "yourReference": "REF-789",
  "languageTag": "da-DK",
  "pricesExcludingVat": false,
  "customFields": {
    "myCustomField1": "myCustomField1Value",
    "myCustomField2": "myCustomField2Value"
  },
  "shipToCustomer": {
    "name": "John Smith",
    "address": "456 Shipping Avenue",
    "postCode": "10002",
    "city": "New York City",
    "address2": "Floor 2",
    "county": "New York",
    "countryCode": "US",
    "contact": "John Smith"
  },
  "comments": [
    {
      "comment": "This is a comment."
    }
  ],
  "dimensions": [
    {
      "code": "DEPARTMENT",
      "valueCode": "SALES"
    },
    {
      "code": "PROJECT",
      "valueCode": "P-001"
    }
  ]
}
```

**Response**

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

**SDK Code**

```python Example Sales Document Request
import requests

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

payload = {
    "externalNo": "WEBP000000001",
    "documentType": "order",
    "sellToCustomer": {
        "name": "Acme Corporation",
        "address": "123 Main Street",
        "postCode": "10001",
        "city": "New York",
        "email": "jane.doe@acme.com",
        "no": "CUST-10001",
        "address2": "Suite 400",
        "county": "New York",
        "countryCode": "US",
        "contact": "Jane Doe",
        "phone": "+1-555-123-4567",
        "ean": "1234567890123",
        "vatRegistrationNo": "US123456789",
        "invoiceEmail": "invoices@acme.com",
        "customerTemplate": "DOMESTIC",
        "configurationTemplate": "CUST000001"
    },
    "payments": [
        {
            "paymentMethodType": "paymentGateway",
            "externalPaymentMethodCode": "adyen_cc",
            "paymentReference": "Z3ZR6HT5BNVPZQT5",
            "paymentAmount": 2000,
            "externalPaymentType": "mc",
            "customFields": {
                "myCustomField1": "myCustomField1Value",
                "myCustomField2": "myCustomField2Value"
            }
        },
        {
            "paymentMethodType": "voucher",
            "externalPaymentMethodCode": "",
            "paymentReference": "2807000107658",
            "paymentAmount": 500,
            "externalPaymentType": "",
            "customFields": {
                "myCustomField1": "myCustomField1Value",
                "myCustomField2": "myCustomField2Value"
            }
        }
    ],
    "salesDocumentLines": [
        {
            "type": "item",
            "unitPrice": 2000,
            "quantity": 2,
            "vatPercent": 25,
            "lineAmount": 2000,
            "no": "1100",
            "variantCode": "",
            "barcodeNo": "",
            "description": "test item",
            "unitOfMeasure": "",
            "externalLineId": "ABCDEFGH-1234567890",
            "parentExternalLineId": "",
            "dimensions": [
                {
                    "code": "PROJECT",
                    "valueCode": "P-001"
                }
            ],
            "customFields": {
                "myCustomField1": "myCustomField1Value",
                "myCustomField2": "myCustomField2Value"
            }
        }
    ],
    "currencyCode": "DKK",
    "currencyExchangeRate": 1,
    "externalDocumentNo": "WEBORD-123",
    "yourReference": "REF-789",
    "languageTag": "da-DK",
    "pricesExcludingVat": False,
    "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
    },
    "shipToCustomer": {
        "name": "John Smith",
        "address": "456 Shipping Avenue",
        "postCode": "10002",
        "city": "New York City",
        "address2": "Floor 2",
        "county": "New York",
        "countryCode": "US",
        "contact": "John Smith"
    },
    "comments": [{ "comment": "This is a comment." }],
    "dimensions": [
        {
            "code": "DEPARTMENT",
            "valueCode": "SALES"
        },
        {
            "code": "PROJECT",
            "valueCode": "P-001"
        }
    ]
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example Sales Document Request
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"externalNo":"WEBP000000001","documentType":"order","sellToCustomer":{"name":"Acme Corporation","address":"123 Main Street","postCode":"10001","city":"New York","email":"jane.doe@acme.com","no":"CUST-10001","address2":"Suite 400","county":"New York","countryCode":"US","contact":"Jane Doe","phone":"+1-555-123-4567","ean":"1234567890123","vatRegistrationNo":"US123456789","invoiceEmail":"invoices@acme.com","customerTemplate":"DOMESTIC","configurationTemplate":"CUST000001"},"payments":[{"paymentMethodType":"paymentGateway","externalPaymentMethodCode":"adyen_cc","paymentReference":"Z3ZR6HT5BNVPZQT5","paymentAmount":2000,"externalPaymentType":"mc","customFields":{"myCustomField1":"myCustomField1Value","myCustomField2":"myCustomField2Value"}},{"paymentMethodType":"voucher","externalPaymentMethodCode":"","paymentReference":"2807000107658","paymentAmount":500,"externalPaymentType":"","customFields":{"myCustomField1":"myCustomField1Value","myCustomField2":"myCustomField2Value"}}],"salesDocumentLines":[{"type":"item","unitPrice":2000,"quantity":2,"vatPercent":25,"lineAmount":2000,"no":"1100","variantCode":"","barcodeNo":"","description":"test item","unitOfMeasure":"","externalLineId":"ABCDEFGH-1234567890","parentExternalLineId":"","dimensions":[{"code":"PROJECT","valueCode":"P-001"}],"customFields":{"myCustomField1":"myCustomField1Value","myCustomField2":"myCustomField2Value"}}],"currencyCode":"DKK","currencyExchangeRate":1,"externalDocumentNo":"WEBORD-123","yourReference":"REF-789","languageTag":"da-DK","pricesExcludingVat":false,"customFields":{"myCustomField1":"myCustomField1Value","myCustomField2":"myCustomField2Value"},"shipToCustomer":{"name":"John Smith","address":"456 Shipping Avenue","postCode":"10002","city":"New York City","address2":"Floor 2","county":"New York","countryCode":"US","contact":"John Smith"},"comments":[{"comment":"This is a comment."}],"dimensions":[{"code":"DEPARTMENT","valueCode":"SALES"},{"code":"PROJECT","valueCode":"P-001"}]}'
};

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

```go Example Sales Document Request
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"externalNo\": \"WEBP000000001\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 2000,\n      \"externalPaymentType\": \"mc\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    },\n    {\n      \"paymentMethodType\": \"voucher\",\n      \"externalPaymentMethodCode\": \"\",\n      \"paymentReference\": \"2807000107658\",\n      \"paymentAmount\": 500,\n      \"externalPaymentType\": \"\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 2000,\n      \"quantity\": 2,\n      \"vatPercent\": 25,\n      \"lineAmount\": 2000,\n      \"no\": \"1100\",\n      \"variantCode\": \"\",\n      \"barcodeNo\": \"\",\n      \"description\": \"test item\",\n      \"unitOfMeasure\": \"\",\n      \"externalLineId\": \"ABCDEFGH-1234567890\",\n      \"parentExternalLineId\": \"\",\n      \"dimensions\": [\n        {\n          \"code\": \"PROJECT\",\n          \"valueCode\": \"P-001\"\n        }\n      ],\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"currencyExchangeRate\": 1,\n  \"externalDocumentNo\": \"WEBORD-123\",\n  \"yourReference\": \"REF-789\",\n  \"languageTag\": \"da-DK\",\n  \"pricesExcludingVat\": false,\n  \"customFields\": {\n    \"myCustomField1\": \"myCustomField1Value\",\n    \"myCustomField2\": \"myCustomField2Value\"\n  },\n  \"shipToCustomer\": {\n    \"name\": \"John Smith\",\n    \"address\": \"456 Shipping Avenue\",\n    \"postCode\": \"10002\",\n    \"city\": \"New York City\",\n    \"address2\": \"Floor 2\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"John Smith\"\n  },\n  \"comments\": [\n    {\n      \"comment\": \"This is a comment.\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"code\": \"DEPARTMENT\",\n      \"valueCode\": \"SALES\"\n    },\n    {\n      \"code\": \"PROJECT\",\n      \"valueCode\": \"P-001\"\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 Example Sales Document Request
require 'uri'
require 'net/http'

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

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  \"externalNo\": \"WEBP000000001\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 2000,\n      \"externalPaymentType\": \"mc\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    },\n    {\n      \"paymentMethodType\": \"voucher\",\n      \"externalPaymentMethodCode\": \"\",\n      \"paymentReference\": \"2807000107658\",\n      \"paymentAmount\": 500,\n      \"externalPaymentType\": \"\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 2000,\n      \"quantity\": 2,\n      \"vatPercent\": 25,\n      \"lineAmount\": 2000,\n      \"no\": \"1100\",\n      \"variantCode\": \"\",\n      \"barcodeNo\": \"\",\n      \"description\": \"test item\",\n      \"unitOfMeasure\": \"\",\n      \"externalLineId\": \"ABCDEFGH-1234567890\",\n      \"parentExternalLineId\": \"\",\n      \"dimensions\": [\n        {\n          \"code\": \"PROJECT\",\n          \"valueCode\": \"P-001\"\n        }\n      ],\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"currencyExchangeRate\": 1,\n  \"externalDocumentNo\": \"WEBORD-123\",\n  \"yourReference\": \"REF-789\",\n  \"languageTag\": \"da-DK\",\n  \"pricesExcludingVat\": false,\n  \"customFields\": {\n    \"myCustomField1\": \"myCustomField1Value\",\n    \"myCustomField2\": \"myCustomField2Value\"\n  },\n  \"shipToCustomer\": {\n    \"name\": \"John Smith\",\n    \"address\": \"456 Shipping Avenue\",\n    \"postCode\": \"10002\",\n    \"city\": \"New York City\",\n    \"address2\": \"Floor 2\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"John Smith\"\n  },\n  \"comments\": [\n    {\n      \"comment\": \"This is a comment.\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"code\": \"DEPARTMENT\",\n      \"valueCode\": \"SALES\"\n    },\n    {\n      \"code\": \"PROJECT\",\n      \"valueCode\": \"P-001\"\n    }\n  ]\n}"

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

```java Example Sales Document Request
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./ecommerce/documents")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"externalNo\": \"WEBP000000001\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 2000,\n      \"externalPaymentType\": \"mc\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    },\n    {\n      \"paymentMethodType\": \"voucher\",\n      \"externalPaymentMethodCode\": \"\",\n      \"paymentReference\": \"2807000107658\",\n      \"paymentAmount\": 500,\n      \"externalPaymentType\": \"\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 2000,\n      \"quantity\": 2,\n      \"vatPercent\": 25,\n      \"lineAmount\": 2000,\n      \"no\": \"1100\",\n      \"variantCode\": \"\",\n      \"barcodeNo\": \"\",\n      \"description\": \"test item\",\n      \"unitOfMeasure\": \"\",\n      \"externalLineId\": \"ABCDEFGH-1234567890\",\n      \"parentExternalLineId\": \"\",\n      \"dimensions\": [\n        {\n          \"code\": \"PROJECT\",\n          \"valueCode\": \"P-001\"\n        }\n      ],\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"currencyExchangeRate\": 1,\n  \"externalDocumentNo\": \"WEBORD-123\",\n  \"yourReference\": \"REF-789\",\n  \"languageTag\": \"da-DK\",\n  \"pricesExcludingVat\": false,\n  \"customFields\": {\n    \"myCustomField1\": \"myCustomField1Value\",\n    \"myCustomField2\": \"myCustomField2Value\"\n  },\n  \"shipToCustomer\": {\n    \"name\": \"John Smith\",\n    \"address\": \"456 Shipping Avenue\",\n    \"postCode\": \"10002\",\n    \"city\": \"New York City\",\n    \"address2\": \"Floor 2\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"John Smith\"\n  },\n  \"comments\": [\n    {\n      \"comment\": \"This is a comment.\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"code\": \"DEPARTMENT\",\n      \"valueCode\": \"SALES\"\n    },\n    {\n      \"code\": \"PROJECT\",\n      \"valueCode\": \"P-001\"\n    }\n  ]\n}")
  .asString();
```

```php Example Sales Document Request
<?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./ecommerce/documents', [
  'body' => '{
  "externalNo": "WEBP000000001",
  "documentType": "order",
  "sellToCustomer": {
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  },
  "payments": [
    {
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 2000,
      "externalPaymentType": "mc",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    },
    {
      "paymentMethodType": "voucher",
      "externalPaymentMethodCode": "",
      "paymentReference": "2807000107658",
      "paymentAmount": 500,
      "externalPaymentType": "",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "salesDocumentLines": [
    {
      "type": "item",
      "unitPrice": 2000,
      "quantity": 2,
      "vatPercent": 25,
      "lineAmount": 2000,
      "no": "1100",
      "variantCode": "",
      "barcodeNo": "",
      "description": "test item",
      "unitOfMeasure": "",
      "externalLineId": "ABCDEFGH-1234567890",
      "parentExternalLineId": "",
      "dimensions": [
        {
          "code": "PROJECT",
          "valueCode": "P-001"
        }
      ],
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "currencyCode": "DKK",
  "currencyExchangeRate": 1,
  "externalDocumentNo": "WEBORD-123",
  "yourReference": "REF-789",
  "languageTag": "da-DK",
  "pricesExcludingVat": false,
  "customFields": {
    "myCustomField1": "myCustomField1Value",
    "myCustomField2": "myCustomField2Value"
  },
  "shipToCustomer": {
    "name": "John Smith",
    "address": "456 Shipping Avenue",
    "postCode": "10002",
    "city": "New York City",
    "address2": "Floor 2",
    "county": "New York",
    "countryCode": "US",
    "contact": "John Smith"
  },
  "comments": [
    {
      "comment": "This is a comment."
    }
  ],
  "dimensions": [
    {
      "code": "DEPARTMENT",
      "valueCode": "SALES"
    },
    {
      "code": "PROJECT",
      "valueCode": "P-001"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Example Sales Document Request
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents");
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  \"externalNo\": \"WEBP000000001\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 2000,\n      \"externalPaymentType\": \"mc\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    },\n    {\n      \"paymentMethodType\": \"voucher\",\n      \"externalPaymentMethodCode\": \"\",\n      \"paymentReference\": \"2807000107658\",\n      \"paymentAmount\": 500,\n      \"externalPaymentType\": \"\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 2000,\n      \"quantity\": 2,\n      \"vatPercent\": 25,\n      \"lineAmount\": 2000,\n      \"no\": \"1100\",\n      \"variantCode\": \"\",\n      \"barcodeNo\": \"\",\n      \"description\": \"test item\",\n      \"unitOfMeasure\": \"\",\n      \"externalLineId\": \"ABCDEFGH-1234567890\",\n      \"parentExternalLineId\": \"\",\n      \"dimensions\": [\n        {\n          \"code\": \"PROJECT\",\n          \"valueCode\": \"P-001\"\n        }\n      ],\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"currencyExchangeRate\": 1,\n  \"externalDocumentNo\": \"WEBORD-123\",\n  \"yourReference\": \"REF-789\",\n  \"languageTag\": \"da-DK\",\n  \"pricesExcludingVat\": false,\n  \"customFields\": {\n    \"myCustomField1\": \"myCustomField1Value\",\n    \"myCustomField2\": \"myCustomField2Value\"\n  },\n  \"shipToCustomer\": {\n    \"name\": \"John Smith\",\n    \"address\": \"456 Shipping Avenue\",\n    \"postCode\": \"10002\",\n    \"city\": \"New York City\",\n    \"address2\": \"Floor 2\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"John Smith\"\n  },\n  \"comments\": [\n    {\n      \"comment\": \"This is a comment.\"\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"code\": \"DEPARTMENT\",\n      \"valueCode\": \"SALES\"\n    },\n    {\n      \"code\": \"PROJECT\",\n      \"valueCode\": \"P-001\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example Sales Document Request
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "externalNo": "WEBP000000001",
  "documentType": "order",
  "sellToCustomer": [
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  ],
  "payments": [
    [
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 2000,
      "externalPaymentType": "mc",
      "customFields": [
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      ]
    ],
    [
      "paymentMethodType": "voucher",
      "externalPaymentMethodCode": "",
      "paymentReference": "2807000107658",
      "paymentAmount": 500,
      "externalPaymentType": "",
      "customFields": [
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      ]
    ]
  ],
  "salesDocumentLines": [
    [
      "type": "item",
      "unitPrice": 2000,
      "quantity": 2,
      "vatPercent": 25,
      "lineAmount": 2000,
      "no": "1100",
      "variantCode": "",
      "barcodeNo": "",
      "description": "test item",
      "unitOfMeasure": "",
      "externalLineId": "ABCDEFGH-1234567890",
      "parentExternalLineId": "",
      "dimensions": [
        [
          "code": "PROJECT",
          "valueCode": "P-001"
        ]
      ],
      "customFields": [
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      ]
    ]
  ],
  "currencyCode": "DKK",
  "currencyExchangeRate": 1,
  "externalDocumentNo": "WEBORD-123",
  "yourReference": "REF-789",
  "languageTag": "da-DK",
  "pricesExcludingVat": false,
  "customFields": [
    "myCustomField1": "myCustomField1Value",
    "myCustomField2": "myCustomField2Value"
  ],
  "shipToCustomer": [
    "name": "John Smith",
    "address": "456 Shipping Avenue",
    "postCode": "10002",
    "city": "New York City",
    "address2": "Floor 2",
    "county": "New York",
    "countryCode": "US",
    "contact": "John Smith"
  ],
  "comments": [["comment": "This is a comment."]],
  "dimensions": [
    [
      "code": "DEPARTMENT",
      "valueCode": "SALES"
    ],
    [
      "code": "PROJECT",
      "valueCode": "P-001"
    ]
  ]
] 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./ecommerce/documents")! 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()
```

### Example Membership Renewal With Subscription

**Request**

```json
{
  "externalNo": "WEBP000000002",
  "documentType": "order",
  "sellToCustomer": {
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  },
  "payments": [
    {
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 157,
      "externalPaymentType": "visa",
      "parToken": "V0010013820230419113052",
      "pspToken": "P6DNXVCR8J4TLM92",
      "cardBrand": "visa",
      "maskedCardNumber": "411111******1111",
      "cardExpiryDate": "03/2030",
      "cardAliasToken": "L8KQ2WX7YT3NBV61",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "salesDocumentLines": [
    {
      "type": "item",
      "unitPrice": 157,
      "quantity": 1,
      "vatPercent": 25,
      "lineAmount": 157,
      "no": "320100-RENEW",
      "description": "Renew GOLD Membership",
      "membershipId": "3a8b7c47-3228-4985-8bf0-bba09653f063",
      "membershipLifeCycleOptionId": "bbe793c7-2489-43b7-ab77-23577d59ae71",
      "subscription": true
    }
  ],
  "currencyCode": "DKK",
  "pricesExcludingVat": false
}
```

**Response**

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

**SDK Code**

```python Example Membership Renewal With Subscription
import requests

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

payload = {
    "externalNo": "WEBP000000002",
    "documentType": "order",
    "sellToCustomer": {
        "name": "Acme Corporation",
        "address": "123 Main Street",
        "postCode": "10001",
        "city": "New York",
        "email": "jane.doe@acme.com",
        "no": "CUST-10001",
        "address2": "Suite 400",
        "county": "New York",
        "countryCode": "US",
        "contact": "Jane Doe",
        "phone": "+1-555-123-4567",
        "ean": "1234567890123",
        "vatRegistrationNo": "US123456789",
        "invoiceEmail": "invoices@acme.com",
        "customerTemplate": "DOMESTIC",
        "configurationTemplate": "CUST000001"
    },
    "payments": [
        {
            "paymentMethodType": "paymentGateway",
            "externalPaymentMethodCode": "adyen_cc",
            "paymentReference": "Z3ZR6HT5BNVPZQT5",
            "paymentAmount": 157,
            "externalPaymentType": "visa",
            "parToken": "V0010013820230419113052",
            "pspToken": "P6DNXVCR8J4TLM92",
            "cardBrand": "visa",
            "maskedCardNumber": "411111******1111",
            "cardExpiryDate": "03/2030",
            "cardAliasToken": "L8KQ2WX7YT3NBV61",
            "customFields": {
                "myCustomField1": "myCustomField1Value",
                "myCustomField2": "myCustomField2Value"
            }
        }
    ],
    "salesDocumentLines": [
        {
            "type": "item",
            "unitPrice": 157,
            "quantity": 1,
            "vatPercent": 25,
            "lineAmount": 157,
            "no": "320100-RENEW",
            "description": "Renew GOLD Membership",
            "membershipId": "3a8b7c47-3228-4985-8bf0-bba09653f063",
            "membershipLifeCycleOptionId": "bbe793c7-2489-43b7-ab77-23577d59ae71",
            "subscription": True
        }
    ],
    "currencyCode": "DKK",
    "pricesExcludingVat": False
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example Membership Renewal With Subscription
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"externalNo":"WEBP000000002","documentType":"order","sellToCustomer":{"name":"Acme Corporation","address":"123 Main Street","postCode":"10001","city":"New York","email":"jane.doe@acme.com","no":"CUST-10001","address2":"Suite 400","county":"New York","countryCode":"US","contact":"Jane Doe","phone":"+1-555-123-4567","ean":"1234567890123","vatRegistrationNo":"US123456789","invoiceEmail":"invoices@acme.com","customerTemplate":"DOMESTIC","configurationTemplate":"CUST000001"},"payments":[{"paymentMethodType":"paymentGateway","externalPaymentMethodCode":"adyen_cc","paymentReference":"Z3ZR6HT5BNVPZQT5","paymentAmount":157,"externalPaymentType":"visa","parToken":"V0010013820230419113052","pspToken":"P6DNXVCR8J4TLM92","cardBrand":"visa","maskedCardNumber":"411111******1111","cardExpiryDate":"03/2030","cardAliasToken":"L8KQ2WX7YT3NBV61","customFields":{"myCustomField1":"myCustomField1Value","myCustomField2":"myCustomField2Value"}}],"salesDocumentLines":[{"type":"item","unitPrice":157,"quantity":1,"vatPercent":25,"lineAmount":157,"no":"320100-RENEW","description":"Renew GOLD Membership","membershipId":"3a8b7c47-3228-4985-8bf0-bba09653f063","membershipLifeCycleOptionId":"bbe793c7-2489-43b7-ab77-23577d59ae71","subscription":true}],"currencyCode":"DKK","pricesExcludingVat":false}'
};

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

```go Example Membership Renewal With Subscription
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"externalNo\": \"WEBP000000002\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 157,\n      \"externalPaymentType\": \"visa\",\n      \"parToken\": \"V0010013820230419113052\",\n      \"pspToken\": \"P6DNXVCR8J4TLM92\",\n      \"cardBrand\": \"visa\",\n      \"maskedCardNumber\": \"411111******1111\",\n      \"cardExpiryDate\": \"03/2030\",\n      \"cardAliasToken\": \"L8KQ2WX7YT3NBV61\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 157,\n      \"quantity\": 1,\n      \"vatPercent\": 25,\n      \"lineAmount\": 157,\n      \"no\": \"320100-RENEW\",\n      \"description\": \"Renew GOLD Membership\",\n      \"membershipId\": \"3a8b7c47-3228-4985-8bf0-bba09653f063\",\n      \"membershipLifeCycleOptionId\": \"bbe793c7-2489-43b7-ab77-23577d59ae71\",\n      \"subscription\": true\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"pricesExcludingVat\": false\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 Example Membership Renewal With Subscription
require 'uri'
require 'net/http'

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

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  \"externalNo\": \"WEBP000000002\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 157,\n      \"externalPaymentType\": \"visa\",\n      \"parToken\": \"V0010013820230419113052\",\n      \"pspToken\": \"P6DNXVCR8J4TLM92\",\n      \"cardBrand\": \"visa\",\n      \"maskedCardNumber\": \"411111******1111\",\n      \"cardExpiryDate\": \"03/2030\",\n      \"cardAliasToken\": \"L8KQ2WX7YT3NBV61\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 157,\n      \"quantity\": 1,\n      \"vatPercent\": 25,\n      \"lineAmount\": 157,\n      \"no\": \"320100-RENEW\",\n      \"description\": \"Renew GOLD Membership\",\n      \"membershipId\": \"3a8b7c47-3228-4985-8bf0-bba09653f063\",\n      \"membershipLifeCycleOptionId\": \"bbe793c7-2489-43b7-ab77-23577d59ae71\",\n      \"subscription\": true\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"pricesExcludingVat\": false\n}"

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

```java Example Membership Renewal With Subscription
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./ecommerce/documents")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"externalNo\": \"WEBP000000002\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 157,\n      \"externalPaymentType\": \"visa\",\n      \"parToken\": \"V0010013820230419113052\",\n      \"pspToken\": \"P6DNXVCR8J4TLM92\",\n      \"cardBrand\": \"visa\",\n      \"maskedCardNumber\": \"411111******1111\",\n      \"cardExpiryDate\": \"03/2030\",\n      \"cardAliasToken\": \"L8KQ2WX7YT3NBV61\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 157,\n      \"quantity\": 1,\n      \"vatPercent\": 25,\n      \"lineAmount\": 157,\n      \"no\": \"320100-RENEW\",\n      \"description\": \"Renew GOLD Membership\",\n      \"membershipId\": \"3a8b7c47-3228-4985-8bf0-bba09653f063\",\n      \"membershipLifeCycleOptionId\": \"bbe793c7-2489-43b7-ab77-23577d59ae71\",\n      \"subscription\": true\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"pricesExcludingVat\": false\n}")
  .asString();
```

```php Example Membership Renewal With Subscription
<?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./ecommerce/documents', [
  'body' => '{
  "externalNo": "WEBP000000002",
  "documentType": "order",
  "sellToCustomer": {
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  },
  "payments": [
    {
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 157,
      "externalPaymentType": "visa",
      "parToken": "V0010013820230419113052",
      "pspToken": "P6DNXVCR8J4TLM92",
      "cardBrand": "visa",
      "maskedCardNumber": "411111******1111",
      "cardExpiryDate": "03/2030",
      "cardAliasToken": "L8KQ2WX7YT3NBV61",
      "customFields": {
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      }
    }
  ],
  "salesDocumentLines": [
    {
      "type": "item",
      "unitPrice": 157,
      "quantity": 1,
      "vatPercent": 25,
      "lineAmount": 157,
      "no": "320100-RENEW",
      "description": "Renew GOLD Membership",
      "membershipId": "3a8b7c47-3228-4985-8bf0-bba09653f063",
      "membershipLifeCycleOptionId": "bbe793c7-2489-43b7-ab77-23577d59ae71",
      "subscription": true
    }
  ],
  "currencyCode": "DKK",
  "pricesExcludingVat": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Example Membership Renewal With Subscription
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./ecommerce/documents");
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  \"externalNo\": \"WEBP000000002\",\n  \"documentType\": \"order\",\n  \"sellToCustomer\": {\n    \"name\": \"Acme Corporation\",\n    \"address\": \"123 Main Street\",\n    \"postCode\": \"10001\",\n    \"city\": \"New York\",\n    \"email\": \"jane.doe@acme.com\",\n    \"no\": \"CUST-10001\",\n    \"address2\": \"Suite 400\",\n    \"county\": \"New York\",\n    \"countryCode\": \"US\",\n    \"contact\": \"Jane Doe\",\n    \"phone\": \"+1-555-123-4567\",\n    \"ean\": \"1234567890123\",\n    \"vatRegistrationNo\": \"US123456789\",\n    \"invoiceEmail\": \"invoices@acme.com\",\n    \"customerTemplate\": \"DOMESTIC\",\n    \"configurationTemplate\": \"CUST000001\"\n  },\n  \"payments\": [\n    {\n      \"paymentMethodType\": \"paymentGateway\",\n      \"externalPaymentMethodCode\": \"adyen_cc\",\n      \"paymentReference\": \"Z3ZR6HT5BNVPZQT5\",\n      \"paymentAmount\": 157,\n      \"externalPaymentType\": \"visa\",\n      \"parToken\": \"V0010013820230419113052\",\n      \"pspToken\": \"P6DNXVCR8J4TLM92\",\n      \"cardBrand\": \"visa\",\n      \"maskedCardNumber\": \"411111******1111\",\n      \"cardExpiryDate\": \"03/2030\",\n      \"cardAliasToken\": \"L8KQ2WX7YT3NBV61\",\n      \"customFields\": {\n        \"myCustomField1\": \"myCustomField1Value\",\n        \"myCustomField2\": \"myCustomField2Value\"\n      }\n    }\n  ],\n  \"salesDocumentLines\": [\n    {\n      \"type\": \"item\",\n      \"unitPrice\": 157,\n      \"quantity\": 1,\n      \"vatPercent\": 25,\n      \"lineAmount\": 157,\n      \"no\": \"320100-RENEW\",\n      \"description\": \"Renew GOLD Membership\",\n      \"membershipId\": \"3a8b7c47-3228-4985-8bf0-bba09653f063\",\n      \"membershipLifeCycleOptionId\": \"bbe793c7-2489-43b7-ab77-23577d59ae71\",\n      \"subscription\": true\n    }\n  ],\n  \"currencyCode\": \"DKK\",\n  \"pricesExcludingVat\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example Membership Renewal With Subscription
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "externalNo": "WEBP000000002",
  "documentType": "order",
  "sellToCustomer": [
    "name": "Acme Corporation",
    "address": "123 Main Street",
    "postCode": "10001",
    "city": "New York",
    "email": "jane.doe@acme.com",
    "no": "CUST-10001",
    "address2": "Suite 400",
    "county": "New York",
    "countryCode": "US",
    "contact": "Jane Doe",
    "phone": "+1-555-123-4567",
    "ean": "1234567890123",
    "vatRegistrationNo": "US123456789",
    "invoiceEmail": "invoices@acme.com",
    "customerTemplate": "DOMESTIC",
    "configurationTemplate": "CUST000001"
  ],
  "payments": [
    [
      "paymentMethodType": "paymentGateway",
      "externalPaymentMethodCode": "adyen_cc",
      "paymentReference": "Z3ZR6HT5BNVPZQT5",
      "paymentAmount": 157,
      "externalPaymentType": "visa",
      "parToken": "V0010013820230419113052",
      "pspToken": "P6DNXVCR8J4TLM92",
      "cardBrand": "visa",
      "maskedCardNumber": "411111******1111",
      "cardExpiryDate": "03/2030",
      "cardAliasToken": "L8KQ2WX7YT3NBV61",
      "customFields": [
        "myCustomField1": "myCustomField1Value",
        "myCustomField2": "myCustomField2Value"
      ]
    ]
  ],
  "salesDocumentLines": [
    [
      "type": "item",
      "unitPrice": 157,
      "quantity": 1,
      "vatPercent": 25,
      "lineAmount": 157,
      "no": "320100-RENEW",
      "description": "Renew GOLD Membership",
      "membershipId": "3a8b7c47-3228-4985-8bf0-bba09653f063",
      "membershipLifeCycleOptionId": "bbe793c7-2489-43b7-ab77-23577d59ae71",
      "subscription": true
    ]
  ],
  "currencyCode": "DKK",
  "pricesExcludingVat": false
] 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./ecommerce/documents")! 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()
```