Marketplace Split Payments API

Split Payments is a unique feature that allows you to split a payment to several SiteIDs previously linked to your merchant account.
You can initiate a payment with one or more Splits objects depending on the SiteID. The Split object must contain the following parameters: SiteID, Amount, MerchantTransactionID and the OriginatorTransactionID (optional).

Also MethodID is required to be sent for Payments with Splits.

The Authorization header of the request must contain the SiteID and APIKey of the Marketplace.

One-Step Split Payments

Definition: POST /v1/payments

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

Request:

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

{
  "Payment": {
    "MerchantTransactionID": "s2ptest_split1",
    "Amount": "100",
    "Currency": "EUR",      
    "MethodID": 9,
    "OriginatorTransactionID": "4324322",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
    "TokenLifetime": 10,
    "Customer": {    
      "Email": "youremail@email.com",
      "FirstName": "test",
      "LastName": "demo"      
    },    
    "BillingAddress":  {
    "Country": "RO"
    },
    "Splits": [
     {
      "SiteID": 33513,  
      "Amount": "60",
      "MerchantTransactionID": "s2p_test1ad", 
      "OriginatorTransactionID": "4324322-A"
   },
    {
      "SiteID":33512,  
      "Amount": "20",
      "MerchantTransactionID": "s2p_test1ad", 
      "OriginatorTransactionID": "4324322-B"
   },
    {
      "SiteID": 33511,  
      "Amount": "20",
      "MerchantTransactionID": "s2p_test1ad", 
      "OriginatorTransactionID": "4324322-C"
      }
    ]
  }
}

Response:

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

{
  "Payment": {
    "ID": 5581804,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20201202122951",
    "MerchantTransactionID": "s2ptest_split1",
    "OriginatorTransactionID": "4324322",
    "Amount": "100",
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 9,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 33513,
    "NotificationDateTime": null,
    "Customer": {
      "MerchantCustomerID": null,
      "Email": "youremail@email.com",
      "FirstName": "test",
      "LastName": "demo",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "RO"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 1,
      "Info": "Open",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=17CBE5EE17ADF6C3A52EC29B3B1E26B8.5581804",
    "Splits": [
      {
        "ID": 488,
        "PaymentID": 5581804,
        "SiteID": 33513,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-A",
        "Created": "20201202122951",
        "Amount": "60",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
        }
      },
      {
        "ID": 489,
        "PaymentID": 5581804,
        "SiteID": 33512,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-B",
        "Created": "20201202122951",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
        }
      },
      {
        "ID": 490,
        "PaymentID": 5581804,
        "SiteID": 33511,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-C",
        "Created": "20201202122951",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
        }
      }
    ]
  }
}

When the main payment is updated to success, also all the Splits are updated to success (splits will always have the status of the main payment for One-Step Payments). We will notify you about the Success status to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5581804,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20201202122951",
    "MerchantTransactionID": "test1606912191",
    "OriginatorTransactionID": "4324322",
    "Amount": "100",
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 9,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 33513,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": {
      "AccountNumber": null,
      "AccountHolder": "Max Mustermann",
      "IBAN": "DE06000000000023456789",
      "BIC": "SFRTDE20XXX",
      "PrepaidCard": null,
      "PrepaidCardPIN": null,
      "SerialNumbers": null,
      "Wallet": null,
      "ReferenceNumber": null,
      "PayerCountry": "DE",
      "PayerEmail": null,
      "PayerPhone": null,
      "BankCode": null,
      "BankName": null,
      "BankSortCode": null,
      "SocialSecurityNumber": null,
      "BillingCycleStart": null,
      "BillingCycleEnd": null,
      "UnsubscribeInstructions": null,
      "CustomerLoginID": null,
      "PaidAmount": null,
      "PaidCurrency": null,
      "ProviderExchangeRate": 0.0,
      "PayerBankAccountID": null,
      "PayerID": null
    },
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=17CBE5EE17ADF6C3A52EC29B3B1E26B8.5581804",
    "Splits": [
      {
        "ID": 488,
        "PaymentID": 5581804,
        "SiteID": 33513,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-A",
        "Created": "20201202122951",
        "Amount": "60",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      },
      {
        "ID": 489,
        "PaymentID": 5581804,
        "SiteID": 33512,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-B",
        "Created": "20201202122951",
        "Amount": "23",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      },
      {
        "ID": 490,
        "PaymentID": 5581804,
        "SiteID": 33511,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-C",
        "Created": "20201202122951",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      }
    ]
  }
}

