Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 45 additions & 42 deletions dist/api/transfers/bulk/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ const sh = `#!/bin/sh
url="https://api.paystack.co/transfer/bulk"
authorization="Authorization: Bearer YOUR_SECRET_KEY"
content_type="Content-Type: application/json"
data='{
"currency": "NGN",
"source": "balance",
"transfers": [
{
"amount": 20000,
"reference": "588YtfftReF355894J",
"reason": "Why not?",
"recipient": "RCP_2tn9clt23s7qr28"
},
{
"amount": 30000,
"reference": "YunoTReF35e0r4J",
"reason": "Because I can",
"recipient": "RCP_1a25w1h3n0xctjg"
},
{
"amount": 40000,
"reason": "Coming right up",
"recipient": "RCP_aps2aibr69caua7"
}
]
data='{
"currency": "NGN",
"source": "balance",
"transfers": [
{
"amount": 20000,
"reference": "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496",
"reason": "Bonus for the week",
"recipient": "RCP_gd9vgag7n5lr5ix"
},
{
"amount": 35000,
"reference": "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50",
"reason": "Bonus for the week",
"recipient": "RCP_zpk2tgagu6lgb4g"
},
{
"amount": 15000,
"reference": "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457",
"reason": "Bonus for the week",
"recipient": "RCP_dfznnod8rwxlwgn"
}
]
}'

curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`
Expand All @@ -36,20 +37,21 @@ const params = JSON.stringify({
"transfers": [
{
"amount": 20000,
"reference": "588YtfftReF355894J",
"reason": "Why not?",
"recipient": "RCP_2tn9clt23s7qr28"
"reference": "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496",
"reason": "Bonus for the week",
"recipient": "RCP_gd9vgag7n5lr5ix"
},
{
"amount": 30000,
"reference": "YunoTReF35e0r4J",
"reason": "Because I can",
"recipient": "RCP_1a25w1h3n0xctjg"
"amount": 35000,
"reference": "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50",
"reason": "Bonus for the week",
"recipient": "RCP_zpk2tgagu6lgb4g"
},
{
"amount": 40000,
"reason": "Coming right up",
"recipient": "RCP_aps2aibr69caua7"
"amount": 15000,
"reference": "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457",
"reason": "Bonus for the week",
"recipient": "RCP_dfznnod8rwxlwgn"
}
]
})
Expand Down Expand Up @@ -90,20 +92,21 @@ const php = `<?php
'source' => "balance",
'transfers' => [[
"amount" => 20000,
"reference" => "588YtfftReF355894J",
"reason" => "Why not?",
"recipient" => "RCP_2tn9clt23s7qr28"
"reference" => "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496",
"reason" => "Bonus for the week",
"recipient" => "RCP_gd9vgag7n5lr5ix"
],
[
"amount" => 30000,
"reference" => "YunoTReF35e0r4J",
"reason" => "Because I can",
"recipient" => "RCP_1a25w1h3n0xctjg"
"amount" => 35000,
"reference" => "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50",
"reason" => "Bonus for the week",
"recipient" => "RCP_zpk2tgagu6lgb4g"
],
[
"amount" => 40000,
"reason" => "Coming right up",
"recipient" => "RCP_aps2aibr69caua7"
"amount" => 15000,
"reference" => "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457",
"reason" => "Bonus for the week",
"recipient" => "RCP_dfznnod8rwxlwgn"
]]
];

Expand Down
69 changes: 37 additions & 32 deletions dist/api/transfers/bulk/response.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,46 @@
"200": {
"description": "200 Ok",
"data": {
"status": true,
"message": "3 transfers queued.",
"data": [
{
"reference": "588YtfftReF355894J",
"recipient": "RCP_2tn9clt23s7qr28",
"amount": 20000,
"transfer_code": "TRF_ful4rvpbiuaph4fo",
"currency": "NGN",
"status": "received"
},
{
"reference": "YunoTReF35e0r4J",
"recipient": "RCP_1a25w1h3n0xctjg",
"amount": 30000,
"transfer_code": "TRF_0lztrf3rox1rpbw1",
"currency": "NGN",
"status": "received"
},
{
"reference": "nm7kjk9gb-l5i4lr9wq3",
"recipient": "RCP_aps2aibr69caua7",
"amount": 40000,
"transfer_code": "TRF_hsk59k6loek7vlut",
"currency": "NGN",
"status": "received"
}
]
}
"status": true,
"message": "3 transfers queued.",
"data": [
{
"reference": "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496",
"recipient": "RCP_gd9vgag7n5lr5ix",
"amount": 20000,
"transfer_code": "TRF_o0mv5dc2lv4t2wdb",
"currency": "NGN",
"status": "success"
},
{
"reference": "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50",
"recipient": "RCP_zpk2tgagu6lgb4g",
"amount": 35000,
"transfer_code": "TRF_tlvxomz43gjso2py",
"currency": "NGN",
"status": "success"
},
{
"reference": "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457",
"recipient": "RCP_dfznnod8rwxlwgn",
"amount": 15000,
"transfer_code": "TRF_yt2y2gcd3dmli8av",
"currency": "NGN",
"status": "success"
}
]
}
},
"404": {
"description": "404 Not Found",
"data": {
"status": false,
"message": "The customer specified has no saved authorizations"
}
"status": false,
"message": "Duplicate reference(s) found: ACV_11bebfc3-18b3-40aa-a4df-c55068c93457,ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50,ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496",
"meta": {
"nextStep": "Try again later"
},
"type": "api_error",
"code": "unknown"
}
}
}
77 changes: 40 additions & 37 deletions dist/api/transfers/initiate/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ url="https://api.paystack.co/transfer"
authorization="Authorization: Bearer YOUR_SECRET_KEY"
content_type="Content-Type: application/json"
data='{
"source": "balance",
"reason": "Calm down",
"amount":3794800,
"recipient": "RCP_gx2wn530m0i3w3m"
"source": "balance",
"reason": "Bonus for the week",
"amount": 100000,
"recipient": "RCP_gd9vgag7n5lr5ix",
"reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68"
}'

curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`

