Skip to main content

Guidelines

To build great applications with Safepay Nordic APIs, you should learn about the basic design principles that form the foundation of Safepay Nordic APIs. These principles include base elements of the data model, secured access, error handling, and more.

Using the REST API​

The Safepay Nordic API is organized around REST. You manage the resources of a Safepay Nordic account (such as trades, user connection, webhooks) by making HTTPS requests to URLs that represent those resources.

Idempotency​

By definition idempotence is a property of operations whereby they can be applied multiple times without changing the result beyond the initial application. GET requests are always safe to retry. Endpoints that create transactions or payments, or that release or cancel a transaction, accept an Idempotency-Key header to make retries safe. See Idempotency.

API Keys​

All requests must use HTTPS and include a valid API key. The API is only for server-to-server communication: call it from your backend, never from a browser or app.

Generate the API key for your marketplace in the Safepay Nordic portal (see Obtain API key).

Usage​

To perform successful authorization provide:

-H "Authorization: Bearer {API_TOKEN}"

Formatting rules​

Working with Dates​

Dates and timestamps are strings in ISO 8601 format. Send them in UTC (such as "2026-02-23T00:00:00Z"). Timestamps in responses and webhooks may include a UTC offset (such as "2026-02-23T01:00:00+01:00"), so parse them with offset support.

Working with Monetary Amounts​

The amounts should be specified as positive decimals representing how much to charge. Be aware that no thousand digit separator should be specified and decimals are converted with a "." as the decimal separator

Example:​

  • Input: 'Amount: 20' equals 20 DKK.
  • Input: 'Amount: 520.50' equals 520,50 DKK.
NOTE

The minimum amount is 1. The maximum amount is defined by user's daily/yearly limits.

Working with Phone numbers​

All Safepay Nordic endpoints expect phone numbers to formatted with an area code followed by a single whitespace and then the national number without whitespaces.

Example:​

  • +45 12345678

Distributed tracing​

Correlation IDs​

A correlation ID is a unique ID assigned to every transaction. When a transaction becomes distributed across multiple services, we can follow it using the logging information. The correlation ID is passed from service to service. All services that process that specific transaction receive the correlation ID and pass it to the next service and so on so that they can log any events associated with that transaction to our centralized logs. This helps us hugely when we have to visualize and understand what has happened with this transaction across different microservices.

Using Safepay Nordic APIs you can provide your own Correlation ID in request header:

-H "X-Correlation-Id: 3307b968-7bf8-4a14-8342-2f0011443188"

If none is provided then our systems will generate it. You will be made aware of it only during errors. If you need to contact us about a specific request, providing the correlation ID will ensure the fastest-possible resolution.