Skip to Content
API OverviewPayments

Payments API

The Payments API allows Third Party Providers (TPPs) to initiate payments on behalf of authorized users. All payment endpoints require the PSP_PI (Payment Initiation) scope.

Payment Authorization Flow

All payment initiations follow a redirect-based authorization flow. When you initiate a payment, the user must authorize it through the Lunar app before it can be executed.

Payment Types

Domestic Credit Transfer

National bank transfers within Denmark, Norway, or Sweden.

Initiate Transfer

POST /payments/domestic-credit-transfer
FieldTypeRequiredDescription
redirectUrlstringYesURL to redirect user after authorization
accountIdstringYesSource account ID
recipientBBANstringYesRecipient’s BBAN (11-14 characters)
recipientNamestringDK onlyRequired for instant transfers in Denmark
amountstringYesPayment amount
currencystringYesCurrency code (ISO 4217)
messagestringNoMessage to recipient (see limits below)
titlestringNoTransaction title for sender (max 140 chars)
datedateNoExecution date (ISO-8601 date, YYYY-MM-DD, defaults to earliest possible)

Message length limits by country: - Denmark (instant): 140 characters

  • Denmark (intraday): 20 characters - Sweden: 12 characters - Norway: 70 characters All Lunar transfers in Denmark are executed as instant transfers.

Get Transfer Status

GET /payments/domestic-credit-transfer/{id}

Returns the payment details including current status. The response includes an instant boolean field (defaults to true, indicates the transfer is executed as an instant transfer in Denmark) and a status object containing state, failureCode, and message fields. See Generic Status object for details.

Standing Orders

Recurring national bank transfers for regular bills or payments.

List Standing Orders

GET /payments/standing-order

Returns all standing orders for the authenticated user.

Create Standing Order

POST /payments/standing-order
FieldTypeRequiredDescription
senderAccountIdstringYesSource account ID
senderMessagestringYesMessage/reference for sender
receiverAccountstringYesRecipient’s BBAN
receiverMessagestringYesMessage to recipient
amountnumberYesPayment amount
currencystringYesCurrency code
activeFromdateYesStart date (ISO-8601 date, YYYY-MM-DD)
frequencyobjectYesPayment schedule (see below)
terminationPolicyobjectYesWhen to stop payments
redirectUrlstringNoRedirect URL after authorization

The response is a PaymentInitiationResponse containing authUrl and paymentId (not the created standing order itself). The user must follow the authUrl to authorize the standing order.

Frequency Options

Standing orders support flexible scheduling:

Daily:

{ "daily": true }

Weekly:

{ "weekly": { "dayOfWeek": "MONDAY" } }

Monthly:

{ "monthly": { "interval": 1, "paymentDay": "15" } }

Payment day options: FIRST_BANK_DAY, LAST_BANK_DAY, or a specific day (1-31).

Standing Order Status

Each standing order has a status field indicating its lifecycle state:

StatusDescription
ACTIVEThe standing order is active and will execute
DISABLEDThe standing order is temporarily disabled
DELETEDThe standing order has been deleted

Get Standing Order

GET /payments/standing-order/{id}

Returns a wrapper object containing standingOrder (the standing order details) and redirectUrl.

Delete Standing Order

DELETE /payments/standing-order/{id}

Returns { "success": true } on successful deletion.

Danish Payment Slip (GIRO/FI)

Traditional Danish payment slips for utility bills and invoices.

Initiate Payment Slip

POST /payments/dk-payment-slip
FieldTypeRequiredDescription
redirectUrlstringYesURL to redirect user after authorization
accountIdstringYesSource account ID
amountnumberYesPayment amount
currencystringYesCurrency code (ISO 4217)
typestringYesGIRO/FI type: 01, 04, 15, 71, 73, or 75
debtorIdstringYesYour identifier (payer reference)
creditorIdstringYesCreditor number (max 8 characters)
messagestringNoPayment message (max 140 characters)
titlestringNoTransaction title for sender
datedateNoExecution date (ISO-8601 date, YYYY-MM-DD)

When retrieving a DK Payment Slip via GET, the type field in the response may also include the value Unspecified in addition to the initiation types listed above.

Get Payment Slip Status

GET /payments/dk-payment-slip/{id}

SE Bank Giro

Swedish Bank Giro payments for paying invoices to Swedish businesses.

Initiate Bank Giro Payment

POST /payments/se-bank-giro
FieldTypeRequiredDescription
giroNumberstringYesThe Bank Giro number of the recipient (with or without dash, e.g. 5894-2590 or 58942590)
ocrReferencestringYesOCR payment reference
amountstringYesPayment amount as decimal string (e.g. “100.00”)
currencystringYesCurrency code (SEK)
senderAccountIdstringYesSender’s account UUID
redirectUrlstringYesTPP callback URL for redirect after completion
messageToSenderstringNoMessage to sender
datedateNoFuture execution date (ISO-8601 date, YYYY-MM-DD)

Errors:

