Create a payout

Definition: POST /v1/payouts

In order to initiate a payout, you must create a payment object with all the necessary card details.

Request:

POST https://securetest.smart2pay.com/v1/payouts
Authorization: Basic MTAxMDpnYWJp

{
 "Payout": {
  "MerchantTransactionID": "test_g20",
  "Amount": 1000,
  "Currency": "EUR",
  "Description": "payment product",
  "Card": {
   "HolderName": "John Doe",
   "Number": "4111111111111111",
   "ExpirationMonth": "02",
   "ExpirationYear": "2019"
   }
 }
}

Response:

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

{
  "Payout": {
    "ID": 77,
    "SiteID": 1010,
    "Created": "20161003095114",
    "MerchantTransactionID": "test_g20",
    "Amount": 1000,
    "Currency": "EUR",
    "Description": "payment product",
    "StatementDescriptor": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": []
    }
  }
}

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://securetest.smart2pay.com/v1/payouts
Authorization: Basic MTAxMDpnYWJp

{
 "Payout": {
  "MerchantTransactionID": "test_g21",
  "Amount": 1000,
  "Currency": "EUR",
  "Description": "payment product"
 }
}

Response:

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

{
  "Payout": {
    "InvalidRequestID": "i1703",
    "ID": null,
    "SiteID": 1010,
    "Created": null,
    "MerchantTransactionID": "test_g21",
    "Amount": 1000,
    "Currency": "EUR",
    "Description": "payment product",
    "StatementDescriptor": null,
    "Status": {
      "ID": null,
      "Info": null,
      "Reasons": [
        {
          "Code": "1206",
          "Info": "CardDetails are missing"
        }
      ]
    }
  }
}