Create a Payout

Definition: POST /v1/payouts

The payment methods that support payouts are: SEPA Payouts (MethodID = 1), Trustly (MethodID = 29) and Qiwi (MethodID = 1003). PLease keep in mind that is always mandatory to send the MethodID parameter in the payout request, otherwise the payout request will fail.

To initiate a payout, you must create a payout object. The parameters of the payout are sent in the message body as a JSON object.

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

  • For SEPA Payouts (1) you need to send in the request the below parameters, including the Customer’s first and last name and Customer IBAN parameter.

    Request:

    POST https://paytest.smart2pay.com/v1/payouts
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payout": {
        "MerchantTransactionID": "s2ptest_j1",
        "Amount": 2000,
        "Currency": "EUR",
        "MethodID": 1,
        "Customer": {
          "Email": "test@test.com",
          "FirstName": "John",
          "LastName": "Smith"
         },
        "BillingAddress": {
        "Country": "NL"
        },
        "Details": {
          "CustomerIBAN": "NL611904300234573201"
        }
      }
    }

    For B2B payouts you can send in the request the Company parameter instead of FirstName and LastName parameters.

    Request:

    POST https://paytest.smart2pay.com/v1/payouts
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payout": {
        "MerchantTransactionID": "s2ptest_j1",
        "Amount": 2000,
        "Currency": "EUR",
        "MethodID": 1,
        "Customer": {
          "Email": "test@test.com",
          "Company": "Test Company SRL"
         },
        "BillingAddress": {
        "Country": "NL"
        },
        "Details": {
          "CustomerIBAN": "NL611904300234573201"
        }
      }
    }

    Also, you can avoid sending each time the Customer and Country details by sending the CustomerID and BillingAddressID – the ones you receive in the initial Response.

    Request:

    POST https://paytest.smart2pay.com/v1/payouts
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payout": {
        "MerchantTransactionID": "s2ptest_j1",
        "Amount": 2000,
        "Currency": "EUR",
        "MethodID": 1,
        "Customer": {
          "ID": 335
         },
        "BillingAddress": {
        "ID": 170
        },
        "Details": {
          "CustomerIBAN": "NL611904300234573201"
        }
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payout": {
        "ID": 376,
        "Created": "20200821131247",
        "MerchantTransactionID": "s2ptest_j1",
        "Amount": 2000,
        "Currency": "EUR",
        "MethodID": 1,
        "Description": null,
        "SiteID": 30201,
        "Customer": {
          "ID": 335,
          "MerchantCustomerID": null,
          "Email": "test@test.com",
          "FirstName": "John",
          "LastName": "Smith",
          "Gender": null,
          "SocialSecurityNumber": null,
          "Phone": null,
          "Company": null,
          "DateOfBirth": null
         },
        "BillingAddress": {
          "ID": 170,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "NL"
          },
         "Status": {
           "ID": 1,
           "Info": "Open",
           "Reasons": null
        }
      }
    }
  • For Trustly Payouts(29) you need to send in the request the Customer Bank Account ID parameter.

    Request:

    POST https://paytest.smart2pay.com/v1/payouts
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payout": {
        "MerchantTransactionID": "s2ptest_j1",
        "Amount": 1000,
        "Currency": "EUR",      
        "MethodID": 29,
        "Customer": {    
          "Email": "youremail@email.com"   
        },
        "Details":{
          "CustomerBankAccountID": "3541977722"}
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
        "Payout": {
            "ID": 376,
            "Created": "20190507131247",
            "MerchantTransactionID": "s2ptest_j1",
            "Amount": "1000",
            "Currency": "EUR",           
            "MethodID": 29,
            "Description": null,
            "SiteID": 30201,
            "Details": {
                "CustomerBankAccountID": "3541977722"
            },
            "Customer": {
                "ID": 335,
                "MerchantCustomerID": null,
                "Email": "youremail@email.com",
                "FirstName": null,
                "LastName": null,
                "Gender": null,
                "SocialSecurityNumber": null,
                "Phone": null,
                "Company": null,
                "DateOfBirth": null
            },
            "BillingAddress": null,
            "Status": {
                "ID": 1,
                "Info": "Open",
                "Reasons": null
            }
        }
    }
  • For Qiwi Payouts all you need is the customer’s phone number and no restrictions regarding an initial payment with the same phone number. This option applies only for customers that have an active Qiwi Wallet Account.

    Request:

    POST https://paytest.smart2pay.com/v1/payouts
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payout": {
        "MerchantTransactionID": "s2ptest_j12",
        "Amount": 10,
        "Currency": "USD",      
        "MethodID": 1003,    
        "Customer": {    
         "Phone":"+79257836967" 
        }    
      }
    }

    Response:

    HTTP/1.1 201 Created
    Content-Type: application/json; charset=utf-8
    
    {
      "Payout": {
        "ID": 511,
        "Created": "20190603111300",
        "MerchantTransactionID": "s2ptest_j12",
        "Amount": "10",
        "Currency": "USD",     
        "MethodID": 1003,    
        "Description": null,
        "SiteID": 30201,
        "Details": null,
        "Customer": {
          "ID": 207203,
          "MerchantCustomerID": null,
          "Email": null,
          "FirstName": null,
          "LastName": null,
          "Gender": null,
          "SocialSecurityNumber": null,
          "Phone": "+79257836967",
          "Company": null,
          "DateOfBirth": null
          },
        "BillingAddress": null,
        "Status": {
          "ID": 1,
          "Info": "Open",
          "Reasons": null
        }
      }
    }