StatusDescription
400Invalid request. The response contains a top-level code and message, plus an errors array of validation errors each with field, code, and message fields
500Internal server error

Get Bank Giro Payment

GET /payments/se-bank-giro/{id}

Returns the payment details with the following fields:

FieldTypeDescription
paymentIdstringUnique payment identifier
statusstringPayment status string (see SE Giro status)
authUrlstringAuthorization URL (present when AWAITING_APPROVAL)
giroNumberstringThe Bank Giro number
ocrReferencestringOCR payment reference
amountstringPayment amount
currencystringCurrency code
senderAccountIdstringSender’s account UUID
messageToSenderstringMessage to sender
redirectUrlstringTPP redirect URL
datedateExecution date (ISO-8601 date, YYYY-MM-DD)

Cancel Bank Giro Payment

DELETE /payments/se-bank-giro/{id}

Cancels a Bank Giro payment. The operation is idempotent — cancelling an already-cancelled payment returns 204.

A payment can only be cancelled when its status is APPROVED or POSTPONED (i.e. the user has authorized the payment but it has not yet been executed).

StatusCodeDescription
204Payment cancelled (or was already cancelled)
404NOT_FOUNDPayment not found
409PAYMENT_AWAITING_CHALLENGEPayment is still in the challenge flow — complete or decline the challenge before cancelling
409PAYMENT_ALREADY_FULFILLED_FAILEDPayment has already been fulfilled or failed and cannot be cancelled
500INTERNAL_ERRORInternal server error

SE Plus Giro

Swedish Plus Giro payments for paying invoices to Swedish businesses.

Initiate Plus Giro Payment

POST /payments/se-plus-giro
FieldTypeRequiredDescription
giroNumberstringYesThe Plus Giro number of the recipient
ocrReferencestringYesOCR payment reference
amountstringYesPayment amount as decimal string (e.g. “100.00”)
currencystringYesCurrency code (SEK)
senderAccountIdstringYesSender’s account UUID
redirectUrlstringYesTPP callback URL for redirect after completion
messageToSenderstringNoMessage to sender
datedateNoFuture execution date (ISO-8601 date, YYYY-MM-DD)

Errors:

StatusDescription
400Invalid request. The response contains a top-level code and message, plus an errors array of validation errors each with field, code, and message fields
500Internal server error

Get Plus Giro Payment

GET /payments/se-plus-giro/{id}

Returns the payment details with the following fields:

FieldTypeDescription
paymentIdstringUnique payment identifier
statusstringPayment status string (see SE Giro status)
authUrlstringAuthorization URL (present when AWAITING_APPROVAL)
giroNumberstringThe Plus Giro number
ocrReferencestringOCR payment reference
amountstringPayment amount
currencystringCurrency code
senderAccountIdstringSender’s account UUID
messageToSenderstringMessage to sender
redirectUrlstringTPP redirect URL
datedateExecution date (ISO-8601 date, YYYY-MM-DD)

Cancel Plus Giro Payment

DELETE /payments/se-plus-giro/{id}

Cancels a Plus Giro payment. The operation is idempotent — cancelling an already-cancelled payment returns 204.

A payment can be cancelled as long as it has not yet reached its execution date. Once the payment has been processed (past its execution date), cancellation is no longer possible and returns 409.

StatusCodeDescription
204Payment cancelled (or was already cancelled)
404NOT_FOUNDPayment not found
409PAYMENT_AWAITING_CHALLENGEPayment is still in the challenge flow — complete or decline the challenge before cancelling
409PAYMENT_ALREADY_FULFILLED_FAILEDPayment has already been fulfilled or failed and cannot be cancelled
500INTERNAL_ERRORInternal server error

Payment Statuses

Payment status models differ between payment types.

Generic Status Object

Used by Domestic Credit Transfer, DK Payment Slip, and Standing Orders. The status is returned as an object with the following fields:

FieldDescription
stateOne of the state values listed below
failureCodeError code when the payment has failed (optional)
messageAdditional status details (optional)
StateDescription
AWAITING_APPROVALPayment created, waiting for user authorization
PENDINGPayment authorized, pending execution
COMPLETEDPayment successfully executed
FAILEDPayment execution failed (see failureCode)
CANCELLEDPayment was cancelled
UNKNOWNStatus could not be determined

SE Giro Status

Used by SE Bank Giro and SE Plus Giro. The status is returned as a plain string enum (not an object):

StatusDescription
AWAITING_APPROVALPayment created, waiting for user authorization
APPROVEDPayment has been approved
FAILEDPayment execution failed
DECLINEDPayment was declined
CANCELLEDPayment was cancelled

Always check the payment status after the user returns from the authorization flow. A redirect back to your redirectUrl does not guarantee the payment was approved.

Error Handling

Error responses contain a list of all validation errors found in the request. Each error in the list includes an errorCode and message field, making it easy to understand what went wrong and fix all issues in a single pass.

StatusDescription
400Invalid request (e.g., invalid BBAN, insufficient data)
404Payment not found
500Internal server error

Error responses include an errorCode and message with details about the failure.

Last updated on