### Create a Ticket Reservation
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/ticketing/get-started.mdx
This API endpoint creates a reservation for a ticket using the `itemNumber` from the catalog and the `admissionCode` and `scheduleId` from the capacity search. A successful reservation returns a unique `token`.
```APIDOC
POST /:tenant/:environment/:company/ticket/reservation
- Description: Creates a reservation for a ticket.
- Parameters (from text):
- itemNumber: From step 1 (ticket catalog).
- admissionCode: From step 2 (capacity search).
- scheduleId: From step 2 (capacity search).
- Returns: A reservation `token` if successful.
```
--------------------------------
### Install Project Dependencies using npm
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/_ControlAddIns/HardwareConnector/README.md
This command is used for the initial setup of the web project. It downloads and installs all required dependencies as specified in the project's package configuration file.
```Shell
npm install
```
--------------------------------
### Install PNPM Globally
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
Use this command to install PNPM globally on your system via npm. PNPM is a faster alternative to npm for managing project dependencies and is crucial for this project's setup.
```bash
npm install -g pnpm
```
--------------------------------
### Install Project Dependencies with PNPM
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
This command installs all required project dependencies using PNPM. It's a crucial step before running any project scripts or tests to ensure all necessary packages are available.
```bash
pnpm install
```
--------------------------------
### Search for Ticket Time Slots
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/ticketing/get-started.mdx
This API endpoint is used to find available time slots for admission codes associated with a selected ticket product. The response provides `code` and `schedule.id` values necessary for creating a reservation.
```APIDOC
GET /:tenant/:environment/:company/ticket/capacity/search
- Description: Finds time slots for admission codes included with a selected product.
- Parameters:
- :tenant: Tenant identifier.
- :environment: Environment identifier.
- :company: Company identifier.
- Returns: Available time slots, including `code` (e.g., "CASTLE") and `schedule.id` (e.g., 452) for reservation.
```
--------------------------------
### Retrieve Available Ticket Catalog
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/ticketing/get-started.mdx
This API endpoint allows querying the available ticket catalog to find products that fit specific needs. It returns a list of tickets, from which an `itemNumber` can be selected for subsequent steps.
```APIDOC
GET /:tenant/:environment/:company/ticket/catalog/:storeCode
- Description: Queries the available tickets catalog.
- Parameters:
- :tenant: Tenant identifier.
- :environment: Environment identifier (e.g., 'prod', 'dev').
- :company: Company identifier.
- :storeCode: Store code for the catalog.
- Returns: A list of available ticket products, each with an `itemNumber`.
```
--------------------------------
### Confirm a Ticket Reservation
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/ticketing/get-started.mdx
This API endpoint confirms a previously created ticket reservation using its `token`. Confirmation makes the tickets valid for admission, and the response includes the created ticket numbers.
```APIDOC
POST /:tenant/:environment/:company/ticket/reservation/:token/confirm
- Description: Confirms a previously made ticket reservation.
- Parameters:
- :token: The reservation token obtained from the reservation creation step.
- Returns: An object containing the created and valid ticket numbers.
```
--------------------------------
### Retrieve Ticket Information
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/ticketing/get-started.mdx
These API endpoints allow retrieving detailed information about tickets. The first endpoint helps find a `ticketId` if only a barcode is available, while the second retrieves all details for a known `ticketId`.
```APIDOC
GET /:tenant/:environment/:company/ticket
- Description: Finds a ticketId, potentially using a printed barcode.
- Parameters:
- :tenant: Tenant identifier.
- :environment: Environment identifier.
- :company: Company identifier.
GET /:tenant/:environment/:company/ticket/:ticketId
- Description: Retrieves all information for a specific ticket.
- Parameters:
- :tenant: Tenant identifier.
- :environment: Environment identifier.
- :company: Company identifier.
- :ticketId: The unique identifier for the ticket.
- Returns: All relevant ticket details.
```
--------------------------------
### Example API Requests for Crane Environment
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/crane.mdx
Demonstrates how a typical GET request to the NaviPartner API is modified to target the Crane container environment, highlighting the changes in the URL path for routing.
```HTTP
Original Request:
GET https://api.npretail.app/c35fabce-d6b1-4e2f-b539-dabc68f0e7bb/production/MyCompany/customers
Modified Request for Crane:
GET https://api.npretail.app/XY123456/BC/MyCompany/customers
```
--------------------------------
### Check Node.js Version
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
This command is used to verify the installed version of Node.js on your system. It's a fundamental step to ensure compatibility with JavaScript and Node.js-based projects.
```bash
node --version
```
--------------------------------
### Check npm Version
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
This command verifies the installed version of npm (Node Package Manager). npm is essential for managing project dependencies in Node.js environments.
```bash
npm --version
```
--------------------------------
### Run Local Development Server for Web Project
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/_ControlAddIns/HardwareConnector/README.md
This command compiles the web code and starts a local web server. It enables developers to preview the control add-in in a browser, simulating its behavior when embedded in the target page.
```Shell
npm run dev
```
--------------------------------
### Check PNPM Version
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
This command checks the installed version of PNPM, a fast and efficient package manager. PNPM is recommended for its speed and reduced disk space usage compared to npm.
```bash
pnpm --version
```
--------------------------------
### NaviPartner API URL Structure and Path Parameters
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/paths.mdx
Documents the required path parameters (`tenant`, `environment`, `company`) for constructing NaviPartner API URLs, along with the general URL structure and a concrete example of a full API request URL.
```APIDOC
API URL Structure:
https://api.npretail.app/{tenant}/{environment}/{company}/[endpoint]
Path Parameters:
tenant:
Type: String (UUID format)
Description: A unique identifier for the Entra ID tenant that the Business Central environment lives in.
environment:
Type: String
Description: Specifies which environment of the Business Central tenant you want to access.
company:
Type: String
Description: The name of the specific company within the chosen Business Central environment.
Example URL:
https://api.npretail.app/12345678-1234-1234-1234-123456789012/production/CRONUS%20International%20Ltd./configurations
```
--------------------------------
### Run Playwright E2E Tests
Source: https://github.com/navipartner/npcore-partners/blob/master/IntegrationTest/README.md
These commands execute the Playwright end-to-end tests in various modes. Choose the mode based on whether you need a visible browser, debugging capabilities, or a background execution for continuous integration.
```bash
pnpm run e2e
```
```bash
pnpm run e2e:headed
```
```bash
pnpm run e2e:debug
```
--------------------------------
### Webhook Subscription Management API Endpoints
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/systemservices/webhooks.mdx
This section provides a comprehensive reference for all API endpoints related to managing webhook subscriptions. It includes operations for listing, retrieving, creating, and deleting subscriptions, detailing the HTTP methods and paths for each.
```APIDOC
POST /:tenant/:environment/:company/webhook
- Creates a new webhook subscription. This endpoint allows you to register a URL to receive notifications for specific events.
- Parameters:
- :tenant: string (path) - The tenant identifier.
- :environment: string (path) - The environment identifier (e.g., 'production', 'sandbox').
- :company: string (path) - The company identifier.
- Example: WebhookSubscriptionRequestExample (refer to documentation for schema)
GET /webhook
- Lists all active webhook subscriptions for the current context.
GET /webhook/{id}
- Retrieves the details of a specific webhook subscription by its unique identifier.
- Parameters:
- id: string (path) - The unique ID of the webhook subscription.
DELETE /webhook/{id}
- Deletes an existing webhook subscription by its unique identifier.
- Parameters:
- id: string (path) - The unique ID of the webhook subscription to delete.
```
--------------------------------
### Example Webhook Notification Payload Structure
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/systemservices/webhooks.mdx
This JSON snippet illustrates the typical structure of a POST request payload that your application will receive when a webhook event is triggered. It includes metadata like application ID, event name, timestamp, and the specific event payload.
```json
{
"value": [
{
"appId": "992c2309-cca4-43cb-9e41-911f482ec088",
"clientState": "HVA0Y6B84KBNISG45W6CA4TNE38CHSBASD",
"eventName": "pos_sale_completed",
"eventVersion": "1.0",
"timestamp": "2024-01-15T10:30:00Z",
"companyName": "CRONUS International Ltd.",
"payload": {
"saleId": "e20d09ad-ab74-4f31-912f-ea58d3c9e653",
"posUnit": "POS-031",
"receiptNo": "D12345678",
"fiscalDocumentNo": "FS12345678",
"customerNo": "C12345678"
}
}
]
}
```
--------------------------------
### API Reference: Data Replication with Pagination and Incremental Sync
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/replication.mdx
This section details the API parameters and response properties for enabling data replication, allowing clients to synchronize their local databases with the system by only transferring changed data using a `rowVersion` mechanism. It also includes a step-by-step guide on how to implement this replication.
```APIDOC
Replication API Parameters and Response Properties:
Query Parameters:
sync: boolean
Description: Set to true to enable replication mode.
lastRowVersion: string
Description: The highest rowVersion received in the previous request, used to fetch only newer changes.
Response Properties:
rowVersion: string
Description: A unique version identifier for each record, increasing with each change.
Usage Guide (Step-by-Step):
1. Make the first request with `sync=true`.
2. Process each page of data, storing the highest `rowVersion` value processed.
3. In future polls, include the highest `rowVersion` as the `lastRowVersion` parameter.
4. Repeat to receive only records created or modified since the last request.
```
--------------------------------
### Example API Error Response Body
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/errors.mdx
Illustrates the standard JSON structure for API error responses, including a unique error code and a human-readable message. This format allows clients to programmatically identify and react to specific error conditions.
```json
{
"code": "generic_error",
"message": "Http method OPTIONS is not supported."
}
```
--------------------------------
### OAuth 2.0 Client Credentials Configuration for Entra ID
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/auth.mdx
Details the necessary parameters for acquiring an access token using the OAuth 2.0 client credentials flow with Microsoft Entra ID, including scope, token endpoint, and Postman setup for testing.
```APIDOC
OAuth 2.0 Client Credentials Flow Configuration:
Required Parameters for Token Acquisition:
- Scope: "https://api.businesscentral.dynamics.com/.default"
- Token URL: "https://login.microsoftonline.com/:tenantId/oauth2/v2.0/token"
- Note: Replace :tenantId with your actual tenant ID.
Postman Configuration Example (OAuth 2.0):
- Authorization Type: OAuth 2.0
- Grant Type: Client Credentials
- Scope: "https://api.businesscentral.dynamics.com/.default"
- Token URL: "https://login.microsoftonline.com/:tenantId/oauth2/v2.0/token"
- Client ID: Your Entra App client_id
- Client Secret: Your Entra App client_secret
```
--------------------------------
### React Components for New HTTP Verb Styling
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/snippets/endpoint-verb-styles.mdx
These React functional components render 'GET', 'POST', and 'PUT' HTTP verbs using CSS classes for styling. This approach indicates a more modern and maintainable styling strategy, likely leveraging a utility-first CSS framework like Tailwind CSS.
```JSX
export const GetVerb = () => (
);
export const PostVerb = () => (
);
export const PutVerb = () => (
);
```
--------------------------------
### React Components for Old HTTP Verb Styling
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/snippets/endpoint-verb-styles.mdx
These React functional components render 'GET', 'POST', and 'PUT' HTTP verbs using inline styles for background color, padding, and border-radius. This approach represents an older or more direct styling method within JSX.
```JSX
export const GetVerbOld = () => (
GET
);
export const PostVerbOld = ({children}) => (
{children}
);
export const PutVerbOld = ({children}) => (
{children}
);
```
--------------------------------
### Package Web Code for Deployment
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/_ControlAddIns/HardwareConnector/README.md
This command is executed to prepare the web project for deployment. It bundles all web code into optimized 'bundle.js' and 'bundle.css' files, overwriting any existing deployment assets.
```Shell
npm run deploy
```
--------------------------------
### Inventory API Key Resources Overview
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/inventory/overview.mdx
This section outlines the key resources available through the Inventory API, providing a high-level overview of the data accessible. Each resource represents a distinct entity within the inventory system, such as core product information, movement history, or categorization details.
```APIDOC
Key Resources:
- Items: Core product information including description, category, and inventory
- Item Ledger Entries: Detailed history of inventory movements (purchases, sales, etc.)
- Item Variants: Color, size, or other variations of base items
- Item Categories: Hierarchical product categorization
- Barcodes: Item identification through various barcode standards
- Translations: Multilingual product descriptions
```
--------------------------------
### API SQL Performance Statistics Headers
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/performance.mdx
Describes two API response headers, `npr-sql-statements-executed-api` and `npr-sql-rows-read-api`, which provide insights into backend SQL activity. These headers are useful for troubleshooting performance and observing caching effectiveness.
```APIDOC
Response Headers for SQL Statistics:
- npr-sql-statements-executed-api:
- Type: Integer
- Description: The total number of SQL statements executed by the API during the request processing.
- npr-sql-rows-read-api:
- Type: Integer
- Description: The total number of rows read from the database by the API during the request processing.
- Purpose: These headers offer valuable insights for performance troubleshooting and verifying caching efficiency.
```
--------------------------------
### Filter Telemetry Traces in KQL for Sandbox Environment
Source: https://github.com/navipartner/npcore-partners/blob/master/Performance Toolkit/scripts/telemetry-kql.md
This Kusto Query Language (KQL) snippet filters telemetry traces within a specified time range. It targets a particular sandbox environment ('NPRetailBCPT-Sandbox-5') and includes traces with specific event IDs (RT0030, AL0000DGF, AL0000DHS, AL0000DHR) or a severity level of 3. The results are ordered by timestamp in descending order.
```KQL
traces
| where timestamp > todatetime('2023-03-03T15:07:13Z')
| where timestamp <= todatetime('2023-03-03T15:24:34Z')
| where customDimensions.environmentName == 'NPRetailBCPT-Sandbox-5'
| where (customDimensions.eventId in ("RT0030", "AL0000DGF", "AL0000DHS", "AL0000DHR") or severityLevel == 3)
| order by timestamp desc
```
--------------------------------
### Vipps API Production and Test Endpoints
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/POS Payment/EFT/Integrations/Vipps Mobilepay/_Documentation/Readme.md
Provides the base URLs for accessing the Vipps API in both test (sandbox) and production environments.
```APIDOC
Test Environment: https://apitest.vipps.no
Production Environment: https://api.vipps.no
```
--------------------------------
### API Versioning Header (`x-api-version`)
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/versioning.mdx
Details the usage and behavior of the `x-api-version` header for controlling API versioning in client integrations, including its format and the consequences of its presence or absence.
```APIDOC
x-api-version Header
Description: Specifies the desired API version for client interactions.
Type: HTTP Request Header
Format: YYYY-MM-DD (e.g., 2025-01-17)
Behavior:
- When set: Clients should set this header to the current date (YYYY-MM-DD) to lock their integration to a specific API version. This ensures that future versions with potential breaking changes will not impact the client.
- When omitted: The client will always receive the latest available API version.
Important Note: Forgetting to set this header risks the integration suddenly breaking when new behaviors are deployed to the APIs.
```
--------------------------------
### Crane API URL Structure
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/crane.mdx
Details the required URL structure modifications for routing API requests to the NaviPartner Crane container environment. It contrasts the standard Business Central online URL with the Crane-specific format, explaining the replacement of tenant and environment placeholders with container-name and NST instance.
```APIDOC
Standard REST API URL:
https://api.navipartner.app/{tenant}/{environment}/{company}/[endpoint]
Crane Container Environment URL:
https://api.navipartner.app/{container-name}/{nst-instance}/{company}/[endpoint]
Placeholders:
- {container-name}: Replaces {tenant}, specific Crane container name.
- {nst-instance}: Replaces {environment}, currently 'BC'.
- {company}: Remains the same.
```
--------------------------------
### Managing Attributes for Memberships and Members API
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/memberships/attributes-introduction.mdx
This API documentation outlines the core operations for managing attributes associated with Membership and Member entities, including listing, retrieving, setting, and deleting custom key-value pairs.
```APIDOC
Attribute Management Operations:
List Attributes:
- Description: Discover attributes available for a specific entity, returning an array of attribute keys and their related data types, descriptions, and captions.
- Returns: An array of attribute metadata (key, data type, description, caption).
Get Attributes:
- Description: Fetch the current set of attributes for an entity.
- Parameters: Entity identifier (e.g., Membership ID or Member ID).
- Returns: A collection of key-value pairs representing the entity's current attributes.
Set Attributes:
- Description: Add or update one or more attributes for an entity.
- Parameters:
- Entity identifier (e.g., Membership ID or Member ID).
- An array of key-value pairs to add or update.
- Returns: Confirmation of successful update or the updated attribute set.
Delete Attributes:
- Description: Remove one or more attributes from an entity.
- Parameters:
- Entity identifier (e.g., Membership ID or Member ID).
- An array of attribute keys to remove.
- Returns: Confirmation of successful deletion.
```
--------------------------------
### Essential HTTP Headers for Vipps API Requests
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/POS Payment/EFT/Integrations/Vipps Mobilepay/_Documentation/Readme.md
Lists the mandatory and optional HTTP headers required for authenticating and making requests to the Vipps API, along with their purpose.
```APIDOC
Authorization:
- Type: Bearer Token
- Purpose: Used for API requests to authenticate.
client_id:
- Purpose: Required for obtaining an AccessToken.
client_secret:
- Purpose: Required for obtaining an AccessToken.
Ocp-Apim-Subscription-Key:
- Purpose: Required for all API requests.
Merchant-Serial-Number:
- Purpose: Required for partner key requests. Optional/recommended in normal Merchant mode.
Vipps-System-Name:
- Purpose: Metadata, mostly used to differentiate between applications/solutions.
Vipps-System-Version:
- Purpose: Metadata, mostly used to differentiate between applications/solutions.
Vipps-System-Plugin-Name:
- Purpose: Metadata, mostly used to differentiate between applications/solutions.
Vipps-System-Plugin-Version:
- Purpose: Metadata, mostly used to differentiate between applications/solutions.
```
--------------------------------
### EFT Payment Workflow Version 3 Sequence Diagram
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/POS Payment/EFT_payment_flow.md
This sequence diagram illustrates the end-to-end Electronic Funds Transfer (EFT) payment processing flow for workflow version 3. It details the interactions between the front-end payment button, JavaScript and AL components of the Payment Workflow, EFT Payment, and EFT Implementation, culminating in communication with a hardware connector for transaction finalization.
```mermaid
sequenceDiagram
autonumber
participant PaymentButton (js)
participant PaymentWF (js)
participant PaymentWF (AL)
participant EFT Payment (js)
participant EFT Payment (AL)
participant EFT Implementation (js)
participant EFT Implementation (AL)
participant Hardware Connector
Note right of EFT Implementation (js): f.ex. "POS Action: EFT Mock"
PaymentButton (js)->>+PaymentWF (js): Start Workflow (PaymentMethod)
PaymentWF (js)->>+PaymentWF (AL): PreparePayment (PaymentMethod)
Note right of PaymentWF (AL): ENUM::"NPR Payment Processing Type"
PaymentWF (AL)-->>-PaymentWF (js): (WorkflowName, Version, RemainingAmount)
alt is workflow version 3
PaymentWF (js)->>+EFT Payment (js): Start Workflow
EFT Payment (js)->>+EFT Payment (AL): PrepareEftRequest
Note right of EFT Payment (AL): EFT Setup::Payment Method, POS Unit
EFT Payment (AL)-->>-EFT Payment (js): WorkflowName (WorkflowName, EftRequest, EndSale)
EFT Payment (js)->>+EFT Implementation (js): Start Workflow (EftRequest)
EFT Implementation (js)->>+Hardware Connector: Invoke (EftRequest)
Hardware Connector-->>-EFT Implementation (js): (EftResult)
EFT Implementation (js)->>+EFT Implementation (AL): FinalizePaymentRequest
alt on known device reponse
EFT Implementation (AL)->>EFT Implementation (AL): HandleDeviceResponse()
EFT Implementation (AL)->>EFT Framework: EftIntegrationResponseReceived()
else
EFT Implementation (AL)->>EFT Framework: DispatchHwcEftDeviceResponse()
end
note left of EFT Framework: Payment line created
EFT Implementation (AL)-->>-EFT Implementation (js): (Success, EndSale)
EFT Implementation (js)-->>-EFT Payment (js): (Success, EndSale)
EFT Payment (js)-->>-PaymentWF (js): (Success, EndSale)
PaymentWF (js)->>PaymentWF (AL): TryEndSale
else
PaymentWF (js)->>PaymentWF (AL): DoLegacyPayment
end
PaymentWF (js)-->>-PaymentButton (js): Done
```
--------------------------------
### API Pagination Model Reference
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/pagination.mdx
Details the properties found in paginated API responses and the query parameters available for controlling pagination behavior when making requests.
```APIDOC
Pagination Response Structure:
{
"morePages": boolean,
"nextPageKey": string,
"nextPageURL": string,
"data": array
}
Properties:
morePages: boolean
- Indicates whether more pages of results exist beyond the current page.
nextPageKey: string
- A token that can be used to retrieve the next page of results.
nextPageURL: string
- A fully formed URL that is intended as a shortcut to retrieve next page.
data: array
- The actual array of resource items.
Pagination Query Parameters:
Parameters:
pageSize: integer (Optional)
- Specifies the number of items to return per page.
pageKey: string (Optional)
- A token provided in the previous response to retrieve the next page.
```
--------------------------------
### JSON Structure of Paginated API Responses
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/pagination.mdx
Illustrates the standard JSON format for all paginated API responses, including metadata for navigation and the array containing resource items.
```json
{
"morePages": true,
"nextPageKey": "c29tZSBiYXNlNjQgc3RyaW5n",
"nextPageURL": "https://api.npretail.app/tenant/env/company/resource?pageKey=c29tZSBiYXNlNjQgc3RyaW5n",
"data": [
{
/* resource item 1 */
},
{
/* resource item 2 */
},
{
/* resource item .. */
},
{
/* resource item n */
}
]
}
```
--------------------------------
### Crane API Request Header Requirement
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/crane.mdx
Specifies the mandatory HTTP header that must be included in API requests to ensure proper routing to the NaviPartner Crane container environment, bypassing the default Business Central online instance.
```JSON
"x-npr-api-remote-type": "crane"
```
--------------------------------
### Vipps API Key Types and Access Token Acquisition
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/POS Payment/EFT/Integrations/Vipps Mobilepay/_Documentation/Readme.md
Details the different types of API keys available for Vipps integrations, their scope, and the specific endpoints used to obtain access tokens for each key type.
```APIDOC
Merchant API Keys:
- Scope: Specific to a singular sales unit. Multiple sets needed for multiple POS units.
Partner API Keys:
- Scope: Works for all sales units linked to the partner portal. Requires specifying 'Merchant-Serial-Number' (MSN).
- Access Token Endpoint: POST /accesstoken/get (normal endpoint)
Management Keys:
- Scope: Manage sales units.
- Access Token Endpoint: POST /miami/v1/token (specific endpoint)
Accounting Keys:
- Scope: Report API access.
- Access Token Endpoint: POST /miami/v1/token (specific endpoint)
```
--------------------------------
### Softpay API Request JSON Structure
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/__Obsolete (NOT SUPPORTED)/EFT/Softpay/Softpayflow.md
Defines the structure of the JSON object sent to the Softpay API for initiating or managing transactions. This schema specifies the protocol action, Softpay action type, request ID, amount, currency, and various integrator and Softpay credentials.
```JSON
{
"Protocolaction": "{ Start | Advance | Cancel }",
"SoftpayAction": "{ Payment | Refund | Cancellation }",
"RequestID": "string",
"Amount": "decimal",
"Currency": "string",
"IntegratorID": "string",
"IntegratorCredentials": "char[]",
"SoftpayUsername": "string",
"SoftpayPassword": "char[]"
}
```
--------------------------------
### Retrieve Available Companies via API
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/systemservices/companies.mdx
This API endpoint allows fetching a list of all available companies within a given tenant and environment in Business Central. It is an exception to the general API routing rules as it does not require a company ID in its path.
```http
GET https://api.npretail.app/tenant/environment/companies
```
--------------------------------
### API Cache Header for Optimal Performance
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/performance.mdx
Details the `x-server-cache-id` header used in API responses and requests. This header provides a cache ID for the processing node, which, when mirrored back in subsequent requests, ensures maximum cache hit rates and improved performance.
```APIDOC
Request/Response Header: x-server-cache-id
- Description: Identifies the server node that processed the request.
- Usage:
- In API responses: Contains the cache ID from the server.
- In subsequent API requests: Mirror this header with the received ID to ensure optimal cache hit rates and performance.
```
--------------------------------
### API HTTP Error Status Codes Reference
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/errors.mdx
A comprehensive list of HTTP status codes used by the API, detailing their meaning and typical scenarios. These codes provide a high-level indication of the request's outcome.
```APIDOC
HTTP Status Codes:
400: Bad Request - The request could not be understood by the server.
401: Unauthorized - Authentication is required and has failed or has not yet been provided.
403: Forbidden - The server understood the request but refuses to authorize it.
404: Not Found - The requested resource could not be found.
405: Method Not Allowed - The request method is not supported for the requested resource.
408: Request Timeout - The server timed out waiting for the request.
409: Conflict - The request could not be completed due to a conflict with the current state of the resource.
410: Gone - The resource requested is no longer available and will not be available again.
413: Payload Too Large - The request is larger than the server is willing or able to process.
415: Unsupported Media Type - The request entity has a media type which the server or resource does not support.
416: Range Not Satisfiable - The server cannot provide the requested range of data.
422: Unprocessable Entity - The server understands the request, but could not succeed in processing it.
429: Too Many Requests - Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500: Internal Server Error - The server encountered an unexpected condition that prevented it from fulfilling the request.
501: Not Implemented - The server does not support the functionality required to fulfill the request.
502: Bad Gateway - The server received an invalid response from an upstream server.
503: Service Unavailable - The server is currently unable to handle the request due to temporary overloading or maintenance.
504: Gateway Timeout - The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.
505: HTTP Version Not Supported - The server does not support the HTTP protocol version that was used in the request.
```
--------------------------------
### Softpay API Response JSON Structure
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/__Obsolete (NOT SUPPORTED)/EFT/Softpay/Softpayflow.md
Defines the structure of the JSON object returned by the Softpay API for transaction responses. This schema includes fields for status, messages, acquirer details, terminal information, and transaction specifics like amount and audit numbers.
```JSON
{
"StatusCode": "{ OK | ERROR }",
"StatusMsg": "string",
"ExternalResultKnown": "boolean",
"AquirerID": "string",
"AquirerStoreID": "string",
"IntegratorID": "string",
"TerminalID": "string",
"RequestID": "string",
"BatchNumber": "string",
"AuditNumber": "string",
"Amount": "decimal"
}
```
--------------------------------
### API Error Codes
Source: https://github.com/navipartner/npcore-partners/blob/master/fern/docs/pages/errors.mdx
A comprehensive list of unique error codes that may be returned by the API, detailing the specific conditions under which each error occurs. These codes are crucial for debugging and handling API responses programmatically.
```APIDOC
Error Code: generic_error
Description: An error occurred. See HTTP status code.
Error Code: saas_tenant_not_found
Description: Provided tenant GUID (parameter `tenant`) is not a valid tenant ID.
Error Code: saas_environment_not_found
Description: Provided tenant environment name (parameter `environment`) is not a valid environment name for the selected tenant.
Error Code: saas_company_not_found
Description: Provided company name (parameter `company`) is not a valid company name for the selected tenant and environment.
Error Code: server_timeout
Description: The server timed out while processing the request.
Error Code: unsupported_http_method
Description: The http method is not supported for this endpoint.
Error Code: resource_not_found
Description: The selected resource does not exist.
Error Code: globalsale_duplicate_key
Description: Duplicate key.
Error Code: capacity_exceeded
Description: The capacity has been exceeded. Entry is not allowed.
Error Code: invalid_reference
Description: The reference is invalid.
Error Code: reservation_not_found
Description: The required reservation for the ticket was not found.
Error Code: not_valid
Description: The ticket is not valid.
Error Code: reservation_mismatch
Description: Your reservation is not for the current event.
Error Code: admission_not_open
Description: The admission code is not open.
Error Code: admission_not_open_entry
Description: The admission code is not open for this entry.
Error Code: not_confirmed
Description: The ticket has not been confirmed.
Error Code: reservation_not_for_today
Description: The reservation is not valid for today.
Error Code: reservation_capacity_exceeded
Description: The reservation capacity has been exceeded.
Error Code: ticket_canceled
Description: The ticket has been canceled.
Error Code: ticket_not_valid_yet
Description: The ticket is not valid yet.
Error Code: ticket_expired
Description: The ticket has expired.
Error Code: quantity_change_not_allowed
Description: The quantity change is not allowed.
Error Code: no_default_schedule
Description: No default schedule could be found.
Error Code: missing_payment
Description: The ticket is missing a payment transaction.
Error Code: schedule_entry_expired
Description: The schedule entry has expired.
Error Code: reservation_not_for_now
Description: The reservation is not valid for now.
Error Code: concurrent_capacity_exceeded
Description: The concurrent capacity has been exceeded.
Error Code: reschedule_not_allowed
Description: Rescheduling is not allowed.
Error Code: invalid_admission_code
Description: The admission code is invalid.
Error Code: has_payment
Description: The ticket has already been paid.
Error Code: duration_exceeded
Description: The admission duration has expired.
Error Code: ticket_blocked
Description: The ticket is blocked.
Error Code: ticket_not_valid_for_suggested_admission
Description: The ticket is not valid for the suggested admission.
Error Code: ticket_not_allowed
Description: The ticket is not allowed since no valid admission code could be found.
Error Code: wallet_expired
Description: The wallet has expired.
Error Code: ticket_reservation_has_no_tickets
Description: The ticket reservation has no tickets.
Error Code: member_blocked
Description: Member is blocked.
Error Code: member_card_blocked
Description: Member card is blocked.
Error Code: member_card_not_allowed
Description: Member card is not allowed.
Error Code: member_card_expired
Description: Member card has expired.
Error Code: membership_setup_missing_ticket_item
Description: Membership setup is missing ticket item.
Error Code: membership_setup_missing
Description: Membership setup is missing.
Error Code: membership_blocked
Description: Membership is blocked.
Error Code: member_unique_id_violation
Description: Member with same unique id already exists.
Error Code: member_count_exceeded
Description: Member count exceeded.
Error Code: member_card_exists
Description: Member card already exists.
Error Code: no_admin_member
Description: No admin member found.
Error Code: member_card_blank
Description: Member card is blank.
Error Code: invalid_contact
Description: The provided contact number is not valid in context of the customer.
Error Code: age_verification_setup
Description: Add member failed on age verification because item number for sales was not provided.
Error Code: age_verification
Description: Age verification failed.
Error Code: allow_member_merge_not_set
Description: This request violates the community’s member identity uniqueness rule. See the API documentation for merge options.
Error Code: member_card_limitation_error
Description: Limitations on member card apply and deny admission.
Error Code: denied_by_speedgate
Description: The reference number was denied by the gate.
Error Code: scanner_not_found
Description: The scanner was not found.
Error Code: scanner_id_required
Description: The scanner id is required.
Error Code: scanner_not_enabled
Description: The scanner is not enabled.
Error Code: number_not_whitelisted
Description: The reference number was not whitelisted by the gate.
Error Code: number_rejected
Description: The reference number was actively rejected by gate setup.
```
--------------------------------
### EFT Transaction and Sales Data Fields Reference
Source: https://github.com/navipartner/npcore-partners/blob/master/Application/src/POS Payment/EFT/EFTTransactionRequestExplained.md
This section details the various data fields used in Electronic Funds Transfer (EFT) transactions, including recovery status, dynamic currency conversion (DCC) information, and related sales ticket and point-of-sale (POS) details. Each field includes its data type and a description of its purpose, along with usage constraints where applicable.
```APIDOC
EFT Transaction Details:
Recoverable: Boolean
- Description: Describes if the result of the EFT transaction can be recovered.
- Usage: Mandatory in all contexts.
Recovered: Boolean
- Description: Describes if the EFT request has been recovered by another EFT Lookup request.
- Usage: Mandatory/Optional in all contexts.
Recovered by Entry No.: Integer
- Description: The EFT Lookup Request that recovered the transaction.
- Usage: Mandatory/Optional in all contexts.
Auxiliary Operation ID: Integer
- Description: The Id of the integration specific operation.
Auxiliary Operation Desc.: Text[50]
- Description: Description of what the integration specific operation does.
External Transaction ID: Text[50]
- Description: The providers identification number/text of the transaction.
- Usage: Mandatory in some contexts, Mandatory/Optional in others.
External Customer ID: Text[50]
- Description: [Description missing]
External Customer ID Provider: Text[50]
- Description: [Description missing]
External Payment Token: Text[50]
- Description: [Description missing]
DCC Used: Boolean
- Description: Specifies if Dynamic Currency Conversion were used.
- Usage: Mandatory/Optional in some contexts.
DCC Currency Code: Code[10]
- Description: The currency converted to.
- Usage: Mandatory/Optional in some contexts.
DCC Amount: Decimal
- Description: The amount in the currency used.
- Usage: Mandatory/Optional in some contexts.
Result Processed: Boolean
- Description: [Description missing]
---
Sales and POS Details:
Sales Ticket No.: Code[20]
- Description: [Description missing]
Sales ID: Guid
- Description: [Description missing]
Sales Line No.: Integer
- Description: [Description missing]
Sales Line ID: Guid
- Description: [Description missing]
POS Description: Text[100]
- Description: [Description missing]
Register No.: Code[10]
- Description: [Description missing]
POS Payment Type Code: Code[10]
- Description: [Description missing]
Original POS Payment Type Code: Code[10]
- Description: [Description missing]
Result Code: Integer
- Description: [Description missing]
Offline mode: [Type missing]
- Description: [Description missing]
Client Assembly Version: [Type missing]
- Description: [Description missing]
No. of Reprints: [Type missing]
- Description: [Description missing]
Number of Attempts: [Type missing]
- Description: [Description missing]
Initiated from Entry No.: [Type missing]
- Description: [Description missing]
Self Service: [Type missing]
- Description: [Description missing]
Stored Value Account Type: [Type missing]
- Description: [Description missing]
Stored Value Provider: [Type missing]
- Description: [Description missing]
Stored Value ID: [Type missing]
- Description: [Description missing]
Internal Customer ID: [Type missing]
- Description: [Description missing]
Access Token: [Type missing]
- Description: [Description missing]
Matched in Reconciliation: [Type missing]
- Description: [Description missing]
FF Moved to POS Entry: [Type missing]
- Description: [Description missing]
User ID: Code[50]
- Description: [Description missing]
```