Adding splits after transaction has received final status

A new call for Split Payments allows adding splits after the transaction is Success. This behavior is valid also for other statuses, like if the transaction is failed and we make the call for splits, the splits inserted will be set to failed, same as the transaction’s status. Refunds are only allowed for splits. If a refund is made for a transaction before the split call is made, the split call is rejected.
Checkout the below example for adding splits after the transaction is success.

Definition: POST /v1/payments/{id}/splits

Where:
  • {id} – GlobalPay Payment ID

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

Request:

POST https://paytest.smart2pay.com/v1/payments/5891650/splits
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
"Splits":[
    {
      "SiteID":33513,  
      "Amount":"50",
      "MerchantTransactionID":"s2p_test1ad", 
      "OriginatorTransactionID":"4324322-A"
    },
    {
      "SiteID":33512,  
      "Amount":"20",
      "MerchantTransactionID":"s2p_test1ad", 
      "OriginatorTransactionID":"4324322-B"
    },
    {
      "SiteID":33511,  
      "Amount":"30",
      "MerchantTransactionID":"s2p_test1ad", 
      "OriginatorTransactionID":"4324322-C"
    }
  ]
}

Response:

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

{
  "Splits": [
    {
      "ID": 1161,
      "PaymentID": 5891650,
      "SiteID": 33513,
      "MerchantTransactionID": "s2p_test1ad",
      "OriginatorTransactionID": "4324322-A",
      "Created": "20210217063428",
      "Amount": "50",
      "Currency": "EUR",
      "CapturedAmount": "",
      "StateDetails": {
        "ID": 2,
        "Info": "Success",
        "Reasons": null
      }
    },
    {
      "ID": 1162,
      "PaymentID": 5891650,
      "SiteID": 33512,
      "MerchantTransactionID": "s2p_test1ad",
      "OriginatorTransactionID": "4324322-B",
      "Created": "20210217063428",
      "Amount": "20",
      "Currency": "EUR",
      "CapturedAmount": "",
      "StateDetails": {
        "ID": 2,
        "Info": "Success",
        "Reasons": null
      }
    },
    {
      "ID": 1163,
      "PaymentID": 5891650,
      "SiteID": 33511,
      "MerchantTransactionID": "s2p_test1ad",
      "OriginatorTransactionID": "4324322-C",
      "Created": "20210217063428",
      "Amount": "30",
      "Currency": "EUR",
      "CapturedAmount": "",
      "StateDetails": {
        "ID": 2,
        "Info": "Success",
        "Reasons": null
      }
    }
  ]
}

Two-Steps Split Payments

There are methods for which the successful state is done in 2 steps: Authorization + Capture.

  • Authorize a payment with Splits

    Request:

    POST https://paytest.smart2pay.com/v1/payments
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=
    
    {
      "Payment": {
        "MerchantTransactionID": "SplitPaymentsAuthorized1",
        "Amount": "30",
        "Currency": "EUR",      
        "MethodID": 40,
        "OriginatorTransactionID": "4324322",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",      
        "TokenLifetime": 10,
        "Customer": {    
          "Email": "youremail@email.com",
          "FirstName": "test",
          "LastName": "person"
              },
        "BillingAddress":
        {
        "Country": "RO"
        },  
        "Splits": [
         {
          "SiteID": 30025,  
          "Amount": "5",
          "MerchantTransactionID": "s2p_test1ad", 
          "OriginatorTransactionID": "4324322-A"
       },
        {
          "SiteID": 30122,  
          "Amount": "5",
          "MerchantTransactionID": "s2p_test1ad", 
          "OriginatorTransactionID": "4324322-B"
       },
        {
          "SiteID": 30126,  
          "Amount": "20",
          "MerchantTransactionID": "s2p_test1ad", 
          "OriginatorTransactionID": "4324322-C"
          }
        ]
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 401946443,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20201217115710",
        "MerchantTransactionID": "SplitPaymentsAuthorized1",
        "OriginatorTransactionID": "4324322",
        "Amount": "30",
        "Currency": "EUR",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 40,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30025,
        "NotificationDateTime": null,
        "Customer": {
          "ID": 3173720,
          "MerchantCustomerID": null,
          "Email": "youremail@email.com",
          "FirstName": "test",
          "LastName": "carmen",
          "Gender": null,
          "SocialSecurityNumber": null,
          "Phone": null,
          "Company": null,
          "DateOfBirth": null
        },
        "BillingAddress": {
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "RO"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 1,
          "Info": "Open",
          "Reasons": []
          },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://globalapi.smart2pay.com/Home?PaymentToken=370526947BE17A8A1DBBF5FDB065B809.401946443",
        "Splits": [
          {
            "ID": 22,
            "PaymentID": 401946443,
            "SiteID": 30025,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-A",
            "Created": "20201217115710",
            "Amount": "5",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 1,
              "Info": "Open",
              "Reasons": []
            }
          },
          {
            "ID": 23,
            "PaymentID": 401946443,
            "SiteID": 30122,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-B",
            "Created": "20201217115710",
            "Amount": "5",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 1,
              "Info": "Open",
              "Reasons": []
            }
          },
          {
            "ID": 24,
            "PaymentID": 401946443,
            "SiteID": 30126,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-C",
            "Created": "20201217115710",
            "Amount": "20",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 1,
              "Info": "Open",
              "Reasons": []
            }
          }
        ]
      }
    }

