Create a Payout

Definition: POST /v1/payouts

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.

The payment methods that support payouts are: Trustly (29) and Qiwi (1003).

  • For Trustly Payouts(29) you need to send in the request the Customer Bank Account ID parameter.

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

    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",
            "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",
        "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",
    "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"
                }
            ]
        }
    }
}