Marketplace Split Card Payments API – (preview)

  1. Authorize a payment with Splits

    Definition: POST /v1/payments

    Split Card Payments is a unique feature that allows you to split a payment to several SiteIDs previously linked to your merchant account. 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.

    Please keep in mind that the Authorization header of the request must use the SiteID of the Marketplace.

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

    Request:

    POST https://securetest.smart2pay.com/v1/payments
    Authorization: Basic MTAxMDpnYWJp
    
    { 
      "Payment": {  
      "MerchantTransactionID": "s2p_test1a",
      "Amount": "100",
      "Currency": "EUR",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "Split Payment test",
        "StatementDescriptor": "card payment",
        "OriginatorTransactionID":"34991440",
        "ClientIP": "82.208.151.136",
        "BillingAddress": {
          "City": "Iasi",
          "ZipCode": "7000-49",
          "State": "Iasi",
          "Street": "Sf Lazar",
          "StreetNumber": "37",
          "HouseNumber1": "5A",
          "HouseExtension1": "-",
          "Country": "BR"
        },
        "ShippingAddress": {
          "City": "Iasi",
          "ZipCode": "700049",
          "State": "Iasi",
          "Street": "Sf Lazar",
          "StreetNumber": "37",
          "HouseNumber": "-",
          "HouseExtension": "-",
          "Country": "BR"
        },
        "Customer" : {
          "FirstName":"John",
          "LastName":"Dow",
          "Email": "challenge@challenge.com",
          "SocialSecurityNumber": "00003456789"
        },
       "Card": {
          "HolderName": "Johnn Snow",
          "Number": "4000023104662535", 
          "ExpirationMonth": "12",
          "ExpirationYear": "2023",
          "SecurityCode": "554",
          "RequireSecurityCode1": false
        },
    
        "Capture": false,
        "Retry": false,
        "GenerateCreditCardToken": false,
        "3DSecure": false,
    
         "Splits": [
          {
          "SiteID": 1000,
          "Amount": "60",
          "MerchantTransactionID" : "s2p_test1ad", 
          "OriginatorTransactionID": "34991440-A"
        },
        {
          "SiteID": 1061,
          "Amount": "40",
          "MerchantTransactionID" : "s2p_test1233", 
          "OriginatorTransactionID": "34991440-B"
        }
      ]
      }
    }
    

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 428473,
            "ClientIP": "82.208.151.136",
            "SkinID": null,
            "Created": "20200702132836",
            "MerchantTransactionID": "s2p_test1a",
            "OriginatorTransactionID": "34991440",
            "Amount": "100",
            "Currency": "EUR",
            "CapturedAmount": "0",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "Split Payment test",
            "StatementDescriptor": "card payment",
            "MethodID": 6,
            "MethodOptionID": null,
            "SiteID": 66789,
            "NotificationDateTime": null,
            "Customer": {
                "ID": 2766,
                "MerchantCustomerID": null,
                "Email": "challenge@challenge.com",
                "FirstName": "John",
                "LastName": "Dow",
                "Gender": null,
                "SocialSecurityNumber": "00003456789",
                "Phone": null,
                "Company": null
            },
            "BillingAddress": {
                "ID": 2963,
                "City": "Iasi",
                "ZipCode": "7000-49",
                "State": "Iasi",
                "Street": "Sf Lazar",
                "StreetNumber": "37",
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "BR"
            },
            "ShippingAddress": {
                "ID": 2614,
                "City": "Iasi",
                "ZipCode": "700049",
                "State": "Iasi",
                "Street": "Sf Lazar",
                "StreetNumber": "37",
                "HouseNumber": "-",
                "HouseExtension": "-",
                "Country": "BR"
            },
            "Articles": null,
            "Card": {
                "HolderName": "Johnn Snow",
                "Number": "Visa-2535",
                "ExpirationMonth": "12",
                "ExpirationYear": "2023"
            },
            "CreditCardToken": null,
            "Status": {
                "ID": 9,
                "Info": "Authorized",
                "Reasons": []
            },
            "MethodTransactionID": "111067",
            "AuthorizationCode": "111067",
            "PaymentTokenLifetime": 10,
            "Capture": false,
            "CaptureDetails": null,
            "Retry": false,
            "RedirectURL": null,
            "3DSecure": false,
            "3DSecureData": null,
            "DeviceInfo": null,
            "ScaExemption": null,
            "CardOnFile": null,
            "Fraud": {
                "Status": "Accept",
                "Score": 31,
                "Reason": "No decision provided"
            },
            "AddressVerification": null,
            "Splits": [
                {
                    "ID": 446,
                    "PaymentID": 428473,
                    "SiteID": 1000,
                    "MerchantTransactionID": "s2p_test1ad",
                    "OriginatorTransactionID": "34991440-A",
                    "Created": "20200702132840",
                    "Amount": "60",
                    "Currency": "EUR",
                    "CapturedAmount": "0",
                    "StateDetails": {
                        "ID": 9,
                        "Info": "Authorized",
                        "Reasons": []
                    }
                },
                {
                    "ID": 447,
                    "PaymentID": 428473,
                    "SiteID": 1061,
                    "MerchantTransactionID": "s2p_test1233",
                    "OriginatorTransactionID": "34991440-B",
                    "Created": "20200702132840",
                    "Amount": "40",
                    "Currency": "EUR",
                    "CapturedAmount": "0",
                    "StateDetails": {
                        "ID": 9,
                        "Info": "Authorized",
                        "Reasons": []
                    }
                }
            ]
        }
    }
  2. Capture a Split

    Definition: Full Capture – POST /v1/payments/{id}/capture

    Where:
    • {id} – GlobalPay Payment 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. You only need to sent in the Request the Split ID and the amount desired to be captured. Checkout the below example of a captured split payment.

    Request:

    POST https://securetest.smart2pay.com/v1/payments/428473/capture
    Authorization: Basic MTAxMDpnYWJp
    
    {
        "Payment": {
            "Split": {
                "ID": 446,
                "Amount": 60,
                "OriginatorTransactionID": "34991440-A"
            }
        }
    }

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 428473,
            "ClientIP": "82.208.151.136",
            "SkinID": null,
            "Created": "20200702132836",
            "MerchantTransactionID": "s2p_test1a",
            "OriginatorTransactionID": "34991440-A",
            "Amount": "100",
            "Currency": "EUR",
            "CapturedAmount": "60",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "Split Payment test",
            "StatementDescriptor": "card payment",
            "MethodID": 6,
            "MethodOptionID": null,
            "SiteID": 66789,
            "NotificationDateTime": null,
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Card": {
                "HolderName": "Johnn Snow",
                "Number": "Visa-2535",
                "ExpirationMonth": "12",
                "ExpirationYear": "2023"
            },
            "CreditCardToken": null,
            "Status": {
                "ID": 35,
                "Info": "PartiallyCaptured",
                "Reasons": []
            },
            "MethodTransactionID": null,
            "AuthorizationCode": "111067",
            "PaymentTokenLifetime": null,
            "Capture": false,
            "CaptureDetails": null,
            "Retry": false,
            "RedirectURL": null,
            "3DSecure": false,
            "3DSecureData": null,
            "DeviceInfo": null,
            "ScaExemption": null,
            "CardOnFile": null,
            "Fraud": null,
            "AddressVerification": null,
            "Split": {
                "ID": 446,
                "PaymentID": 428473,
                "SiteID": 1000,
                "MerchantTransactionID": "s2p_test1ad",
                "OriginatorTransactionID": "34991440-A",
                "Created": "20200702132840",
                "Amount": "60",
                "Currency": "EUR",
                "CapturedAmount": "60",
                "StateDetails": {
                    "ID": 11,
                    "Info": "Captured",
                    "Reasons": []
                },
                "CaptureDetails": {
                    "ID": 29035,
                    "PaymentID": 428473,
                    "SiteID": 66789,
                    "Created": "20200702141826",
                    "MerchantTransactionID": "s2p_test1a",
                    "OriginatorTransactionID": "34991440-A",
                    "Amount": "60",
                    "Currency": "EUR",
                    "Status": {
                        "ID": 2,
                        "Info": "Success",
                        "Reasons": []
                    }
                }
            }
        }
    }
  3. Refund a Split

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

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

    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://securetest.smart2pay.com/v1/payments/428473/splits/446/captures/29035/refunds
    Authorization: Basic MTAxMDpnYWJp
    
    {
      "Refund": {
          "MerchantTransactionID": "s2p_test_refund1",
          "Amount": 60,
          "Description": "refund for x",
          "StatementDescriptor": "refund for product X",
          "OriginatorTransactionID": "34991440-A"
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
        "Refund": {
            "ID": 23742,
            "SiteID": 66789,
            "Created": "20200702143342",
            "MerchantTransactionID": "s2p_test_refund1",
            "OriginatorTransactionID": "34991440-A",
            "InitialPaymentID": 428473,
            "SplitID": 446,
            "Amount": "60",
            "Currency": "EUR",
            "Description": "refund for x",
            "StatementDescriptor": "refund for product X",
            "Customer": null,
            "BillingAddress": null,
            "BankAddress": null,
            "Articles": null,
            "Status": {
                "ID": 2,
                "Info": "Success",
                "Reasons": []
            },
            "MethodTransactionID": "196244198"
        }
    }
  4. 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://securetest.smart2pay.com/v1/payments/428480/cancel
    Authorization: Basic MTAxMDpnYWJp

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 428480,
            "ClientIP": "82.208.151.136",
            "SkinID": null,
            "Created": "20200702145229",
            "MerchantTransactionID": "s2p_test1c",
            "OriginatorTransactionID": "34991440",
            "Amount": "100",
            "Currency": "EUR",
            "CapturedAmount": "0",
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "Split Payment test",
            "StatementDescriptor": "card payment",
            "MethodID": 6,
            "MethodOptionID": null,
            "SiteID": 66789,
            "NotificationDateTime": null,
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Card": {
                "HolderName": "Johnn Snow",
                "Number": "Visa-2535",
                "ExpirationMonth": "12",
                "ExpirationYear": "2023"
            },
            "CreditCardToken": null,
            "Status": {
                "ID": 3,
                "Info": "Cancelled",
                "Reasons": []
            },
            "MethodTransactionID": null,
            "AuthorizationCode": "111738",
            "PaymentTokenLifetime": null,
            "Capture": false,
            "CaptureDetails": null,
            "Retry": false,
            "RedirectURL": null,
            "3DSecure": false,
            "3DSecureData": null,
            "DeviceInfo": null,
            "ScaExemption": null,
            "CardOnFile": null,
            "Fraud": null,
            "AddressVerification": null,
            "Splits": [
                {
                    "ID": 449,
                    "PaymentID": 428480,
                    "SiteID": 1000,
                    "MerchantTransactionID": "s2p_test1123",
                    "OriginatorTransactionID": "34991440-A",
                    "Created": "20200702145229",
                    "Amount": "60",
                    "Currency": "EUR",
                    "CapturedAmount": "0",
                    "StateDetails": {
                        "ID": 3,
                        "Info": "Cancelled",
                        "Reasons": []
                    }
                },
                {
                    "ID": 450,
                    "PaymentID": 428480,
                    "SiteID": 1061,
                    "MerchantTransactionID": "s2p_test1244",
                    "OriginatorTransactionID": "34991440-B",
                    "Created": "20200702145229",
                    "Amount": "40",
                    "Currency": "EUR",
                    "CapturedAmount": "0",
                    "StateDetails": {
                        "ID": 3,
                        "Info": "Cancelled",
                        "Reasons": []
                    }
                }
            ]
        }
    }