Make a payout

Requesting a payment

1. Get payment token

Start by generating a payment token. Read our guide on how to request a payout to understand how.

2. Create payout request

Next create a PR. Send an HTTP POST request to the relevant endpoint + /api/v1/partners/payouts/ including the header Authorization: Bearer <payment_token>. You can use the same payment token generated in the first step.

The request body should contain an array of requests with customerReference, accountDetails, amountandcurrency` corresponding to each payout required.

Request

curl --location --request POST 'https://uat.app.payvyne.com/api/v1/partners/payouts' \
--header 'Authorization: Bearer <payment_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "merchantId": "a0adb8ed7178d2",
    "requests": [
            "customerReference": "customer1",
            "accountDetails": {
              "accountNo": "63849203",
              "sortCode": "001111",
              "accountType": "SCAN"
            "amount": 2.4,
            "currency":"GBP",
            "idempotencyId": "2d83d3fe3-0848-4562-a263-96d7d761cf3r"
        },
        {
            "customerReference": "customer2",
            "accountDetails": {
              "accountNo": "63849203",
              "sortCode": "001111",
              "accountType": "SCAN"
            "amount": 9,
            "currency":"GBP",
            "idempotencyId": "22d83d3fe3-0848-4562-a263-96d7d761cf3r"
        },
        {
            "customerReference": "customer3",
            "accountDetails": {
              "accountNo": "63849203",
              "sortCode": "001111",
              "accountType": "SCAN"
            "amount": 0.1,
            "currency":"GBP",
            "idempotencyId": "2d83d3fe3-0848-4562-a263-96d7d761cf3r"
                    },
        {
            "customerReference": "customer4",
            "accountDetails": {
              "accountNo": "63849203",
              "sortCode": "001111",
              "accountType": "SCAN"
            "amount": 1,
            "currency":"GBP",
            "idempotencyId": "2d83d3fe3-0848-4562-a263-96d7d761cf3r"
        },
        {
            "customerReference": "customer5",
            "accountDetails": {
              "iban": "LT34 7750 5484 9468 1243",
              "accountType": "IBAN"
            "amount": 99999.99,
            "currency":"EUR",
            "idempotencyId": "2d83d3fe3-0848-4562-a263-96d7d761cf3r"
        },
        {
            "customerReference": "customer6",
            "accountDetails": {
              "iban": "LT34 3250 0909 3475 7655",
              "accountType": "IBAN"
            "amount": 1,
            "currency":"EUR",
            "idempotencyId": "2d83d3fe3-0848-4562-a263-96d7d761cf3r"
        }
    ]
}'

Response

{
    "payouts": [
        {
            "id": "94c7c2d41aa230a8",
            "status": "NEW",
            "amount": 2.4,
            "merchant": "a0adb8ed7178d2",
        },
        {
            "id": "4cb5427e221b9b5f",
            "status": "NEW",
            "amount": 9,
            "currency": "GBP",
            "merchant": "a0adb8ed7178d2",
        },
        {
            "id": "0411a04360207173",
            "status": "NEW",
            "amount": 1.00,
            "currency": "EUR",
            "merchant": "a0adb8ed7178d2",
        }
    ],
    "errors": [
        {
            "idempotencyId": "490da931-ea00-4aff-bffb-eed38cb4d00c",
            "errorMessage": "Could not find payment with reference=customerxxxxx"
        },
        {
            "idempotencyId": "nfkdnd845n5ke9jd9jt3",
            "errorMessage": "Payout exists with this idempotencyId!"
        }
    ]
}

Payout status updates

Vyne offers two ways for partners to be updated on the status of payouts.

Approach 1: Webhook status updates

Vyne provides webhooks to inform of payout status updates. More details can be found here.

Approach 2: Get payout status

You can request the status of on any refund at any time by sending an HTTP GET request to the relevant base URL + /api/v1/partners/payouts/ including the headers Authorization: Bearer <payment_token>. Generate a fresh payment token for the <payment_token>.

Request

curl --location --request GET 'https://uat.app.payvyne.com/api/v1/partners/payouts/520f6dec2b1f6dc8' \
--header 'Authorization: Bearer <payment_token>' \
--header 'Content-Type: application/json'

Response

{
  "payoutId": "4c0baba6eb85b05c",
  "status": "FAILED",
  "paymentId": "f4fce78db4020045",
  "amount": 10,
  "currency": "GBP"
}

Payout statuses

Payout requests can be in a number of statuses. These statuses reflect the what stage in the payment executing journey the payout request is at. Find out more about payout statuses here.


Did this page help you?