Capture Scenarios for Klarna Payments

Scenario Status / Return Code Description
The transaction has been fully captured.

Only payments with “Authorized” status can be captured.
Status: 2 Success
The payment has been partially captured.

Only payments with “Authorized” status can be captured.
Status: 35 Partially Captured
Retry Capture.

This happens when the request timeouts at Provider; a new capture request has to be initiated.
Return Code: 157 Unable to capture transaction
The transaction could not be captured.

The transaction is not in an Authorized status.
Return Code: 17 Payment is invalid

For a complete list of all the possible Return Code IDs go to our section GlobalPay Return Codes.

See the request – response examples for the above possible scenarios:

  • Success StatusA payment can only be captured if it has an Authorized status. Once the payment has an Authorized status, you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

    A 200 HTTP response (OK) is returned if the request was completed successfully.

    Full capture means you capture the entire authorized amount for the initial transaction.

    Request:

    POST: https://webapp-apm-globalpay-rest-qa.nuvei.com/v1/payments/8061531/capture
    Authorization: Basic MzA1NjM6WVlxMEVtZHFYRlNwS0REeUw1Wjd5SGp0cTdXNExlU1dUWTRIcnFHL0VlSnV4ckRXRUg==

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 8061531,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20250217102607",
            "MerchantTransactionID": "XYZtest1739787966",
            "OriginatorTransactionID": null,
            "Amount": "2000",
            "Currency": "EUR",
            "CapturedAmount": "2000",
            "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
            "ReturnURLSuccess": null,
            "ReturnURLFailure": null,
            "ReturnURLCancel": null,
            "ReturnURLProcessing": null,
            "Description": null,
            "MethodID": 1078,
            "MethodOptionID": null,
            "MethodOptionIdString": null,
            "BankName": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30563,
            "NotificationDateTime": "20250217102656",
            "Customer": null,
            "BillingAddress": {
                "ID": 18658,
                "City": "Wien",
                "ZipCode": "1060",
                "State": null,
                "Street": "Mariahilfer Strasse 10",
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "AT"
            },
            "ShippingAddress": {
                "ID": 18658,
                "City": "Wien",
                "ZipCode": "1060",
                "State": null,
                "Street": "Mariahilfer Strasse 10",
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "AT"
            },
            "Articles": [
                {
                    "MerchantArticleID": "1231",
                    "Name": "TEST",
                    "Quantity": 1,
                    "Price": "2000",
                    "VAT": "0",
                    "Discount": "0",
                    "Type": "5",
                    "TaxType": 0,
                    "DiscountValue": "0"
                }
            ],
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
            },
            "Fraud": null,
            "MethodTransactionID": "a7d087d9-2cfb-4f7f-b767-5d014141aab3",
            "OriginalMerchantTID": null,
            "Unknown": false,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=8098486DFB91DDC9BBE2B45609F3DA3F.8061531",
            "Splits": null
        }
    }
  • Partially Captured StatusPartial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction. Partial capture is used when you have sent at least part of the order to the consumer and want to capture the amount for the item(s) that have been shipped.You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount. The remaining amount that has not been captured will be returned to the client’s account. There are 3 possibilities to partially capture a payment:
    1. Specify only the captured amount parameter in the query string, in order to partially capture the payment, like in the below example:

      Request:

      POST https://webapp-apm-globalpay-rest-qa.nuvei.com/v1/payments/8061511/capture?amount=50
      Authorization: Basic MzA1NjM6WVlxMEVtZHFYRlNwS0REeUw1Wjd5SGp0cTdXNExlU1dUWTRIcnFHL0VlSnV4ckRXRUg=

      Response:

      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
          "Payment": {
              "ID": 8061511,
              "SkinID": null,
              "ClientIP": null,
              "Created": "20250217074118",
              "MerchantTransactionID": "XYZtest1739778078",
              "OriginatorTransactionID": null,
              "Amount": "1000",
              "Currency": "EUR",
              "CapturedAmount": "50",
              "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
              "ReturnURLSuccess": null,
              "ReturnURLFailure": null,
              "ReturnURLCancel": null,
              "ReturnURLProcessing": null,
              "Description": null,
              "MethodID": 1078,
              "MethodOptionID": null,
              "MethodOptionIdString": null,
              "BankName": null,
              "IncludeMethodIDs": null,
              "ExcludeMethodIDs": null,
              "PrioritizeMethodIDs": null,
              "SiteID": 30563,
              "NotificationDateTime": "20250217092121",
              "Customer": null,
              "BillingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "ShippingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "Articles": [
                  {
                      "MerchantArticleID": "1231",
                      "Name": "TEST",
                      "Quantity": 1,
                      "Price": "1000",
                      "VAT": "0",
                      "Discount": "0",
                      "Type": "5",
                      "TaxType": 0,
                      "DiscountValue": "0"
                  }
              ],
              "Details": null,
              "ReferenceDetails": null,
              "CustomParameters": null,
              "PreapprovalID": null,
              "Status": {
                  "ID": 35,
                  "Info": "PartiallyCaptured",
                  "Reasons": null
              },
              "Fraud": null,
              "MethodTransactionID": "98b43211-f83d-4011-912d-838e3fdda4e1",
              "OriginalMerchantTID": null,
              "Unknown": false,
              "TokenLifetime": 10,
              "Capture": null,
              "PreapprovalDetails": null,
              "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=6ADDFEB056AFFCAA2894B2FA9EE9E989.8061511",
              "Splits": null
          }
      }
    2. Specify the captured amount parameter in the query string and send the minimal details for the Articles object, like in the below example:

      Request:

      "POST  https://webapp-apm-globalpay-rest-qa.nuvei.com/v1/payments/8061528/capture?amount=100
      
      Authorization: Basic MzA1NjM6WVlxMEVtZHFYRlNwS0REeUw1Wjd5SGp0cTdXNExlU1dUWTRIcnFHL0VlSnV4ckRXRUg= { "Payment": { "Articles": [ { "MerchantArticleID": "1231", "Quantity": 1 } ] } }

      Response:

    3. Specify the captured amount parameter in the query string and send the appropriate details for the Articles object together with the Shipping and Customer information, like in the below example:

      Request:

      {
        "Payment": {
          "Description": "Shipped part of the order ",
          "MethodID": 1078,
          "Articles": [
             {
                      "MerchantArticleID": "1231",
                      "Name": "TEST",
                      "Quantity": 1,
                      "Price": 2000,
                      "VAT": 0,
                      "DiscountValue": 0,
                      "Discount": 0,
                      "Type": "5"
                  }
          ],
              "ShippingAddress": {
                  "Street": "Mariahilfer Strasse 10",
                  "ZipCode": "1060",
                  "City": "Wien",
                  "Country": "AT"
              },
          "Customer": {
                  "Email": "customer@email.at",
                  "FirstName": "Test",
                  "LastName": "Person-at",
                  "Phone": "+4306762600456"
              }
        }
      }

      Response:

      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
          "Payment": {
              "ID": 8061525,
              "SkinID": null,
              "ClientIP": null,
              "Created": "20250217092651",
              "MerchantTransactionID": "XYZtest1739784411",
              "OriginatorTransactionID": null,
              "Amount": "2000",
              "Currency": "EUR",
              "CapturedAmount": "100",
              "ReturnURL": "http://demo2.smart2pay.com/redirect.php",
              "ReturnURLSuccess": null,
              "ReturnURLFailure": null,
              "ReturnURLCancel": null,
              "ReturnURLProcessing": null,
              "Description": null,
              "MethodID": 1078,
              "MethodOptionID": null,
              "MethodOptionIdString": null,
              "BankName": null,
              "IncludeMethodIDs": null,
              "ExcludeMethodIDs": null,
              "PrioritizeMethodIDs": null,
              "SiteID": 30563,
              "NotificationDateTime": "20250217093016",
              "Customer": null,
              "BillingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "ShippingAddress": {
                  "ID": 18658,
                  "City": "Wien",
                  "ZipCode": "1060",
                  "State": null,
                  "Street": "Mariahilfer Strasse 10",
                  "StreetNumber": null,
                  "HouseNumber": null,
                  "HouseExtension": null,
                  "Country": "AT"
              },
              "Articles": [
                  {
                      "MerchantArticleID": "1231",
                      "Name": "TEST",
                      "Quantity": 1,
                      "Price": "2000",
                      "VAT": "0",
                      "Discount": "0",
                      "Type": "5",
                      "TaxType": 0,
                      "DiscountValue": "0"
                  }
              ],
              "Details": null,
              "ReferenceDetails": null,
              "CustomParameters": null,
              "PreapprovalID": null,
              "Status": {
                  "ID": 35,
                  "Info": "PartiallyCaptured",
                  "Reasons": null
              },
              "Fraud": null,
              "MethodTransactionID": "5db6965c-a6d4-4c7e-a756-e46dc888aa4d",
              "OriginalMerchantTID": null,
              "Unknown": false,
              "TokenLifetime": 10,
              "Capture": null,
              "PreapprovalDetails": null,
              "RedirectURL": "https://webapp-apm-globalpay-api-qa.nuvei.com/Home?PaymentToken=BF33A34183FEF63D64262578465E2E8D.8061525",
              "Splits": null
          }
      }
  • Return Code: 157 – Unable to capture transactionThe transaction could not be captured. Retry Capture. This happens when the request timeouts at Provider.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/3434068/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 3434068,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20171123141730",
            "MerchantTransactionID": "testpaymentauthorized",
            "OriginatorTransactionID": null,
            "Amount": "900",
            "Currency": "DKK",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "test smart2pay",
            "MethodID": 1078,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20171123141847",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 9,
                "Info": "Authorized",
                "Reasons": [
                    {
                        "Code": 157,
                        "Info": "Unable to capture transaction"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }
  • Return Code: 17 – Payment is invalidThe transaction could not be captured. The transaction is not in an Authorized status. You can receive this response when the payment you want to Capture is not Authorized or when the payment has already been Captured.

    Request:

    POST https://webapp-apm-globalpay-rest-qa.nuvei.com/v1/payments/8061512/capture
    Authorization: Basic MzA1NjM6WVlxMEVtZHFYRlNwS0REeUw1Wjd5SGp0cTdXNExlU1dUWTRIcnFHL0VlSnV4ckRXRUg=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8{
        "Payment": {
            "ID": 8061512,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20250217081415",
            "MerchantTransactionID": null,
            "OriginatorTransactionID": null,
            "Amount": null,
            "Currency": null,
            "CapturedAmount": null,
            "ReturnURL": null,
            "ReturnURLSuccess": null,
            "ReturnURLFailure": null,
            "ReturnURLCancel": null,
            "ReturnURLProcessing": null,
            "Description": null,
            "MethodID": 1078,
            "MethodOptionID": null,
            "MethodOptionIdString": null,
            "BankName": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30563,
            "NotificationDateTime": "20250217084539",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": [
                    {
                        "Code": "17",
                        "Info": "Payment is invalid - 8061512"
                    }
                ]
            },
            "Fraud": null,
            "MethodTransactionID": null,
            "OriginalMerchantTID": null,
            "Unknown": false,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null,
            "Splits": null
        }
    }