For Qiwi Payouts to be successful the phone number used in the request has to be linked with a Qiwi wallet account, otherwise the payout request will be rejected with the below message:

Request:

POST https://paytest.smart2pay.com/v1/payouts
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payout": {
    "MerchantTransactionID": "s2ptest_j13",
    "Amount": 10,
    "Currency": "USD",      
    "MethodID": 1003,    
    "Customer": {    
     "Phone":"+79257836965" 
    }    
  }
}

Response:

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

{
  "Payout": {
    "ID": 513,
    "Created": "20190603114013",
    "MerchantTransactionID": "s2ptest_j13",
    "Amount": "10",
    "Currency": "USD",     
    "MethodID": 1003,    
    "Description": null,
    "SiteID": 30201,
    "Details": null,
    "Customer": {
      "ID": 212321,
      "MerchantCustomerID": null,
      "Email": null,
      "FirstName": null,
      "LastName": null,
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": "+79257836965",
      "Company": null,
      "DateOfBirth": null
      },
    "BillingAddress": null,
    "Status": {
      "ID": 4,
      "Info": "Failed",
      "Reasons": [
        {
          "Code": "278",
          "Info": "User does not exists"
        }
      ]
    }
  }
}

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/payouts
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payout": {
    "MerchantTransactionID": "s2ptest_j2",
    "Amount": 1000,
    "Currency": "EUR",      
    "Customer": {    
      "Email": "youremail@email.com"   
    },
    "Details":{
      "CustomerBankAccountID": "3541977722"}
  }
}

Response:

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

{
    "Payout": {
        "ID": 0,
        "Created": null,
        "MerchantTransactionID": "s2ptest_j2",
        "Amount": "1000",
        "Currency": null,
        "Description": null,
        "SiteID": 30201,
        "Details": {
            "CustomerBankAccountID": "3541977722"
        },
        "Customer": {
            "MerchantCustomerID": null,
            "Email": "youremail@email.com",
            "FirstName": null,
            "LastName": null,
            "Gender": null,
            "SocialSecurityNumber": null,
            "Phone": null,
            "Company": null,
            "DateOfBirth": null
        },
        "BillingAddress": null,
        "Status": {
            "ID": null,
            "Info": null,
            "Reasons": [
                {
                    "Code": "1",
                    "Info": "Missing parameter - MethodID"
                }
            ]
        }
    }
}