const js = `const https = require('https')

const params = JSON.stringify({
"source": "balance",
"reason": "Calm down",
"amount":3794800,
"recipient": "RCP_gx2wn530m0i3w3m"
"source": "balance",
"reason": "Bonus for the week",
"amount": 100000,
"recipient": "RCP_gd9vgag7n5lr5ix",
"reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68"
})

const options = {
Expand Down Expand Up @@ -49,35 +51,36 @@ req.write(params)
req.end()`

const php = `<?php
$url = "https://api.paystack.co/transfer";

$fields = [
"source" => "balance",
"reason" => "Calm down",
"amount" => 3794800,
"recipient" => "RCP_gx2wn530m0i3w3m"
];

$fields_string = http_build_query($fields);

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Bearer SECRET_KEY",
"Cache-Control: no-cache",
));

//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);

//execute post
$result = curl_exec($ch);
echo $result;
$url = "https://api.paystack.co/transfer";

$fields = [
"source" => "balance",
"reason" => "Bonus for the week",
"amount" => 100000,
"recipient" => "RCP_gd9vgag7n5lr5ix",
"reference" => "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68"
];

$fields_string = http_build_query($fields);

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Bearer SECRET_KEY",
"Cache-Control: no-cache",
));

//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

//execute post
$result = curl_exec($ch);
echo $result;
?>`

export {sh, js, php}
71 changes: 42 additions & 29 deletions dist/api/transfers/initiate/response.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
{
"200": {
"description": "200 Ok",
"data": {
"status": true,
"message": "Transfer requires OTP to continue",
"data": {
"integration": 100073,
"domain": "test",
"amount": 3794800,
"currency": "NGN",
"source": "balance",
"reason": "Calm down",
"recipient": 28,
"status": "otp",
"transfer_code": "TRF_1ptvuv321ahaa7q",
"id": 14,
"createdAt": "2017-02-03T17:21:54.508Z",
"updatedAt": "2017-02-03T17:21:54.508Z"
}
}
},
"404": {
"description": "404 Not Found",
"data": {
"status": false,
"message": "The customer specified has no saved authorizations"
}
}
}
"200": {
"description": "200 Ok",
"data": {
"status": true,
"message": "Transfer has been queued",
"data": {
"transfersessionid": [],
"transfertrials": [],
"domain": "test",
"amount": 100000,
"currency": "NGN",
"reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68",
"source": "balance",
"source_details": null,
"reason": "Bonus for the week",
"status": "success",
"failures": null,
"transfer_code": "TRF_v5tip3zx8nna9o78",
"titan_code": null,
"transferred_at": null,
"id": 860703114,
"integration": 463433,
"request": 1068439313,
"recipient": 56824902,
"createdAt": "2025-08-04T10:32:40.000Z",
"updatedAt": "2025-08-04T10:32:40.000Z"
}
}
},
"400": {
"description": "400 Bad Request",
"data": {
"status": false,
"message": "Recipient specified is invalid",
"meta": {
"nextStep": "Provide a valid recipient. Ensure you are passing the recipient code in the recipient param"
},
"type": "validation_error",
"code": "invalid_transfer_recipient"
}
}
}
Loading