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

# Register Sale

POST https://api.npretail.app/{tenant}/{environment}/{company}/membership/{membershipId}/points
Content-Type: application/json

Registers a sale, with points being added to membership based on the contents of it. Reservations on the membership can be finalized.

Reference: https://docs.navipartner.com/apis/api-reference/memberships/service-points/register-sale

## Authentication

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

## Request

### Path parameters

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

### Body (application/json)

This endpoint expects a RegisterSaleRequest.

- `requestId` (UUID, required) — A unique identifier for the request. If you send the same requestId twice, it will be guaranteed to only trigger once.
- `externalReferenceNo` (string, required) — Your external reference number, such as a POS Receipt number, invoice number etc.
- `externalSystemIdentifier` (string, required) — An identifier of your external system. This together with the entra app name identifies the external system that is making the operation.
- `externalSystemUserIdentifier` (string, optional) — An identifier for the user in the external system, e.g. a POS UnitId, a salesperson code in an external POS or a user ID in a customer support tool.
- `externalBusinessUnitIdentifier` (string, optional) — An identifier for the business unit of the external system.
- `items` (list of RegisterSalesItem, optional)
- `reservations` (list of RegisterSalesReservation, optional)
- `tags` (list of Tag, optional) — Optional metadata tags to store additional context about the sale (e.g., sales channel, campaign, reference numbers)

## Response

### 200

- `pointsEarned` (integer, required) — The total points earned by the transaction
- `pointsCaptured` (integer, required) — the total amount of points captured by the transaction
- `newBalance` (integer, required) — The points balance on the membership after the transaction

## Types

### RegisterSalesItem

A sale line in a sale being registered to earn points.

- `itemCode` (string, required) — An ideniftication of the item
- `pointsEarned` (integer, required) — Points earned by the sold item. For deduction of points use a negative value
- `variantCode` (string, optional)
- `quantity` (double, optional)
- `description` (string, optional)
- `amountInclVAT` (double, optional) — The amount including VAT in system currency

### RegisterSalesReservation

A reservation to finalize.

- `authorizationCode` (string, required) — A authorization code of a previously authorized reservation

### Tag

A key-value pair for storing additional metadata about a transaction.

- `key` (string, required) — The tag identifier (e.g., SALES-CHANNEL, REF-NO, CAMPAIGN)
- `value` (string, required) — The tag value

## Examples

**Request**

```json
{
  "requestId": "4939d553-5b7d-434c-9c64-2f1b8620ece5",
  "externalReferenceNo": "8969718092",
  "externalSystemIdentifier": "BCTenant-POSStore",
  "externalSystemUserIdentifier": "SalespersonCode",
  "externalBusinessUnitIdentifier": "My businesss unit",
  "items": [
    {
      "itemCode": "I52892",
      "pointsEarned": 12,
      "variantCode": "V9529",
      "quantity": 2,
      "description": "Item Description",
      "amountInclVAT": 120
    }
  ],
  "reservations": [
    {
      "authorizationCode": "362FB68C444E41D691FF19EE470B30A1"
    }
  ],
  "tags": [
    {
      "key": "SALES-CHANNEL",
      "value": "WEB"
    },
    {
      "key": "REF-NO",
      "value": "WEB-8969718092"
    },
    {
      "key": "CAMPAIGN",
      "value": "SUMMER SALE"
    }
  ]
}
```

**Response**

```json
{
  "pointsEarned": 12,
  "pointsCaptured": 200,
  "newBalance": 1312
}
```

**SDK Code**

