Request payout

1. Get payment token

Start by generating a payment token. Make a HTTP POST request to the relevant endpoint + /api/oauth/token/ using the access token you generated.

Request

curl --location --request POST 'https://uat.app.payvyne.com/api/oauth/token' 
--header 'Content-Type: application/x-www-form-urlencoded' 
--data-urlencode 'grant_type=client_credentials' 
--data-urlencode 'client_id=<payment_key>'
--data-urlencode 'client_secret=<payment_secret>’

2. Create payout request

Then, create a PRPR - Payout Request. Send an HTTP POST request to the relevant endpoint + /api/v1/payouts including the headers Authorization: Bearer <payment_token>. You can use the same payment token generated in the first step.

The request body should contain a list of objects that contain the paymentId and the amount.

Request

curl --location --request POST 'https://uat.app.payvyne.com/api/v1/payouts' \
--header 'Authorization: Bearer <payment_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "requests": [
        {
            "paymentId": "70d824bed325f86c",
            "amount": 2.4,
            "idempotencyId": "1"
        },
        {
            "paymentId": "70d824bed325f86c",
            "amount": 9,
            "idempotencyId": "2"
        },
        {
            "paymentId": "70d824bed325f86c",
            "amount": 0.1,
            "idempotencyId": "1"
        },
        {
            "paymentId": "1ac613c7ca3eca52",
            "amount": 1.00,
            "idempotencyId": "1"
        },
        {
            "paymentId": "c01b1373e64a0f49",
            "amount": 99999.99,
            "idempotencyId": "1"
        },
        {
            "paymentId": "4de89355d8fc67b0",
            "amount": 1,
            "idempotencyId": "1"
        }
    ]
}'

Response

{
    "payouts": [
        {
            "id": "94c7c2d41aa230a8",
            "status": "NEW",
            "amount": 2.4,
            "currency": "GBP",
            "paymentId": "70d824bed325f86c"
        },
        {
            "id": "4cb5427e221b9b5f",
            "status": "NEW",
            "amount": 9,
            "currency": "GBP",
            "paymentId": "70d824bed325f86c"
        },
        {
            "id": "0411a04360207173",
            "status": "NEW",
            "amount": 1.00,
            "currency": "GBP",
            "paymentId": "1ac613c7ca3eca52"
        }
    ],
    "errors": [
        {
            "paymentId": "70d824bed325f86c",
            "errorMessage": "Payout exists with this paymentId and idempotencyId!"
        },
        {
            "paymentId": "c01b1373e64a0f49",
            "errorMessage": "Payment is not in REFUNDED or SETTLED or PART_REFUNDED status!"
        },
        {
            "paymentId": "4de89355d8fc67b0",
            "errorMessage": "Could not find payment with ID=4de89355d8fc67b0"
        }
    ]
}

Response

Description

Success

A successful RRRR - Refund Request returns a 202 response code and an object with payouts and/or error lists:
“payouts” - List of payouts that were initiated successfully
“errors” - List of error details for payouts that could not be initiated. The error object contains the Payment ID and a short description explaining why the payout init failed.

Failure

If something unexpected happens during the request, the API returns an error response with the appropriate HTTP status code and a JSON response that contains detailed information about the problem.

Parameter

Description

payouts

List of payouts that were initiated successfully

errors

List of error details for payouts that could not be initiated. The error object contains the paymentId and a short description explaining why the payout initiation failed.


What’s Next

Now you've successfully requested a payout, learn how to get payout status updates.

Did this page help you?