We will notify you about the Authorize status to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 401946443,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20201217115710",
    "MerchantTransactionID": "SplitPaymentsAuthorized1",
    "OriginatorTransactionID": "4324322",
    "Amount": "30",
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 40,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30025,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 3173720,
      "MerchantCustomerID": null,
      "Email": "youremail@email.com",
      "FirstName": "test",
      "LastName": "carmen",
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "RO"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 9,
      "Info": "Authorized",
      "Reasons": []
      },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://globalapi.smart2pay.com/Home?PaymentToken=370526947BE17A8A1DBBF5FDB065B809.401946443",
    "Splits": [
      {
        "ID": 22,
        "PaymentID": 401946443,
        "SiteID": 30025,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-A",
        "Created": "20201217115710",
        "Amount": "5",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
        }
      },
      {
        "ID": 23,
        "PaymentID": 401946443,
        "SiteID": 30122,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-B",
        "Created": "20201217115710",
        "Amount": "5",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
        }
      },
      {
        "ID": 24,
        "PaymentID": 401946443,
        "SiteID": 30126,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-C",
        "Created": "20201217115710",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 9,
          "Info": "Authorized",
          "Reasons": []
        }
      }
    ]
  }
}
    • Capture a Split Payment

      Definition: Full Capture – POST /v1/payments/{id}/capture
      Partial Capture – POST /v1/payments/{id}/splits/{id}/capture?{amount}

      Where:
      • payments {id} – GlobalPay Payment ID
      • {amount} – The amount to be captured smaller or equal than the initial authorized amount
      • splits {id} – GlobalPay Split ID

      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 depending on the Split ID provided and the amount.

      Keep in mind that at the moment GlobalPay accepts only one capture per payment!

    • For a Full Capture of a payment the statuses of splits are the same as of the main payment. Checkout the below example of a full captured split payment:
      POST https://paytest.smart2pay.com/v1/payments/5577675/capture
      Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

      Response:

      HTTP/1.1 200 OK
      Content-Type: application/json; charset=utf-8
      
      {
        "Payment": {
          "ID": 5577675,
          "SkinID": null,
          "ClientIP": null,
          "Created": "20201126114150",
          "MerchantTransactionID": "carmen1606390911",
          "OriginatorTransactionID": "4324322",
          "Amount": "100",
          "Currency": "EUR",
          "CapturedAmount": "100",
          "ReturnURL": "http://demo.smart2pay.com/redirect.php",
          "Description": null,
          "MethodID": 94,
          "MethodOptionID": null,
          "IncludeMethodIDs": null,
          "ExcludeMethodIDs": null,
          "PrioritizeMethodIDs": null,
          "SiteID": 33513,
          "NotificationDateTime": "20201126114316",
          "Customer": null,
          "BillingAddress": null,
          "ShippingAddress": null,
          "Articles": null,
          "Details": null,
          "ReferenceDetails": null,
          "CustomParameters": null,
          "PreapprovalID": null,
          "Status": {
            "ID": 2,
            "Info": "Success",
            "Reasons": null
          },
          "Fraud": null,
          "MethodTransactionID": null,
          "TokenLifetime": 10,
          "Capture": null,
          "PreapprovalDetails": null,
          "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=BBCA1F4A583A3AE6639E97C0589B1FF3.5577675",
          "Splits": [
            {
              "ID": 367,
              "PaymentID": 5577675,
              "SiteID": 33513,
              "MerchantTransactionID": "s2p_test1ad",
              "OriginatorTransactionID": "4324322-A",
              "Created": "20201126114150",
              "Amount": "60",
              "Currency": "EUR",
              "CapturedAmount": "",
              "StateDetails": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
              }
            },
            {
              "ID": 368,
              "PaymentID": 5577675,
              "SiteID": 33512,
              "MerchantTransactionID": "s2p_test1ad",
              "OriginatorTransactionID": "4324322-B",
              "Created": "20201126114150",
              "Amount": "20",
              "Currency": "EUR",
              "CapturedAmount": "",
              "StateDetails": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
              }
            },
            {
              "ID": 369,
              "PaymentID": 5577675,
              "SiteID": 33511,
              "MerchantTransactionID": "s2p_test1ad",
              "OriginatorTransactionID": "4324322-C",
              "Created": "20201126114150",
              "Amount": "20",
              "Currency": "EUR",
              "CapturedAmount": "",
              "StateDetails": {
                "ID": 2,
                "Info": "Success",
                "Reasons": null
              }
            }
          ]
        }
      }
      

