Klarna Pay Now Standalone Payment Request

Definition: POST https://paytest.smart2pay.com/v1/payments

Below you will find a full example of a payment request for Klarna Pay Now Standalone method (with Success and Bad response). The parameters of the payment are sent in the message body as a JSON object.

For Klarna Pay Now Standalone payments only the following Amount, Currency, Country parameters are mandatory to be sent in the request, the rest of them are optional:

  • Amount – Order amount;
  • Currency – Purchase currency;
  • Country – Purchase country.

For a smoother user experience, we recommend always sending the Method ID 1183.

A 201 HTTP response (Created) is returned if the payment was correctly initialized.

For more information about status codes, please go to Basic HTTP Status Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAxOTk6OG16L0lsZkpaejIyVVhVUlFSeXRvdExQQ3pkWVJQekVmNHpyNDdBUWROWWxiUUxpTWc=

{
    "Payment": {
        "Amount": 100,
        "Currency": "GBP",
        "OriginatorTransactionID": "12345",
        "MethodID": "1183",
        "Description": "test",
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "MerchantTransactionID": "KlarnaPayments-{{$timestamp}}",
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": 100,
                "VAT": 10,
                "Discount": 0,
                "Type": 5,
                "TaxType": "0"
            }
        ],
        "BillingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "ShippingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "Customer": {
            "email": "test@test.com",
            "Phone": "00447516300001",
            "FirstName": "Doe",
            "LastName": "John"
        },
        "TokenLifetime": 10
    }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 27146999,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240517091703",
        "MerchantTransactionID": "KlarnaPayments-1715937424",
        "OriginatorTransactionID": "12345",
        "Amount": "100",
        "Currency": "GBP",
        "CapturedAmount": null,
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": "test",
        "MethodID": 1183,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30199,
        "NotificationDateTime": null,
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "test@test.com",
            "FirstName": "Doe",
            "LastName": "John",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": "00447516300001",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "ShippingAddress": {
            "ID": 2540874,
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": "100",
                "VAT": "10",
                "Discount": "0",
                "Type": "5",
                "TaxType": 0,
                "DiscountValue": "0"
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://gw-apm-globalpayapi.nuvei.com/Home?PaymentToken=3C1FBA02E352FA06F5EE3C7FE524D0F8.27146999",
        "Splits": null
    }
}

In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Request:

POST https://paytest.smart2pay.com/v1/payments
Authorization: Basic MzAxOTk6OG16L0lsZkpaejIyVVhVUlFSeXRvdExQQ3pkWVJQekVmNHpyNDdBUWROWWxiUUxpTWc=

{
    "Payment": {
        "Amount": 200,
        "Currency": "GBP",
        "OriginatorTransactionID": "12345",
        "MethodID": "1183",
        "Description": "test",
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "MerchantTransactionID": "KlarnaPayments-{{$timestamp}}",
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": 100,
                "VAT": 10,
                "Discount": 0,
                "Type": 5,
                "TaxType": "0"
            }
        ],
        "BillingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "ShippingAddress": {
            "HouseExtension": "25",
            "HouseNumber": "22",
            "Street": "Great Russell",
            "StreetNumber": "1",
            "City": "London",
            "Region": "St. Jaoum es",
            "Phone": "00447516300001",
            "ZipCode": "WC1B 3DG",
            "Country": "GB"
        },
        "Customer": {
            "email": "test@test.com",
            "Phone": "00447516300001",
            "FirstName": "Doe",
            "LastName": "John"
        },
        "TokenLifetime": 10
    }
}

Response:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 27147115,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20240517130108",
        "MerchantTransactionID": "KlarnaPayments-1715950869",
        "OriginatorTransactionID": null,
        "Amount": "200",
        "Currency": "GBP",
        "CapturedAmount": null,
        "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
        "ReturnURLSuccess": null,
        "ReturnURLFailure": null,
        "ReturnURLCancel": null,
        "ReturnURLProcessing": null,
        "Description": "test",
        "MethodID": 1183,
        "MethodOptionID": null,
        "MethodOptionIdString": null,
        "BankName": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30199,
        "NotificationDateTime": "20240517130109",
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "test@test.com",
            "FirstName": "Doe",
            "LastName": "John",
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": "00447516300001",
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": {
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "ShippingAddress": {
            "ID": 2540874,
            "City": "London",
            "ZipCode": "WC1B 3DG",
            "State": null,
            "Street": "Great Russell",
            "StreetNumber": "1",
            "HouseNumber": "22",
            "HouseExtension": "25",
            "Country": "GB"
        },
        "Articles": [
            {
                "MerchantArticleID": "5009000",
                "Name": "TEST",
                "Quantity": 1,
                "Price": "100",
                "VAT": "10",
                "Discount": "0",
                "Type": "5",
                "TaxType": 0,
                "DiscountValue": "0"
            }
        ],
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 4,
            "Info": "Failed",
            "Reasons": [
                {
                    "Code": "118",
                    "Info": "Amount invalid"
                }
            ]
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "OriginalMerchantTID": null,
        "Unknown": false,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

Klarna – Pay Now Standalone – Test Data

In order for you to test the Klarna – Pay Now Standalone payment method successfully, please use the below test data.

Test Data
DataValue
Email:Enter any valid email. Example: youremail@email.com
First Name:Enter any name. Example: Doe
Last Name:Enter any name. Example: Test
Phone Number:Enter any number up to 15 characters. Example: 1234567891
CityEnter any city. Example: London
StreetEnter any street. Example: Great Russell
Zip CodeEnter any valid zip code. Example: WC1B 3DG
Available countries:AT, ES, FI, DE, NL, SE, GB, BE, CH
Countries supported in production:AT, DE, GB
Article Type:4 = Discount, 5 = Physical, 6 = Shipping_fee, 7 = Sales_tax, 8 = Digital, 9 = Gift_card, 10 = Store_credit, 11 = Surcharge
Additional Test Data required from the customer on the provider’s page
CountryDate of Birth
Austria (AT):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.
Germany (DE):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.
Netherlands (NL):Format is Day/Month/Year (DD-MM-YYYY) Enter any date.

For more details about the specific personal details required please go to our section: Payment flows per country.

Klarna Pay Now Standalone Payment Flow

  1. This is considered a standard payment flow where the customer has selected the United Kingdom as the country. If the customer hasn’t provided in the first step one of the required personal details: email, first name and last name, he will provide this info on a intermediary page. In order to continue, the customer also needs to agree to storing and processing his/her personal information used in the payment flow. Customer Details
  2. The customer needs to insert the mobile phone number to get started, for example +447516320001, and then click on the Continue button. Let’s verify your phone page
  3. The customer needs to enter the verification code received on their mobile phone number. For testing you can enter any 6 digit code to continue (except 999999 which will display an error). Verification code
  4. The customer needs to verify the email address for additional verifications and then click on the Continue button.Email verification
  5. The customer needs to confirm their details: date of birth, first and last name, and address, then click on the Create Klarna account button. 1 Return page when the redirection status is a success
  6. The customer needs to click on the Continue button. Welcome to Klarna
  7. The customer selects the Pay now option and then click on the Continue button. Pay Now
  8. The customer needs to add the Card details and click on the Continue button. Add cards details
  9. The customer now views the purchase summary and clicks the “Pay today with K” button. Summary
  10. If the details are filled correctly by the customer, the transaction is completed and you will receive a notification with the success status. Meanwhile, the customer is redirected to your ReturnURL.Payment confirmation pending