Payments

Payments

The cashier interface is a web page displayed to the customer when a new payment is initiated. Currently, the cashier interface must be displayed in a dedicated window by redirecting the user to the URL retrieved from the API.

Initiating a payment

To initiate a payment, the merchant must call the /init-payment endpoint with the following fields in the request body (as JSON):

Request Fields

FieldTypeDescriptionRequired
amountstringThe amount to be paid. Must be a valid monetary value as described in Handling Monetary Values.Yes
currencystringThe currency of the payment (e.g., EUR, USD).Yes
nationalIdentificationNumberstringThe customer’s national identification number.Optional
merchantDomainstringThe merchant’s domain where the payment status will be sent.Yes
successPathstringPath on the merchant’s domain to be called when the payment is successful.Yes
failurePathstringPath on the merchant’s domain to be called when the payment fails.Yes
closePathstringPath on the merchant’s domain to be called when the customer prematurely closes the payment.Yes
countryCodestringThe customer’s country code in ISO 3166-1 alpha-2 format.Yes
merchantReferencestringA unique reference used by the merchant to identify the payment.Yes
endUserTokenstringA token used to identify the customer for subsequent payments.Optional
requireMerchantConfirmationbooleanA boolean indicating whether to send Merchant Confirmation Notifications for this paymentOptional
notificationUrlstringA URL for notifying the merchant of the payment status. See Notifications.Optional
quickDepositbooleanA boolean indicating whether to skip the account selection step, enabling quick deposit functionality.Optional

Successful Response

If the payment is successfully initiated, the API will respond with the following fields:

FieldDescription
clientUrlThe URL to redirect the customer to for initiating the payment.
endUserTokenA unique token to identify the customer for future payments.

Note: In case of an error, refer to the Errors section for details on error codes and handling.

Example Request

Below is an example of initiating a payment using curl with mutual TLS (mTLS):

$ curl --cacert krofort-root-ca.pem \
  --cert your-certificate.crt \
  --key private.key \
  -XPOST "https://merchant.a.krofort.com/init-payment" \
  --header "Content-Type: application/json" \
  --data-binary @- << EOF
{
    "amount": "100.00",
    "currency": "EUR",
    "psuId": "197001016653",
    "merchantDomain": "example.org",
    "successPath": "/success",
    "failurePath": "/failure",
    "closePath": "/close",
    "countryCode": "SE",
    "merchantReference": "1234567890",
    "endUserToken": "<end-user-token>",
    "notificationUrl": "https://example.org/callback"
}
EOF

Example response:

{
    "clientUrl": "https://pay.a.krofort.com/?ts=...",
    "endUserToken": "kaLLU0smNESVWjOPrOtE_DWOY9A4kVQlwfQaXrTQBVNEcn_w"
}