We will notify you about the Success status to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request. There are methods, such as Post Finance, for which you will receive in the response an intermediate CaptureRequested status (ID = 13), followed by the notification containing the final Success status (ID = 2).

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5577639,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20201126093222",
    "MerchantTransactionID": "carmen1606383142",
    "OriginatorTransactionID": "4324322",
    "Amount": "100",
    "Currency": "EUR",
    "CapturedAmount": "100",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "",
    "MethodID": 1130,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 33513,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 10,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=8C8518387DAC0D71DC7AB9E3909AD21D.5577639",
    "Splits": [
      {
        "ID": 337,
        "PaymentID": 5577639,
        "SiteID": 33513,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-A",
        "Created": "20201126093222",
        "Amount": "60",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      },
      {
        "ID": 338,
        "PaymentID": 5577639,
        "SiteID": 33512,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-B",
        "Created": "20201126093222",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      },
      {
        "ID": 339,
        "PaymentID": 5577639,
        "SiteID": 33511,
        "MerchantTransactionID": "s2p_test1ad",
        "OriginatorTransactionID": "4324322-C",
        "Created": "20201126093222",
        "Amount": "20",
        "Currency": "EUR",
        "CapturedAmount": "",
        "StateDetails": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        }
      }
    ]
  }
}
  • Partial Capture with Splits: each split has CapturedAmount sent in the request, the main payment has CapturedAmount = Sum of CapturedAmount of all the splits sent in request:

    Request:

    POST https://paytest.smart2pay.com/v1/payments/5845686/capture
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ={
        "Payment": {
            "Splits": [
            {
                "ID": 797,
                "Amount": 10
            },
            {
                "ID": 798,
                "Amount": 10
            },
            
            {
                "ID": 799,
                "Amount": 20
            }
          ]
        }
    }
    

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 5845686,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20201214142216",
        "MerchantTransactionID": "carmen1607955727",
        "OriginatorTransactionID": "4324322",
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": "40",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 94,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 33513,
        "NotificationDateTime": "20201214142459",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 35,
          "Info": "PartiallyCaptured",
          "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=082F51365E403515CE1A77CB6668F954.5845686",
        "Splits": [
          {
            "ID": 797,
            "PaymentID": 5845686,
            "SiteID": 33513,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-A",
            "Created": "20201214142218",
            "Amount": "30",
            "Currency": "EUR",
            "CapturedAmount": "10",
            "StateDetails": {
              "ID": 35,
              "Info": "PartiallyCaptured",
              "Reasons": null
            }
          },
          {
            "ID": 798,
            "PaymentID": 5845686,
            "SiteID": 33512,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-B",
            "Created": "20201214142218",
            "Amount": "30",
            "Currency": "EUR",
            "CapturedAmount": "10",
            "StateDetails": {
              "ID": 35,
              "Info": "PartiallyCaptured",
              "Reasons": null
            }
          },
          {
            "ID": 799,
            "PaymentID": 5845686,
            "SiteID": 33511,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-C",
            "Created": "20201214142218",
            "Amount": "40",
            "Currency": "EUR",
            "CapturedAmount": "20",
            "StateDetails": {
              "ID": 35,
              "Info": "PartiallyCaptured",
              "Reasons": null
            }
          }
        ]
      }
    }
    
  • Partial Capture per Splits: the captured Split is set to status PartiallyCaptured but the other Splits remain with status Authorized:
    POST https://paytest.smart2pay.com/v1/payments/5581839/splits/504/capture?amount=10
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 5581839,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20201202132638",
        "MerchantTransactionID": "carmen1606915598",
        "OriginatorTransactionID": "4324322-A",
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": "10",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 94,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 33513,
        "NotificationDateTime": "20201202132859",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 35,
          "Info": "PartiallyCaptured",
          "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=0ABF968F50818372857AEDC9031BF437.5581839",
        "Splits": [
          {
            "ID": 504,
            "PaymentID": 5581839,
            "SiteID": 33512,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-A",
            "Created": "20201202132638",
            "Amount": "30",
            "Currency": "EUR",
            "CapturedAmount": "10",
            "StateDetails": {
              "ID": 35,
              "Info": "PartiallyCaptured",
              "Reasons": null
            }
          }
        ]
      }
    }
    
  • Cancel a full payment

    Definition: POST /v1/payments/{id}/cancel

    Where:
    • {id} – GlobalPay Payment ID

    A payment can be cancelled if it has an Authorized or an Open status. Only the full payment with an Authorized status will support cancellation. If one of its splits payments has been previously captured, the payment changed its status in PartiallyCaptured so it will no longer support cancellation.

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

    POST https://paytest.smart2pay.com/v1/payments/5583382/cancel
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "Payment": {
        "ID": 5583382,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20201204132034",
        "MerchantTransactionID": "carmen1607088034",
        "OriginatorTransactionID": "4324322",
        "Amount": "100",
        "Currency": "EUR",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": null,
        "MethodID": 94,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 33513,
        "NotificationDateTime": "20201204132126",
        "Customer": null,
        "BillingAddress": null,
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 3,
          "Info": "Cancelled",
          "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": [
          {
            "ID": 524,
            "PaymentID": 5583382,
            "SiteID": 33513,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-A",
            "Created": "20201204132034",
            "Amount": "60",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 3,
              "Info": "Cancelled",
              "Reasons": null
            }
          },
          {
            "ID": 525,
            "PaymentID": 5583382,
            "SiteID": 33512,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-B",
            "Created": "20201204132034",
            "Amount": "20",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 3,
              "Info": "Cancelled",
              "Reasons": null
            }
          },
          {
            "ID": 526,
            "PaymentID": 5583382,
            "SiteID": 33511,
            "MerchantTransactionID": "s2p_test1ad",
            "OriginatorTransactionID": "4324322-C",
            "Created": "20201204132034",
            "Amount": "20",
            "Currency": "EUR",
            "CapturedAmount": "",
            "StateDetails": {
              "ID": 3,
              "Info": "Cancelled",
              "Reasons": null
            }
          }
        ]
      }
    }
    
  • Refund a Split

    Definition: POST /v1/payments/{id}/splits/{id}/refunds

    Where:
    • payments/{id} – GlobalPay Payment ID
    • splits/{id} – The ID of the split payment

    At the moment only refunds per splits are allowed. When you are initiating a refund you need to provide the Refund Amount and the Merchant Transaction ID, that is automatically generated. You can change this ID by introducing your ID value.

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

    Request:

    POST https://paytest.smart2pay.com/v1/payments/5611633/splits/737/refunds
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ={
      "Refund": {
          "MerchantTransactionID": "carmen1607607300",
          "Amount": 60,   
          "Description": "test refund" 
      }
    }
    

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Refund": {
        "ID": 55745,
        "Created": "20201210133500",
        "MerchantTransactionID": "carmen1607607300",
        "OriginatorTransactionID": "4324322-A-refund1",
        "InitialPaymentID": 5611633,
        "Amount": "60",
        "Currency": "EUR",
        "Description": "test refund",
        "TypeID": 1,
        "SiteID": 33513,
        "Details": null,
        "Customer": null,
        "BillingAddress": null,
        "BankAddress": null,
        "Articles": null,
        "Status": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
        },
        "SplitID": 737
      }
    }