diff --git a/dist/api/transfers/bulk/requests.js b/dist/api/transfers/bulk/requests.js index c204dab..49cc7e5 100644 --- a/dist/api/transfers/bulk/requests.js +++ b/dist/api/transfers/bulk/requests.js @@ -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` @@ -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" } ] }) @@ -90,20 +92,21 @@ const php = ` "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" ]] ]; diff --git a/dist/api/transfers/bulk/response.json b/dist/api/transfers/bulk/response.json index 316cc38..057df11 100644 --- a/dist/api/transfers/bulk/response.json +++ b/dist/api/transfers/bulk/response.json @@ -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" + } } } diff --git a/dist/api/transfers/initiate/requests.js b/dist/api/transfers/initiate/requests.js index 02248e7..3a58230 100644 --- a/dist/api/transfers/initiate/requests.js +++ b/dist/api/transfers/initiate/requests.js @@ -3,10 +3,11 @@ 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` @@ -14,10 +15,11 @@ 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 = { @@ -49,35 +51,36 @@ req.write(params) req.end()` const php = ` "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} \ No newline at end of file diff --git a/dist/api/transfers/initiate/response.json b/dist/api/transfers/initiate/response.json index 715011a..ea73ba8 100644 --- a/dist/api/transfers/initiate/response.json +++ b/dist/api/transfers/initiate/response.json @@ -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" + } + } +} \ No newline at end of file diff --git a/dist/doc/payments/webhooks/events.js b/dist/doc/payments/webhooks/events.js index 1be2e56..1cf3ed3 100644 --- a/dist/doc/payments/webhooks/events.js +++ b/dist/doc/payments/webhooks/events.js @@ -978,49 +978,56 @@ const transfer_reversed = `{ const transfer_successful = `{ "event": "transfer.success", "data": { - "amount": 30000, + "amount": 100000, + "createdAt": "2025-08-04T10:32:40.000Z", "currency": "NGN", "domain": "test", "failures": null, - "id": 37272792, + "id": 860703114, "integration": { "id": 463433, "is_live": true, - "business_name": "Boom Boom Industries NG" + "business_name": "Paystack Demo", + "logo_path": "https://public-files-paystack-prod.s3.eu-west-1.amazonaws.com/integration-logos/hpyxo8n1c7du6gxup7h6.png" }, - "reason": "Have fun...", - "reference": "1jhbs3ozmen0k7y5efmw", + "reason": "Bonus for the week", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68", "source": "balance", "source_details": null, "status": "success", "titan_code": null, - "transfer_code": "TRF_wpl1dem4967avzm", + "transfer_code": "TRF_v5tip3zx8nna9o78", "transferred_at": null, + "updatedAt": "2025-08-04T10:32:40.000Z", "recipient": { "active": true, + "createdAt": "2023-07-11T15:42:27.000Z", "currency": "NGN", "description": "", "domain": "test", "email": null, - "id": 8690817, + "id": 56824902, "integration": 463433, "metadata": null, - "name": "Jack Sparrow", - "recipient_code": "RCP_a8wkxiychzdzfgs", + "name": "Jekanmo Padie", + "recipient_code": "RCP_gd9vgag7n5lr5ix", "type": "nuban", + "updatedAt": "2023-07-11T15:42:27.000Z", "is_deleted": false, "details": { - "account_number": "0000000000", + "authorization_code": null, + "account_number": "9876543210", "account_name": null, - "bank_code": "011", - "bank_name": "First Bank of Nigeria" - }, - "created_at": "2020-09-03T12:11:25.000Z", - "updated_at": "2020-09-03T12:11:25.000Z" + "bank_code": "044", + "bank_name": "Access Bank" + } + }, + "session": { + "provider": null, + "id": null }, - "session": { "provider": null, "id": null }, - "created_at": "2020-10-26T12:28:57.000Z", - "updated_at": "2020-10-26T12:28:57.000Z" + "fee_charged": 0, + "gateway_response": null } }` diff --git a/dist/doc/transfers/bulk/batches.js b/dist/doc/transfers/bulk/batches.js new file mode 100644 index 0000000..2a7be00 --- /dev/null +++ b/dist/doc/transfers/bulk/batches.js @@ -0,0 +1,24 @@ +const json = `{ + "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" + } + ] +}` + +export {json} \ No newline at end of file diff --git a/dist/doc/transfers/bulk/initiate-transfer.js b/dist/doc/transfers/bulk/initiate-transfer.js index b3b5cd6..8c26f10 100644 --- a/dist/doc/transfers/bulk/initiate-transfer.js +++ b/dist/doc/transfers/bulk/initiate-transfer.js @@ -3,27 +3,28 @@ 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" - } - ] + "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` @@ -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" } ] }) @@ -88,23 +90,26 @@ const php = ` "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" - ]] + '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" + ] + ] ]; $fields_string = http_build_query($fields); @@ -134,28 +139,28 @@ const json = `{ "message": "3 transfers queued.", "data": [ { - "reference": "588YtfftReF355894J", - "recipient": "RCP_2tn9clt23s7qr28", + "reference": "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496", + "recipient": "RCP_gd9vgag7n5lr5ix", "amount": 20000, - "transfer_code": "TRF_ful4rvpbiuaph4fo", + "transfer_code": "TRF_o0mv5dc2lv4t2wdb", "currency": "NGN", - "status": "received" + "status": "success" }, { - "reference": "YunoTReF35e0r4J", - "recipient": "RCP_1a25w1h3n0xctjg", - "amount": 30000, - "transfer_code": "TRF_0lztrf3rox1rpbw1", + "reference": "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50", + "recipient": "RCP_zpk2tgagu6lgb4g", + "amount": 35000, + "transfer_code": "TRF_tlvxomz43gjso2py", "currency": "NGN", - "status": "received" + "status": "success" }, { - "reference": "nm7kjk9gb-l5i4lr9wq3", - "recipient": "RCP_aps2aibr69caua7", - "amount": 40000, - "transfer_code": "TRF_hsk59k6loek7vlut", + "reference": "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457", + "recipient": "RCP_dfznnod8rwxlwgn", + "amount": 15000, + "transfer_code": "TRF_yt2y2gcd3dmli8av", "currency": "NGN", - "status": "received" + "status": "success" } ] }` diff --git a/dist/doc/transfers/recipients/list-bank.js b/dist/doc/transfers/recipients/list-bank.js new file mode 100644 index 0000000..b66c4f9 --- /dev/null +++ b/dist/doc/transfers/recipients/list-bank.js @@ -0,0 +1,85 @@ +const sh = `curl https://api.paystack.co/bank?currency=NGN +-H "Authorization: Bearer YOUR_SECRET_KEY" +-X GET` + +const js = `const https = require('https') + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/bank?currency=NGN', + method: 'GET', + headers: { + Authorization: 'Bearer SECRET_KEY' + } +} + +https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +})` + +const php = ` "https://api.paystack.co/bank?currency=NGN", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_HTTPHEADER => array( + "Authorization: Bearer SECRET_KEY", + "Cache-Control: no-cache", + ), +)); + +$response = curl_exec($curl); +$err = curl_error($curl); + +curl_close($curl); + +if ($err) { + echo "cURL Error #:" . $err; +} else { + echo $response; +} +?>` + +const json = `{ + "status": true, + "message": "Banks retrieved", + "data": [ + { + "name": "Abbey Mortgage Bank", + "slug": "abbey-mortgage-bank", + "code": "801", + "longcode": "", + "gateway": null, + "pay_with_bank": false, + "active": true, + "is_deleted": false, + "country": "Nigeria", + "currency": "NGN", + "type": "nuban", + "id": 174, + "createdAt": "2020-12-07T16:19:09.000Z", + "updatedAt": "2020-12-07T16:19:19.000Z" + } + ] +} +` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/recipients/list-telcos.js b/dist/doc/transfers/recipients/list-telcos.js new file mode 100644 index 0000000..df828c3 --- /dev/null +++ b/dist/doc/transfers/recipients/list-telcos.js @@ -0,0 +1,117 @@ +const sh = `curl https://api.paystack.co/bank?currency=GHS&type=mobile_money +-H "Authorization: Bearer YOUR_SECRET_KEY" +-X GET +` + +const js = `const https = require('https') + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/bank?currency=GHS&type=mobile_money', + method: 'GET', + headers: { + Authorization: 'Bearer SECRET_KEY' + } +} + +https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +})` + +const php = ` "https://api.paystack.co/bank?currency=GHS&type=mobile_money", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_HTTPHEADER => array( + "Authorization: Bearer SECRET_KEY", + "Cache-Control: no-cache", + ), +)); + +$response = curl_exec($curl); +$err = curl_error($curl); + +curl_close($curl); + +if ($err) { + echo "cURL Error #:" . $err; +} else { + echo $response; +} +?>` + +const json = `{ + "status": true, + "message": "Banks retrieved", + "data": [ + { + "name": "AirtelTigo", + "slug": "atl-mobile-money", + "code": "ATL", + "longcode": "", + "gateway": null, + "pay_with_bank": false, + "active": true, + "is_deleted": null, + "country": "Ghana", + "currency": "GHS", + "type": "mobile_money", + "id": 29, + "createdAt": "2018-03-29T12:54:59.000Z", + "updatedAt": "2020-01-24T10:01:06.000Z" + }, + { + "name": "MTN", + "slug": "mtn-mobile-money", + "code": "MTN", + "longcode": "", + "gateway": null, + "pay_with_bank": false, + "active": true, + "is_deleted": null, + "country": "Ghana", + "currency": "GHS", + "type": "mobile_money", + "id": 28, + "createdAt": "2018-03-29T12:54:59.000Z", + "updatedAt": "2019-10-22T11:04:46.000Z" + }, + { + "name": "Vodafone", + "slug": "vod-mobile-money", + "code": "VOD", + "longcode": "", + "gateway": null, + "pay_with_bank": false, + "active": true, + "is_deleted": null, + "country": "Ghana", + "currency": "GHS", + "type": "mobile_money", + "id": 66, + "createdAt": "2018-03-29T12:54:59.000Z", + "updatedAt": "2019-10-22T11:05:08.000Z" + } + ] +}` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/recipients/transfer-recipient-auth.js b/dist/doc/transfers/recipients/transfer-recipient-auth.js new file mode 100644 index 0000000..e56657d --- /dev/null +++ b/dist/doc/transfers/recipients/transfer-recipient-auth.js @@ -0,0 +1,107 @@ +const sh = `curl https://api.paystack.co/transferrecipient +-H "Authorization: Bearer YOUR_SECRET_KEY" +-H "Content-Type: application/json" +-d '{ "type": "authorization", + "name": "Revs Ore", + "email": "revs@ore.com", + "authorization_code": "AUTH_ncx8hews93" + }' +-X POST` + +const js = `const https = require('https') + +const params = JSON.stringify({ + "type":"authorization", + "name" : "Revs Ore", + "email": "revs@ore.com", + "authorization_code": "AUTH_ncx8hews93" +}) + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/transferrecipient', + method: 'POST', + headers: { + Authorization: 'Bearer SECRET_KEY', + 'Content-Type': 'application/json' + } +} + +const req = https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +}) + +req.write(params) +req.end()` + +const php = ` "authorization", + 'name' => "Revs Ore", + 'email' => "revs@ore.com", + 'authorization_code' => "AUTH_ncx8hews93" + ]; + + $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; +?>` + +const json = `{ + "status": true, + "message": "Transfer recipient created successfully", + "data": { + "active": true, + "createdAt": "2022-02-21T11:35:59.302Z", + "currency": "NGN", + "domain": "test", + "email": "revs@ore.com", + "id": 25747878, + "integration": 463433, + "name": "Revs Ore", + "recipient_code": "RCP_wql6bj95bll7m6h", + "type": "authorization", + "updatedAt": "2022-02-21T11:35:59.302Z", + "is_deleted": false, + "isDeleted": false, + "details": { + "authorization_code": "AUTH_ncx8hews93", + "account_number": null, + "account_name": null, + "bank_code": "057", + "bank_name": "Zenith Bank" + } + } +}` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/recipients/transfer-recipient-bank.js b/dist/doc/transfers/recipients/transfer-recipient-bank.js new file mode 100644 index 0000000..8916128 --- /dev/null +++ b/dist/doc/transfers/recipients/transfer-recipient-bank.js @@ -0,0 +1,108 @@ +const sh = `curl https://api.paystack.co/transferrecipient +-H "Authorization: Bearer YOUR_SECRET_KEY" +-H "Content-Type: application/json" +-d '{ "type": "nuban", + "name": "John Doe", + "account_number": "0001234567", + "bank_code": "058", + "currency": "NGN" + }' +-X POST` + +const js = `const https = require('https') + +const params = JSON.stringify({ + "type":"nuban", + "name" : "John Doe", + "account_number": "0001234567", + "bank_code": "058", + "currency": "NGN" +}) + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/transferrecipient', + method: 'POST', + headers: { + Authorization: 'Bearer SECRET_KEY', + 'Content-Type': 'application/json' + } +} + +const req = https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +}) + +req.write(params) +req.end()` + +const php = ` "nuban", + 'name' => "John Doe", + 'account_number' => "0001234567", + 'bank_code' => "058", + 'currency' => "NGN" + ]; + + $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; +?>` + +const json = `{ + "status": true, + "message": "Transfer recipient created successfully", + "data": { + "active": true, + "createdAt": "2020-05-13T13:59:07.741Z", + "currency": "NGN", + "domain": "test", + "id": 6788170, + "integration": 428626, + "name": "John Doe", + "recipient_code": "RCP_t0ya41mp35flk40", + "type": "nuban", + "updatedAt": "2020-05-13T13:59:07.741Z", + "is_deleted": false, + "details": { + "authorization_code": null, + "account_number": "0001234567", + "account_name": null, + "bank_code": "058", + "bank_name": "Guaranty Trust Bank" + } + } +}` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/recipients/transfer-recipient-momo.js b/dist/doc/transfers/recipients/transfer-recipient-momo.js new file mode 100644 index 0000000..640cdeb --- /dev/null +++ b/dist/doc/transfers/recipients/transfer-recipient-momo.js @@ -0,0 +1,109 @@ +const sh = `curl https://api.paystack.co/transferrecipient +-H "Authorization: Bearer YOUR_SECRET_KEY" +-H "Content-Type: application/json" +-d '{ "type": "mobile_money", + "name": "Abina Nana", + "account_number": "0551234987", + "bank_code": "MTN", + "currency": "GHS" + }' +-X POST` + +const js = `const https = require('https') + +const params = JSON.stringify({ + "type":"mobile_money", + "name" : "Abina Nana", + "account_number": "0551234987", + "bank_code": "MTN", + "currency": "GHS" +}) + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/transferrecipient', + method: 'POST', + headers: { + Authorization: 'Bearer SECRET_KEY', + 'Content-Type': 'application/json' + } +} + +const req = https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +}) + +req.write(params) +req.end()` + +const php = ` "mobile_money", + 'name' => "Abina Nana", + 'account_number' => "0551234987", + 'bank_code' => "MTN", + 'currency' => "GHS" + ]; + + $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; +?>` + +const json = `{ + "status": true, + "message": "Transfer recipient created successfully", + "data": { + "active": true, + "createdAt": "2022-02-21T12:57:02.156Z", + "currency": "GHS", + "domain": "test", + "id": 25753454, + "integration": 519035, + "name": "Abina Nana", + "recipient_code": "RCP_u2tnoyjjvh95pzm", + "type": "mobile_money", + "updatedAt": "2022-02-21T12:57:02.156Z", + "is_deleted": false, + "isDeleted": false, + "details": { + "authorization_code": null, + "account_number": "0551234987", + "account_name": null, + "bank_code": "MTN", + "bank_name": "MTN" + } + } +}` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/recipients/transfer-recipient-mpesa.js b/dist/doc/transfers/recipients/transfer-recipient-mpesa.js new file mode 100644 index 0000000..4fba903 --- /dev/null +++ b/dist/doc/transfers/recipients/transfer-recipient-mpesa.js @@ -0,0 +1,114 @@ +const sh = `#!/bin/sh +curl https://api.paystack.co/transferrecipient +-H "Authorization: Bearer YOUR_SECRET_KEY" +-H "Content-Type: application/json" +-d '{ "type": "mobile_money_business", + "name": "Till Transfer", + "bank_code": "MPTILL", + "account_number": "247247", + "currency": "KES" + }' +-X POST` + +const js = `const https = require('https') + +const params = JSON.stringify({ + "type": "mobile_money_business", + "name": "Till Transfer", + "bank_code": "MPTILL", + "account_number": "247247", + "currency": "KES" +}) + +const options = { + hostname: 'api.paystack.co', + port: 443, + path: '/transferrecipient', + method: 'POST', + headers: { + Authorization: 'Bearer SECRET_KEY', + 'Content-Type': 'application/json' + } +} + +const req = https.request(options, res => { + let data = '' + + res.on('data', (chunk) => { + data += chunk + }); + + res.on('end', () => { + console.log(JSON.parse(data)) + }) +}).on('error', error => { + console.error(error) +}) + +req.write(params) +req.end()` + +const php = ` "mobile_money_business", + "name" => "Till Transfer", + "bank_code" => "MPTILL", + "account_number" => "247247", + "currency" => "KES" + ]; + + $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; +?>` + +const json = `{ + "status": true, + "message": "Transfer recipient created successfully", + "data": { + "active": true, + "createdAt": "2024-11-28T09:28:50.000Z", + "currency": "KES", + "description": null, + "domain": "test", + "email": null, + "id": 92176030, + "integration": 845995, + "metadata": null, + "name": "Till Transfer Example", + "recipient_code": "RCP_5vl8b2yma7xdnjp", + "type": "mobile_money_business", + "updatedAt": "2024-11-28T09:28:50.000Z", + "is_deleted": false, + "isDeleted": false, + "details": { + "authorization_code": null, + "account_number": "247247", + "account_name": null, + "bank_code": "MPTILL", + "bank_name": "M-PESA Till" + } + } +} +` + +export {sh, js, php, json} \ No newline at end of file diff --git a/dist/doc/transfers/single/generate-reference.js b/dist/doc/transfers/single/generate-reference.js new file mode 100644 index 0000000..0fa0b30 --- /dev/null +++ b/dist/doc/transfers/single/generate-reference.js @@ -0,0 +1,9 @@ +const json = `{ + "source": "balance", + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" +}` + +export {json} \ No newline at end of file diff --git a/dist/doc/transfers/single/initiate-transfer.js b/dist/doc/transfers/single/initiate-transfer.js index d589232..41b7d66 100644 --- a/dist/doc/transfers/single/initiate-transfer.js +++ b/dist/doc/transfers/single/initiate-transfer.js @@ -1,12 +1,13 @@ const sh = `curl https://api.paystack.co/transfer -H "Authorization: Bearer YOUR_SECRET_KEY" -H "Content-Type: application/json" --d '{ "source": "balance", - "amount": "37800", - "reference": "your-unique-reference", - "recipient": "RCP_t0ya41mp35flk40", - "reason": "Holiday Flexing" - }' +-d '{ + "source": "balance", + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" +}' -X POST ` @@ -14,10 +15,10 @@ const js = `const https = require('https') const params = JSON.stringify({ "source": "balance", - "amount": 37800, - "reference": "your-unique-reference", - "recipient": "RCP_t0ya41mp35flk40", - "reason": "Holiday Flexing" + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" }) const options = { @@ -49,56 +50,63 @@ req.write(params) req.end()` const php = ` "balance", - 'amount' => 37800, - "reference" => "your-unique-reference", - 'recipient' => "RCP_t0ya41mp35flk40", - 'reason' => "Holiday Flexing" - ]; - - $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; + +?>` const json = `{ "status": true, "message": "Transfer has been queued", "data": { - "reference": "your-unique-reference", - "integration": 428626, + "transfersessionid": [], + "transfertrials": [], "domain": "test", - "amount": 37800, + "amount": 100000, "currency": "NGN", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68", "source": "balance", - "reason": "Holiday Flexing", - "recipient": 6788170, + "source_details": null, + "reason": "Bonus for the week", "status": "success", - "transfer_code": "TRF_fiyxvgkh71e717b", - "id": 23070321, - "createdAt": "2020-05-13T14:22:49.687Z", - "updatedAt": "2020-05-13T14:22:49.687Z" + "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" } }` diff --git a/src/api/transfers/bulk/index.js b/src/api/transfers/bulk/index.js index 295afa9..2c701b3 100644 --- a/src/api/transfers/bulk/index.js +++ b/src/api/transfers/bulk/index.js @@ -6,20 +6,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" } ] }) diff --git a/src/api/transfers/bulk/index.php b/src/api/transfers/bulk/index.php index b1c2396..42b7827 100644 --- a/src/api/transfers/bulk/index.php +++ b/src/api/transfers/bulk/index.php @@ -6,20 +6,21 @@ '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" ]] ]; diff --git a/src/api/transfers/bulk/index.sh b/src/api/transfers/bulk/index.sh index 902cf54..ab3d53f 100644 --- a/src/api/transfers/bulk/index.sh +++ b/src/api/transfers/bulk/index.sh @@ -2,28 +2,29 @@ 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 \ No newline at end of file diff --git a/src/api/transfers/bulk/response.json b/src/api/transfers/bulk/response.json index 316cc38..057df11 100644 --- a/src/api/transfers/bulk/response.json +++ b/src/api/transfers/bulk/response.json @@ -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" + } } } diff --git a/src/api/transfers/initiate/index.js b/src/api/transfers/initiate/index.js index a58deb1..cb25778 100644 --- a/src/api/transfers/initiate/index.js +++ b/src/api/transfers/initiate/index.js @@ -1,10 +1,11 @@ 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 = { diff --git a/src/api/transfers/initiate/index.php b/src/api/transfers/initiate/index.php index 54c35cf..9af95d8 100644 --- a/src/api/transfers/initiate/index.php +++ b/src/api/transfers/initiate/index.php @@ -1,31 +1,32 @@ "balance", - "reason" => "Calm down", - "amount" => 3794800, - "recipient" => "RCP_gx2wn530m0i3w3m" - ]; +$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); +$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; +//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; ?> \ No newline at end of file diff --git a/src/api/transfers/initiate/index.sh b/src/api/transfers/initiate/index.sh index 260dfac..52e25ff 100644 --- a/src/api/transfers/initiate/index.sh +++ b/src/api/transfers/initiate/index.sh @@ -3,10 +3,11 @@ 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 \ No newline at end of file diff --git a/src/api/transfers/initiate/response.json b/src/api/transfers/initiate/response.json index 715011a..ea73ba8 100644 --- a/src/api/transfers/initiate/response.json +++ b/src/api/transfers/initiate/response.json @@ -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" + } + } +} \ No newline at end of file diff --git a/src/doc/payments/webhooks/events/transfer-successful.json b/src/doc/payments/webhooks/events/transfer-successful.json index 2e32629..b9dda7e 100644 --- a/src/doc/payments/webhooks/events/transfer-successful.json +++ b/src/doc/payments/webhooks/events/transfer-successful.json @@ -1,48 +1,55 @@ { "event": "transfer.success", "data": { - "amount": 30000, + "amount": 100000, + "createdAt": "2025-08-04T10:32:40.000Z", "currency": "NGN", "domain": "test", "failures": null, - "id": 37272792, + "id": 860703114, "integration": { "id": 463433, "is_live": true, - "business_name": "Boom Boom Industries NG" + "business_name": "Paystack Demo", + "logo_path": "https://public-files-paystack-prod.s3.eu-west-1.amazonaws.com/integration-logos/hpyxo8n1c7du6gxup7h6.png" }, - "reason": "Have fun...", - "reference": "1jhbs3ozmen0k7y5efmw", + "reason": "Bonus for the week", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68", "source": "balance", "source_details": null, "status": "success", "titan_code": null, - "transfer_code": "TRF_wpl1dem4967avzm", + "transfer_code": "TRF_v5tip3zx8nna9o78", "transferred_at": null, + "updatedAt": "2025-08-04T10:32:40.000Z", "recipient": { "active": true, + "createdAt": "2023-07-11T15:42:27.000Z", "currency": "NGN", "description": "", "domain": "test", "email": null, - "id": 8690817, + "id": 56824902, "integration": 463433, "metadata": null, - "name": "Jack Sparrow", - "recipient_code": "RCP_a8wkxiychzdzfgs", + "name": "Jekanmo Padie", + "recipient_code": "RCP_gd9vgag7n5lr5ix", "type": "nuban", + "updatedAt": "2023-07-11T15:42:27.000Z", "is_deleted": false, "details": { - "account_number": "0000000000", + "authorization_code": null, + "account_number": "9876543210", "account_name": null, - "bank_code": "011", - "bank_name": "First Bank of Nigeria" - }, - "created_at": "2020-09-03T12:11:25.000Z", - "updated_at": "2020-09-03T12:11:25.000Z" + "bank_code": "044", + "bank_name": "Access Bank" + } }, - "session": { "provider": null, "id": null }, - "created_at": "2020-10-26T12:28:57.000Z", - "updated_at": "2020-10-26T12:28:57.000Z" + "session": { + "provider": null, + "id": null + }, + "fee_charged": 0, + "gateway_response": null } } \ No newline at end of file diff --git a/src/doc/transfers/bulk/batches/config.yml b/src/doc/transfers/bulk/batches/config.yml new file mode 100644 index 0000000..42a65da --- /dev/null +++ b/src/doc/transfers/bulk/batches/config.yml @@ -0,0 +1,2 @@ +languages: + - json \ No newline at end of file diff --git a/src/doc/transfers/bulk/batches/index.json b/src/doc/transfers/bulk/batches/index.json new file mode 100644 index 0000000..e0c270a --- /dev/null +++ b/src/doc/transfers/bulk/batches/index.json @@ -0,0 +1,22 @@ +{ + "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" + } + ] +} \ No newline at end of file diff --git a/src/doc/transfers/bulk/initiate-transfer/index.js b/src/doc/transfers/bulk/initiate-transfer/index.js index 295afa9..2c701b3 100644 --- a/src/doc/transfers/bulk/initiate-transfer/index.js +++ b/src/doc/transfers/bulk/initiate-transfer/index.js @@ -6,20 +6,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" } ] }) diff --git a/src/doc/transfers/bulk/initiate-transfer/index.json b/src/doc/transfers/bulk/initiate-transfer/index.json index 3059cb8..3d042d6 100644 --- a/src/doc/transfers/bulk/initiate-transfer/index.json +++ b/src/doc/transfers/bulk/initiate-transfer/index.json @@ -3,28 +3,28 @@ "message": "3 transfers queued.", "data": [ { - "reference": "588YtfftReF355894J", - "recipient": "RCP_2tn9clt23s7qr28", + "reference": "ACV_2627bbfe-1a2a-4a1a-8d0e-9d2ee6c31496", + "recipient": "RCP_gd9vgag7n5lr5ix", "amount": 20000, - "transfer_code": "TRF_ful4rvpbiuaph4fo", + "transfer_code": "TRF_o0mv5dc2lv4t2wdb", "currency": "NGN", - "status": "received" + "status": "success" }, { - "reference": "YunoTReF35e0r4J", - "recipient": "RCP_1a25w1h3n0xctjg", - "amount": 30000, - "transfer_code": "TRF_0lztrf3rox1rpbw1", + "reference": "ACV_1bd0c1f8-78c2-463b-8bd4-ed9eeb36be50", + "recipient": "RCP_zpk2tgagu6lgb4g", + "amount": 35000, + "transfer_code": "TRF_tlvxomz43gjso2py", "currency": "NGN", - "status": "received" + "status": "success" }, { - "reference": "nm7kjk9gb-l5i4lr9wq3", - "recipient": "RCP_aps2aibr69caua7", - "amount": 40000, - "transfer_code": "TRF_hsk59k6loek7vlut", + "reference": "ACV_11bebfc3-18b3-40aa-a4df-c55068c93457", + "recipient": "RCP_dfznnod8rwxlwgn", + "amount": 15000, + "transfer_code": "TRF_yt2y2gcd3dmli8av", "currency": "NGN", - "status": "received" + "status": "success" } ] } \ No newline at end of file diff --git a/src/doc/transfers/bulk/initiate-transfer/index.php b/src/doc/transfers/bulk/initiate-transfer/index.php index b1c2396..9e300c9 100644 --- a/src/doc/transfers/bulk/initiate-transfer/index.php +++ b/src/doc/transfers/bulk/initiate-transfer/index.php @@ -4,23 +4,26 @@ $fields = [ '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" - ]] + '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" + ] + ] ]; $fields_string = http_build_query($fields); diff --git a/src/doc/transfers/bulk/initiate-transfer/index.sh b/src/doc/transfers/bulk/initiate-transfer/index.sh index 362b9ce..ab3d53f 100644 --- a/src/doc/transfers/bulk/initiate-transfer/index.sh +++ b/src/doc/transfers/bulk/initiate-transfer/index.sh @@ -3,27 +3,28 @@ 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" - } - ] + "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 \ No newline at end of file diff --git a/src/doc/transfers/single/list-bank/config.yml b/src/doc/transfers/recipients/list-bank/config.yml similarity index 100% rename from src/doc/transfers/single/list-bank/config.yml rename to src/doc/transfers/recipients/list-bank/config.yml diff --git a/src/doc/transfers/single/list-bank/index.js b/src/doc/transfers/recipients/list-bank/index.js similarity index 100% rename from src/doc/transfers/single/list-bank/index.js rename to src/doc/transfers/recipients/list-bank/index.js diff --git a/src/doc/transfers/single/list-bank/index.json b/src/doc/transfers/recipients/list-bank/index.json similarity index 100% rename from src/doc/transfers/single/list-bank/index.json rename to src/doc/transfers/recipients/list-bank/index.json diff --git a/src/doc/transfers/single/list-bank/index.php b/src/doc/transfers/recipients/list-bank/index.php similarity index 100% rename from src/doc/transfers/single/list-bank/index.php rename to src/doc/transfers/recipients/list-bank/index.php diff --git a/src/doc/transfers/single/list-bank/index.sh b/src/doc/transfers/recipients/list-bank/index.sh similarity index 100% rename from src/doc/transfers/single/list-bank/index.sh rename to src/doc/transfers/recipients/list-bank/index.sh diff --git a/src/doc/transfers/single/list-telcos/config.yml b/src/doc/transfers/recipients/list-telcos/config.yml similarity index 100% rename from src/doc/transfers/single/list-telcos/config.yml rename to src/doc/transfers/recipients/list-telcos/config.yml diff --git a/src/doc/transfers/single/list-telcos/index.js b/src/doc/transfers/recipients/list-telcos/index.js similarity index 100% rename from src/doc/transfers/single/list-telcos/index.js rename to src/doc/transfers/recipients/list-telcos/index.js diff --git a/src/doc/transfers/single/list-telcos/index.json b/src/doc/transfers/recipients/list-telcos/index.json similarity index 100% rename from src/doc/transfers/single/list-telcos/index.json rename to src/doc/transfers/recipients/list-telcos/index.json diff --git a/src/doc/transfers/single/list-telcos/index.php b/src/doc/transfers/recipients/list-telcos/index.php similarity index 100% rename from src/doc/transfers/single/list-telcos/index.php rename to src/doc/transfers/recipients/list-telcos/index.php diff --git a/src/doc/transfers/single/list-telcos/index.sh b/src/doc/transfers/recipients/list-telcos/index.sh similarity index 100% rename from src/doc/transfers/single/list-telcos/index.sh rename to src/doc/transfers/recipients/list-telcos/index.sh diff --git a/src/doc/transfers/single/transfer-recipient-auth/config.yml b/src/doc/transfers/recipients/transfer-recipient-auth/config.yml similarity index 100% rename from src/doc/transfers/single/transfer-recipient-auth/config.yml rename to src/doc/transfers/recipients/transfer-recipient-auth/config.yml diff --git a/src/doc/transfers/single/transfer-recipient-auth/index.js b/src/doc/transfers/recipients/transfer-recipient-auth/index.js similarity index 100% rename from src/doc/transfers/single/transfer-recipient-auth/index.js rename to src/doc/transfers/recipients/transfer-recipient-auth/index.js diff --git a/src/doc/transfers/single/transfer-recipient-auth/index.json b/src/doc/transfers/recipients/transfer-recipient-auth/index.json similarity index 100% rename from src/doc/transfers/single/transfer-recipient-auth/index.json rename to src/doc/transfers/recipients/transfer-recipient-auth/index.json diff --git a/src/doc/transfers/single/transfer-recipient-auth/index.php b/src/doc/transfers/recipients/transfer-recipient-auth/index.php similarity index 100% rename from src/doc/transfers/single/transfer-recipient-auth/index.php rename to src/doc/transfers/recipients/transfer-recipient-auth/index.php diff --git a/src/doc/transfers/single/transfer-recipient-auth/index.sh b/src/doc/transfers/recipients/transfer-recipient-auth/index.sh similarity index 100% rename from src/doc/transfers/single/transfer-recipient-auth/index.sh rename to src/doc/transfers/recipients/transfer-recipient-auth/index.sh diff --git a/src/doc/transfers/single/transfer-recipient-bank/config.yml b/src/doc/transfers/recipients/transfer-recipient-bank/config.yml similarity index 100% rename from src/doc/transfers/single/transfer-recipient-bank/config.yml rename to src/doc/transfers/recipients/transfer-recipient-bank/config.yml diff --git a/src/doc/transfers/single/transfer-recipient-bank/index.js b/src/doc/transfers/recipients/transfer-recipient-bank/index.js similarity index 100% rename from src/doc/transfers/single/transfer-recipient-bank/index.js rename to src/doc/transfers/recipients/transfer-recipient-bank/index.js diff --git a/src/doc/transfers/single/transfer-recipient-bank/index.json b/src/doc/transfers/recipients/transfer-recipient-bank/index.json similarity index 100% rename from src/doc/transfers/single/transfer-recipient-bank/index.json rename to src/doc/transfers/recipients/transfer-recipient-bank/index.json diff --git a/src/doc/transfers/single/transfer-recipient-bank/index.php b/src/doc/transfers/recipients/transfer-recipient-bank/index.php similarity index 100% rename from src/doc/transfers/single/transfer-recipient-bank/index.php rename to src/doc/transfers/recipients/transfer-recipient-bank/index.php diff --git a/src/doc/transfers/single/transfer-recipient-bank/index.sh b/src/doc/transfers/recipients/transfer-recipient-bank/index.sh similarity index 100% rename from src/doc/transfers/single/transfer-recipient-bank/index.sh rename to src/doc/transfers/recipients/transfer-recipient-bank/index.sh diff --git a/src/doc/transfers/single/transfer-recipient-momo/config.yml b/src/doc/transfers/recipients/transfer-recipient-momo/config.yml similarity index 100% rename from src/doc/transfers/single/transfer-recipient-momo/config.yml rename to src/doc/transfers/recipients/transfer-recipient-momo/config.yml diff --git a/src/doc/transfers/single/transfer-recipient-momo/index.js b/src/doc/transfers/recipients/transfer-recipient-momo/index.js similarity index 100% rename from src/doc/transfers/single/transfer-recipient-momo/index.js rename to src/doc/transfers/recipients/transfer-recipient-momo/index.js diff --git a/src/doc/transfers/single/transfer-recipient-momo/index.json b/src/doc/transfers/recipients/transfer-recipient-momo/index.json similarity index 100% rename from src/doc/transfers/single/transfer-recipient-momo/index.json rename to src/doc/transfers/recipients/transfer-recipient-momo/index.json diff --git a/src/doc/transfers/single/transfer-recipient-momo/index.php b/src/doc/transfers/recipients/transfer-recipient-momo/index.php similarity index 100% rename from src/doc/transfers/single/transfer-recipient-momo/index.php rename to src/doc/transfers/recipients/transfer-recipient-momo/index.php diff --git a/src/doc/transfers/single/transfer-recipient-momo/index.sh b/src/doc/transfers/recipients/transfer-recipient-momo/index.sh similarity index 100% rename from src/doc/transfers/single/transfer-recipient-momo/index.sh rename to src/doc/transfers/recipients/transfer-recipient-momo/index.sh diff --git a/src/doc/transfers/single/transfer-recipient-mpesa/config.yml b/src/doc/transfers/recipients/transfer-recipient-mpesa/config.yml similarity index 100% rename from src/doc/transfers/single/transfer-recipient-mpesa/config.yml rename to src/doc/transfers/recipients/transfer-recipient-mpesa/config.yml diff --git a/src/doc/transfers/single/transfer-recipient-mpesa/index.js b/src/doc/transfers/recipients/transfer-recipient-mpesa/index.js similarity index 100% rename from src/doc/transfers/single/transfer-recipient-mpesa/index.js rename to src/doc/transfers/recipients/transfer-recipient-mpesa/index.js diff --git a/src/doc/transfers/single/transfer-recipient-mpesa/index.json b/src/doc/transfers/recipients/transfer-recipient-mpesa/index.json similarity index 100% rename from src/doc/transfers/single/transfer-recipient-mpesa/index.json rename to src/doc/transfers/recipients/transfer-recipient-mpesa/index.json diff --git a/src/doc/transfers/single/transfer-recipient-mpesa/index.php b/src/doc/transfers/recipients/transfer-recipient-mpesa/index.php similarity index 100% rename from src/doc/transfers/single/transfer-recipient-mpesa/index.php rename to src/doc/transfers/recipients/transfer-recipient-mpesa/index.php diff --git a/src/doc/transfers/single/transfer-recipient-mpesa/index.sh b/src/doc/transfers/recipients/transfer-recipient-mpesa/index.sh similarity index 100% rename from src/doc/transfers/single/transfer-recipient-mpesa/index.sh rename to src/doc/transfers/recipients/transfer-recipient-mpesa/index.sh diff --git a/src/doc/transfers/single/generate-reference/config.yml b/src/doc/transfers/single/generate-reference/config.yml new file mode 100644 index 0000000..4bf5b91 --- /dev/null +++ b/src/doc/transfers/single/generate-reference/config.yml @@ -0,0 +1,2 @@ +languages: + - json \ No newline at end of file diff --git a/src/doc/transfers/single/generate-reference/index.json b/src/doc/transfers/single/generate-reference/index.json new file mode 100644 index 0000000..56a0d61 --- /dev/null +++ b/src/doc/transfers/single/generate-reference/index.json @@ -0,0 +1,7 @@ +{ + "source": "balance", + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" +} \ No newline at end of file diff --git a/src/doc/transfers/single/initiate-transfer/index.js b/src/doc/transfers/single/initiate-transfer/index.js index debe8e1..cb25778 100644 --- a/src/doc/transfers/single/initiate-transfer/index.js +++ b/src/doc/transfers/single/initiate-transfer/index.js @@ -2,10 +2,10 @@ const https = require('https') const params = JSON.stringify({ "source": "balance", - "amount": 37800, - "reference": "your-unique-reference", - "recipient": "RCP_t0ya41mp35flk40", - "reason": "Holiday Flexing" + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" }) const options = { diff --git a/src/doc/transfers/single/initiate-transfer/index.json b/src/doc/transfers/single/initiate-transfer/index.json index a2e3644..8ea43a5 100644 --- a/src/doc/transfers/single/initiate-transfer/index.json +++ b/src/doc/transfers/single/initiate-transfer/index.json @@ -2,18 +2,25 @@ "status": true, "message": "Transfer has been queued", "data": { - "reference": "your-unique-reference", - "integration": 428626, + "transfersessionid": [], + "transfertrials": [], "domain": "test", - "amount": 37800, + "amount": 100000, "currency": "NGN", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68", "source": "balance", - "reason": "Holiday Flexing", - "recipient": 6788170, + "source_details": null, + "reason": "Bonus for the week", "status": "success", - "transfer_code": "TRF_fiyxvgkh71e717b", - "id": 23070321, - "createdAt": "2020-05-13T14:22:49.687Z", - "updatedAt": "2020-05-13T14:22:49.687Z" + "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" } } \ No newline at end of file diff --git a/src/doc/transfers/single/initiate-transfer/index.php b/src/doc/transfers/single/initiate-transfer/index.php index 349403b..69a78f9 100644 --- a/src/doc/transfers/single/initiate-transfer/index.php +++ b/src/doc/transfers/single/initiate-transfer/index.php @@ -1,32 +1,33 @@ "balance", - 'amount' => 37800, - "reference" => "your-unique-reference", - 'recipient' => "RCP_t0ya41mp35flk40", - 'reason' => "Holiday Flexing" - ]; +$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); +$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; -?> +//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; + +?> \ No newline at end of file diff --git a/src/doc/transfers/single/initiate-transfer/index.sh b/src/doc/transfers/single/initiate-transfer/index.sh index 85b9d7b..73df863 100644 --- a/src/doc/transfers/single/initiate-transfer/index.sh +++ b/src/doc/transfers/single/initiate-transfer/index.sh @@ -1,10 +1,11 @@ curl https://api.paystack.co/transfer -H "Authorization: Bearer YOUR_SECRET_KEY" -H "Content-Type: application/json" --d '{ "source": "balance", - "amount": "37800", - "reference": "your-unique-reference", - "recipient": "RCP_t0ya41mp35flk40", - "reason": "Holiday Flexing" - }' +-d '{ + "source": "balance", + "reason": "Bonus for the week", + "amount": 100000, + "recipient": "RCP_gd9vgag7n5lr5ix", + "reference": "ACV_9ee55786-2323-4760-98e2-6380c9cb3f68" +}' -X POST