```python Register a sale
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/points"

payload = {
    "requestId": "4939d553-5b7d-434c-9c64-2f1b8620ece5",
    "externalReferenceNo": "8969718092",
    "externalSystemIdentifier": "BCTenant-POSStore",
    "externalSystemUserIdentifier": "SalespersonCode",
    "externalBusinessUnitIdentifier": "My businesss unit",
    "items": [
        {
            "itemCode": "I52892",
            "pointsEarned": 12,
            "variantCode": "V9529",
            "quantity": 2,
            "description": "Item Description",
            "amountInclVAT": 120
        }
    ],
    "reservations": [{ "authorizationCode": "362FB68C444E41D691FF19EE470B30A1" }],
    "tags": [
        {
            "key": "SALES-CHANNEL",
            "value": "WEB"
        },
        {
            "key": "REF-NO",
            "value": "WEB-8969718092"
        },
        {
            "key": "CAMPAIGN",
            "value": "SUMMER SALE"
        }
    ]
}
headers = {
    "x-np-api-key": "<NaviPartner API Key>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Register a sale
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/points';
const options = {
  method: 'POST',
  headers: {'x-np-api-key': '<NaviPartner API Key>', 'Content-Type': 'application/json'},
  body: '{"requestId":"4939d553-5b7d-434c-9c64-2f1b8620ece5","externalReferenceNo":"8969718092","externalSystemIdentifier":"BCTenant-POSStore","externalSystemUserIdentifier":"SalespersonCode","externalBusinessUnitIdentifier":"My businesss unit","items":[{"itemCode":"I52892","pointsEarned":12,"variantCode":"V9529","quantity":2,"description":"Item Description","amountInclVAT":120}],"reservations":[{"authorizationCode":"362FB68C444E41D691FF19EE470B30A1"}],"tags":[{"key":"SALES-CHANNEL","value":"WEB"},{"key":"REF-NO","value":"WEB-8969718092"},{"key":"CAMPAIGN","value":"SUMMER SALE"}]}'
};

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

```go Register a sale
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/points"

	payload := strings.NewReader("{\n  \"requestId\": \"4939d553-5b7d-434c-9c64-2f1b8620ece5\",\n  \"externalReferenceNo\": \"8969718092\",\n  \"externalSystemIdentifier\": \"BCTenant-POSStore\",\n  \"externalSystemUserIdentifier\": \"SalespersonCode\",\n  \"externalBusinessUnitIdentifier\": \"My businesss unit\",\n  \"items\": [\n    {\n      \"itemCode\": \"I52892\",\n      \"pointsEarned\": 12,\n      \"variantCode\": \"V9529\",\n      \"quantity\": 2,\n      \"description\": \"Item Description\",\n      \"amountInclVAT\": 120\n    }\n  ],\n  \"reservations\": [\n    {\n      \"authorizationCode\": \"362FB68C444E41D691FF19EE470B30A1\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"key\": \"SALES-CHANNEL\",\n      \"value\": \"WEB\"\n    },\n    {\n      \"key\": \"REF-NO\",\n      \"value\": \"WEB-8969718092\"\n    },\n    {\n      \"key\": \"CAMPAIGN\",\n      \"value\": \"SUMMER SALE\"\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 Register a sale
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/points")

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  \"requestId\": \"4939d553-5b7d-434c-9c64-2f1b8620ece5\",\n  \"externalReferenceNo\": \"8969718092\",\n  \"externalSystemIdentifier\": \"BCTenant-POSStore\",\n  \"externalSystemUserIdentifier\": \"SalespersonCode\",\n  \"externalBusinessUnitIdentifier\": \"My businesss unit\",\n  \"items\": [\n    {\n      \"itemCode\": \"I52892\",\n      \"pointsEarned\": 12,\n      \"variantCode\": \"V9529\",\n      \"quantity\": 2,\n      \"description\": \"Item Description\",\n      \"amountInclVAT\": 120\n    }\n  ],\n  \"reservations\": [\n    {\n      \"authorizationCode\": \"362FB68C444E41D691FF19EE470B30A1\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"key\": \"SALES-CHANNEL\",\n      \"value\": \"WEB\"\n    },\n    {\n      \"key\": \"REF-NO\",\n      \"value\": \"WEB-8969718092\"\n    },\n    {\n      \"key\": \"CAMPAIGN\",\n      \"value\": \"SUMMER SALE\"\n    }\n  ]\n}"

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

```java Register a sale
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./membership/cdef7890-abcd-0123-1234-567890abcdef/points")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"requestId\": \"4939d553-5b7d-434c-9c64-2f1b8620ece5\",\n  \"externalReferenceNo\": \"8969718092\",\n  \"externalSystemIdentifier\": \"BCTenant-POSStore\",\n  \"externalSystemUserIdentifier\": \"SalespersonCode\",\n  \"externalBusinessUnitIdentifier\": \"My businesss unit\",\n  \"items\": [\n    {\n      \"itemCode\": \"I52892\",\n      \"pointsEarned\": 12,\n      \"variantCode\": \"V9529\",\n      \"quantity\": 2,\n      \"description\": \"Item Description\",\n      \"amountInclVAT\": 120\n    }\n  ],\n  \"reservations\": [\n    {\n      \"authorizationCode\": \"362FB68C444E41D691FF19EE470B30A1\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"key\": \"SALES-CHANNEL\",\n      \"value\": \"WEB\"\n    },\n    {\n      \"key\": \"REF-NO\",\n      \"value\": \"WEB-8969718092\"\n    },\n    {\n      \"key\": \"CAMPAIGN\",\n      \"value\": \"SUMMER SALE\"\n    }\n  ]\n}")
  .asString();
```

```php Register a sale
<?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./membership/cdef7890-abcd-0123-1234-567890abcdef/points', [
  'body' => '{
  "requestId": "4939d553-5b7d-434c-9c64-2f1b8620ece5",
  "externalReferenceNo": "8969718092",
  "externalSystemIdentifier": "BCTenant-POSStore",
  "externalSystemUserIdentifier": "SalespersonCode",
  "externalBusinessUnitIdentifier": "My businesss unit",
  "items": [
    {
      "itemCode": "I52892",
      "pointsEarned": 12,
      "variantCode": "V9529",
      "quantity": 2,
      "description": "Item Description",
      "amountInclVAT": 120
    }
  ],
  "reservations": [
    {
      "authorizationCode": "362FB68C444E41D691FF19EE470B30A1"
    }
  ],
  "tags": [
    {
      "key": "SALES-CHANNEL",
      "value": "WEB"
    },
    {
      "key": "REF-NO",
      "value": "WEB-8969718092"
    },
    {
      "key": "CAMPAIGN",
      "value": "SUMMER SALE"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

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

```csharp Register a sale
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/points");
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  \"requestId\": \"4939d553-5b7d-434c-9c64-2f1b8620ece5\",\n  \"externalReferenceNo\": \"8969718092\",\n  \"externalSystemIdentifier\": \"BCTenant-POSStore\",\n  \"externalSystemUserIdentifier\": \"SalespersonCode\",\n  \"externalBusinessUnitIdentifier\": \"My businesss unit\",\n  \"items\": [\n    {\n      \"itemCode\": \"I52892\",\n      \"pointsEarned\": 12,\n      \"variantCode\": \"V9529\",\n      \"quantity\": 2,\n      \"description\": \"Item Description\",\n      \"amountInclVAT\": 120\n    }\n  ],\n  \"reservations\": [\n    {\n      \"authorizationCode\": \"362FB68C444E41D691FF19EE470B30A1\"\n    }\n  ],\n  \"tags\": [\n    {\n      \"key\": \"SALES-CHANNEL\",\n      \"value\": \"WEB\"\n    },\n    {\n      \"key\": \"REF-NO\",\n      \"value\": \"WEB-8969718092\"\n    },\n    {\n      \"key\": \"CAMPAIGN\",\n      \"value\": \"SUMMER SALE\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Register a sale
import Foundation

let headers = [
  "x-np-api-key": "<NaviPartner API Key>",
  "Content-Type": "application/json"
]
let parameters = [
  "requestId": "4939d553-5b7d-434c-9c64-2f1b8620ece5",
  "externalReferenceNo": "8969718092",
  "externalSystemIdentifier": "BCTenant-POSStore",
  "externalSystemUserIdentifier": "SalespersonCode",
  "externalBusinessUnitIdentifier": "My businesss unit",
  "items": [
    [
      "itemCode": "I52892",
      "pointsEarned": 12,
      "variantCode": "V9529",
      "quantity": 2,
      "description": "Item Description",
      "amountInclVAT": 120
    ]
  ],
  "reservations": [["authorizationCode": "362FB68C444E41D691FF19EE470B30A1"]],
  "tags": [
    [
      "key": "SALES-CHANNEL",
      "value": "WEB"
    ],
    [
      "key": "REF-NO",
      "value": "WEB-8969718092"
    ],
    [
      "key": "CAMPAIGN",
      "value": "SUMMER SALE"
    ]
  ]
] 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./membership/cdef7890-abcd-0123-1234-567890abcdef/points")! 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()
```