Requests

      Requests


        Article Summary

        Pay

        Start by creating Pay request. This will automatically capture the reservation on Klarna's side. Discount should be provided as a separate article with a negative UnitPrice

        Base JSON request

        Use the base request as instructed on this page

        Pay request

        Parameters

        Service specific parameters

        ParameterTypeRequiredRecommendedDescription
        FirstNamestringYesGroupType: BillingCustomer First name of billing customer
        LastNamestringYesGroupType: BillingCustomer Last name of billing customer
        BirthDatedatetimeGroupType: BillingCustomer Birthdate of billing customer
        GenderstringRequiredGroupType: BillingCustomer Gender of billing customer. Possible values: "male", "female"
        CategorystringYesGroupType: BillingCustomer Billing type. Possible values: "B2C", "B2B"
        EmailStringYesGroupType: BillingCustomer Email address of billing customer
        PhonestringYesGroupType: BillingCustomer Phone number of billing customer
        StreetstringRequiredGroupType: BillingCustomer Street of billing customer
        StreetNumberdecimalYesGroupType: BillingCustomer House number of billing customer
        StreetNumberAdditionalstringNoGroupType: BillingCustomer House number suffix of billing customer
        PostalCodedecimalYesGroupType: BillingCustomer Postal code of billing customer
        CitystringYesGroupType: BillingCustomer City of billing customer
        CountrystringYesGroupType: BillingCustomer Country of billing customer. Possible values: NL, DE, AT, FI, DK, NO, SE, GB
        FirstNamestringYesGroupType: ShippingCustomer First name of shipping customer
        LastNamestringYesGroupType: ShippingCustomer Last name of shipping customer
        BirthDatedatetimeNoGroupType: ShippingCustomer Birthdate of shipping customer
        GenderstringNoGroupType: ShippingCustomer Gender of shipping customer. Possible values: "male", "female"
        CategorystringYesGroupType: ShippingCustomer Billing type. Possible values: "B2C", "B2B"
        EmailstringYesGroupType: ShippingCustomer Email of shipping customer
        PhonestringGroupType: ShippingCustomer Phone number of shipping customer
        StreetstringYesGroupType: ShippingCustomer Street of shipping customer
        StreetNumberdecimalYesGroupType: ShippingCustomer House number of shipping customer
        StreetNumberAdditionalstringNoGroupType: ShippingCustomer House number suffix of shipping customer
        PostalCodeStringYesGroupType: ShippingCustomer Postal code of shipping customer
        CitystringRequiredGroupType: ShippingCustomer City of shipping customer
        CountrystringYesGroupType: ShippingCustomer Country of shipping customer. Possible values: NL, DE, AT, FI, DK, NO, SE, GB
        DescriptionstringGroupType: Article Article description
        IdentifierstringYesGroupType: Article Article identifier
        URLstringGroupType: Article Article URL
        ImageUrlstringGroupType: Article Article image URL
        QuantitydecimalYesGroupType: Article Article quantity
        GrossUnitPricedecimalYesGroupType: Article Article unit price
        VatPercentagedecimalYesGroupType: Article Article VAT percentage
        Basic parameters

        Example request

        {
          "Currency": "EUR",
          "AmountDebit": 10.0,
          "AmountCredit": null,
          "Invoice": "Test Invoice 123",
          "Order": null,
          "Description": "Klarna Order Test Invoice 123",
          "ClientIP": {
            "Type": 0,
            "Address": "0.0.0.0"
          },
          "ReturnURL": "https://www.buckaroo.nl",
          "ReturnURLCancel": "https://www.buckaroo.nl/annuleren",
          "ReturnURLError": "https://www.buckaroo.nl/mislukt",
          "ReturnURLReject": "https://www.buckaroo.nl/geweigerd",
          "OriginalTransactionKey": null,
          "ServicesSelectableByClient": null,
          "ServicesExcludedForClient": null,
          "PushURL": null,
          "PushURLFailure": null,
          "ClientUserAgent": null,
          "OriginalTransactionReference": null,
          "Services": {
            "ServiceList": [
              {
                "Name": "klarna",
                "Action": "pay",
                "Version": 0,
                "Parameters": [
                  {
                    "Name": "FirstName",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "John"
                  },
                  {
                    "Name": "Lastname",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "Doe"
                  },
                  {
                    "Name": "BirthDate",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "01/01/1990"
                  },
                  {
                    "Name": "Gender",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "male"
                  },
                  {
                    "Name": "Category",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "B2C"
                  },
                  {
                    "Name": "Email",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "support@buckaroo.nl"
                  },
                  {
                    "Name": "Phone",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "0307150000"
                  },
                  {
                    "Name": "Street",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "Diemerkade"
                  },
                  {
                    "Name": "StreetNumber",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "1"
                  },
                  {
                    "Name": "StreetNumberAdditional",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": ""
                  },
                  {
                    "Name": "PostalCode",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "1111AA"
                  },
                  {
                    "Name": "City",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "Diemen"
                  },
                  {
                    "Name": "Country",
                    "GroupType": "BillingCustomer",
                    "GroupID": "",
                    "Value": "NL"
                  },
                  {
                    "Name": "FirstName",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "John"
                  },
                  {
                    "Name": "LastName",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "Doe"
                  },
                  {
                    "Name": "BirthDate",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "01/01/1990"
                  },
                  {
                    "Name": "Gender",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "female"
                  },
                  {
                    "Name": "Category",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "B2C"
                  },
                  {
                    "Name": "Email",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "support@buckaroo.nl"
                  },
                  {
                    "Name": "Phone",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "0307105000"
                  },
                  {
                    "Name": "Street",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "Diemerkade"
                  },
                  {
                    "Name": "StreetNumber",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "1"
                  },
                  {
                    "Name": "StreetNumberAdditional",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": ""
                  },
                  {
                    "Name": "PostalCode",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "1111AA"
                  },
                  {
                    "Name": "City",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "Diemen"
                  },
                  {
                    "Name": "Country",
                    "GroupType": "ShippingCustomer",
                    "GroupID": "",
                    "Value": "NL"
                  },
                  {
                    "Name": "Description",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": "Blue Toy Car"
                  },
                  {
                    "Name": "Identifier",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": "111111"
                  },
                  {
                    "Name": "URL",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": ""
                  },
                  {
                    "Name": "ImageUrl",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": ""
                  },
                  {
                    "Name": "Quantity",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": "1"
                  },
                  {
                    "Name": "GrossUnitPrice",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": "10"
                  },
                  {
                    "Name": "VatPercentage",
                    "GroupType": "Article",
                    "GroupID": "1",
                    "Value": "10"
                  }
                ]
              }
            ]
          },
          "CustomParameters": null,
          "AdditionalParameters": null
        }
        

        Pay response

        Parameters

        Basic parameters

        Example response

        {
          "Key": "72635FC6D48847D4B12EB4AFXXXXXXXX",
          "Status": {
            "Code": {
              "Code": 791,
              "Description": "Pending processing"
            },
            "SubCode": {
              "Code": "S002",
              "Description": "An additional action is required: Redirect to Klarna."
            },
            "DateTime": "2021-02-11T08:37:43"
          },
          "RequiredAction": {
            "RedirectURL": "https://checkout.buckaroo.nl/html/redirect.ashx?r=9634CC95B2DB45458AC47FD6XXXXXXXX",
            "RequestedInformation": null,
            "PayRemainderDetails": null,
            "Name": "Redirect",
            "TypeDeprecated": 0
          },
          "Services": null,
          "CustomParameters": null,
          "AdditionalParameters": null,
          "RequestErrors": null,
          "Invoice": "Test Invoice 123",
          "ServiceCode": "klarna",
          "IsTest": true,
          "Currency": "EUR",
          "AmountDebit": 10.0,
          "TransactionType": "C700",
          "MutationType": 1,
          "RelatedTransactions": null,
          "ConsumerMessage": null,
          "Order": null,
          "IssuingCountry": null,
          "StartRecurrent": false,
          "Recurring": false,
          "CustomerName": "John Doe",
          "PayerHash": null,
          "PaymentKey": "AFEE970355454E638A11934EXXXXXXXX"
        }
        

        Pay push

        Parameters

        Basic parameters

        Example push

        {
           "Transaction":{
              "Key":"72635FC6D48847D4B12EB4AFXXXXXXXX",
              "Invoice":"Test Invoice 123",
              "ServiceCode":"klarna",
              "Status":{
                 "Code":{
                    "Code":190,
                    "Description":"Success"
                 },
                 "SubCode":{
                    "Code":"S990",
                    "Description":"The request was successful."
                 },
                 "DateTime":"2021-02-11T08:38:19"
              },
              "IsTest":true,
              "Order":null,
              "Currency":"EUR",
              "AmountDebit":10.0,
              "TransactionType":"C700",
              "Services":null,
              "CustomParameters":null,
              "AdditionalParameters":null,
              "MutationType":1,
              "RelatedTransactions":null,
              "IsCancelable":false,
              "IssuingCountry":null,
              "StartRecurrent":false,
              "Recurring":false,
              "CustomerName":"John Doe",
              "PayerHash":null,
              "PaymentKey":"AFEE970355454E638A11934EXXXXXXXX"
           }
        }
        

        Refund

        After a successful payment, a refund action can be performed. Please keep in mind to use the parameter Amount_Credit to specify the refund amount and Originaltransaction to refer to the payment transaction.

        Refund request

        Parameters

        Basic parameters

        Example request

        {
           "Currency": "EUR",
           "AmountCredit": 1.45,
           "Invoice": "Test Invoice 123_R",
           "OriginalTransactionKey": "72635FC6D48847D4B12EB4AFXXXXXXXX",
           "Services": {
              "ServiceList": [
                 {
                    "Name": "klarna",
                    "Action": "Refund"
                 }
              ]
           }
        }
        

        Refund response

        Parameters

        Basic parameters

        Example response

        {
           "Key": "10C63E926E724A4E8FF53246XXXXXXXX",
           "Status": {
              "Code": {
                 "Code": 190,
                 "Description": "Success"
              },
              "SubCode": {
                 "Code": "S001",
                 "Description": "Transaction successfully processed"
              },
              "DateTime": "2017-08-14T17:15:33"
           },
           "RequiredAction": null,
           "Services": null,
           "CustomParameters": null,
           "AdditionalParameters": null,
           "RequestErrors": null,
           "Invoice": "Test Invoice 123_R",
           "ServiceCode": "klarna",
           "IsTest": true,
           "Currency": "EUR",
           "AmountCredit": 1.45,
           "TransactionType": "C701",
           "MutationType": 1,
           "RelatedTransactions": [
              {
                 "RelationType": "refund",
                 "RelatedTransactionKey": "72635FC6D48847D4B12EB4AFXXXXXXXX"
              }
           ],
           "ConsumerMessage": null,
           "Order": null,
           "IssuingCountry": null,
           "StartRecurrent": false,
           "Recurring": false,
           "CustomerName": null,
           "PayerHash": null,
           "PaymentKey": "608987C866A3462FA5AB550CXXXXXXXX"
        }
        

        Refund push

        Parameters

        Basic parameters

        Example push

        {
           "Transaction":{
              "Key":"10C63E926E724A4E8FF53246XXXXXXXX",
              "Invoice":"Test Invoice_R",
              "ServiceCode":"klarna",
              "Status":{
                 "Code":{
                    "Code":190,
                    "Description":"Success"
                 },
                 "SubCode":null,
                 "DateTime":"2021-02-15T09:22:49"
              },
              "IsTest":true,
              "Order":null,
              "Currency":"EUR",
              "AmountCredit":1.45,
              "TransactionType":"C701",
              "Services":null,
              "CustomParameters":null,
              "AdditionalParameters":null,
              "MutationType":1,
              "RelatedTransactions":[
                 {
                    "RelationType":"refund",
                    "RelatedTransactionKey":"72635FC6D48847D4B12EB4AFXXXXXXXX"
                 }
              ],
              "IsCancelable":false,
              "IssuingCountry":null,
              "StartRecurrent":false,
              "Recurring":false,
              "CustomerName":"John Doe",
              "PayerHash":null,
              "PaymentKey":null
           }
        }
        

        Was this article helpful?

        What's Next