Skip to content

Commit a99c8c5

Browse files
Merge pull request #110 from PaystackOSS/chore-transfer
chore: add verify snippet for doc
2 parents ea60eb1 + b5d30ae commit a99c8c5

File tree

8 files changed

+276
-68
lines changed

8 files changed

+276
-68
lines changed

dist/api/transfers/verify/response.json

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,52 @@
55
"status": true,
66
"message": "Transfer retrieved",
77
"data": {
8-
"amount": 20000,
9-
"createdAt": "2024-02-01T08:32:21.000Z",
8+
"amount": 100000,
9+
"createdAt": "2025-08-04T09:59:19.000Z",
1010
"currency": "NGN",
1111
"domain": "test",
1212
"failures": null,
13-
"id": 451930323,
13+
"id": 860670817,
1414
"integration": 463433,
15-
"reason": "Life go better for you",
16-
"reference": "ge-bzrf8u8k2pygxrnqf",
15+
"reason": "Bonus for the week",
16+
"reference": "acv_9ee55786-2323-4760-98e2-6380c9cb3f67",
1717
"source": "balance",
1818
"source_details": null,
1919
"status": "success",
2020
"titan_code": null,
21-
"transfer_code": "TRF_fpmd0l8uta8upow7",
22-
"request": 502643104,
21+
"transfer_code": "TRF_8opchtrhtjlfz90n",
22+
"request": 1068403325,
2323
"transferred_at": null,
24-
"updatedAt": "2024-02-01T08:34:07.000Z",
24+
"updatedAt": "2025-08-04T09:59:19.000Z",
2525
"recipient": {
2626
"active": true,
27-
"createdAt": "2021-10-21T11:08:04.000Z",
27+
"createdAt": "2023-07-11T15:42:27.000Z",
2828
"currency": "NGN",
29-
"description": null,
29+
"description": "",
3030
"domain": "test",
31-
"email": "[email protected]",
32-
"id": 19643784,
31+
"email": null,
32+
"id": 56824902,
3333
"integration": 463433,
34-
"metadata": {
35-
"custom_fields": [
36-
{
37-
"display_name": "Branch Name",
38-
"variable_name": "branchName",
39-
"value": "funny place, Alabama"
40-
},
41-
{
42-
"display_name": "Branch ID",
43-
"variable_name": "branchID",
44-
"value": "123"
45-
}
46-
]
47-
},
48-
"name": "Abbey Baker",
49-
"recipient_code": "RCP_rjs1szi4ax5hoeo",
34+
"metadata": null,
35+
"name": "Jekanmo Padie",
36+
"recipient_code": "RCP_gd9vgag7n5lr5ix",
5037
"type": "nuban",
51-
"updatedAt": "2023-03-29T08:39:39.000Z",
38+
"updatedAt": "2023-07-11T15:42:27.000Z",
5239
"is_deleted": false,
5340
"isDeleted": false,
5441
"details": {
5542
"authorization_code": null,
56-
"account_number": "0123456789",
57-
"account_name": "Abbey Baker",
58-
"bank_code": "058",
59-
"bank_name": "Guaranty Trust Bank"
43+
"account_number": "9876543210",
44+
"account_name": null,
45+
"bank_code": "044",
46+
"bank_name": "Access Bank"
6047
}
6148
},
6249
"session": {
6350
"provider": null,
6451
"id": null
6552
},
66-
"fee_charged": 0,
53+
"fee_charged": 1000,
6754
"fees_breakdown": null,
6855
"gateway_response": null
6956
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
const sh = `#!/bin/sh
2+
url="https://api.paystack.co/transfer/verify/{reference}"
3+
authorization="Authorization: Bearer YOUR_SECRET_KEY"
4+
5+
curl "$url" -H "$authorization" -X GET`
6+
7+
const js = `const https = require('https')
8+
9+
const options = {
10+
hostname: 'api.paystack.co',
11+
port: 443,
12+
path: '/transfer/verify/{reference}',
13+
method: 'GET',
14+
headers: {
15+
Authorization: 'Bearer SECRET_KEY'
16+
}
17+
}
18+
19+
https.request(options, res => {
20+
let data = ''
21+
22+
res.on('data', (chunk) => {
23+
data += chunk
24+
});
25+
26+
res.on('end', () => {
27+
console.log(JSON.parse(data))
28+
})
29+
}).on('error', error => {
30+
console.error(error)
31+
})`
32+
33+
const php = `<?php
34+
$curl = curl_init();
35+
36+
curl_setopt_array($curl, array(
37+
CURLOPT_URL => "https://api.paystack.co/transfer/verify/{reference}",
38+
CURLOPT_RETURNTRANSFER => true,
39+
CURLOPT_ENCODING => "",
40+
CURLOPT_MAXREDIRS => 10,
41+
CURLOPT_TIMEOUT => 30,
42+
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
43+
CURLOPT_CUSTOMREQUEST => "GET",
44+
CURLOPT_HTTPHEADER => array(
45+
"Authorization: Bearer SECRET_KEY",
46+
"Cache-Control: no-cache",
47+
),
48+
));
49+
50+
$response = curl_exec($curl);
51+
$err = curl_error($curl);
52+
53+
curl_close($curl);
54+
55+
if ($err) {
56+
echo "cURL Error #:" . $err;
57+
} else {
58+
echo $response;
59+
}
60+
?>`
61+
62+
const json = `{
63+
"status": true,
64+
"message": "Transfer retrieved",
65+
"data": {
66+
"amount": 100000,
67+
"createdAt": "2025-08-04T09:59:19.000Z",
68+
"currency": "NGN",
69+
"domain": "test",
70+
"failures": null,
71+
"id": 860670817,
72+
"integration": 463433,
73+
"reason": "Bonus for the week",
74+
"reference": "acv_9ee55786-2323-4760-98e2-6380c9cb3f67",
75+
"source": "balance",
76+
"source_details": null,
77+
"status": "success",
78+
"titan_code": null,
79+
"transfer_code": "TRF_8opchtrhtjlfz90n",
80+
"request": 1068403325,
81+
"transferred_at": null,
82+
"updatedAt": "2025-08-04T09:59:19.000Z",
83+
"recipient": {
84+
"active": true,
85+
"createdAt": "2023-07-11T15:42:27.000Z",
86+
"currency": "NGN",
87+
"description": "",
88+
"domain": "test",
89+
"email": null,
90+
"id": 56824902,
91+
"integration": 463433,
92+
"metadata": null,
93+
"name": "Jekanmo Padie",
94+
"recipient_code": "RCP_gd9vgag7n5lr5ix",
95+
"type": "nuban",
96+
"updatedAt": "2023-07-11T15:42:27.000Z",
97+
"is_deleted": false,
98+
"isDeleted": false,
99+
"details": {
100+
"authorization_code": null,
101+
"account_number": "9876543210",
102+
"account_name": null,
103+
"bank_code": "044",
104+
"bank_name": "Access Bank"
105+
}
106+
},
107+
"session": {
108+
"provider": null,
109+
"id": null
110+
},
111+
"fee_charged": 1000,
112+
"fees_breakdown": null,
113+
"gateway_response": null
114+
}
115+
}`
116+
117+
export {sh, js, php, json}

src/api/transfers/verify/response.json

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,52 @@
55
"status": true,
66
"message": "Transfer retrieved",
77
"data": {
8-
"amount": 20000,
9-
"createdAt": "2024-02-01T08:32:21.000Z",
8+
"amount": 100000,
9+
"createdAt": "2025-08-04T09:59:19.000Z",
1010
"currency": "NGN",
1111
"domain": "test",
1212
"failures": null,
13-
"id": 451930323,
13+
"id": 860670817,
1414
"integration": 463433,
15-
"reason": "Life go better for you",
16-
"reference": "ge-bzrf8u8k2pygxrnqf",
15+
"reason": "Bonus for the week",
16+
"reference": "acv_9ee55786-2323-4760-98e2-6380c9cb3f67",
1717
"source": "balance",
1818
"source_details": null,
1919
"status": "success",
2020
"titan_code": null,
21-
"transfer_code": "TRF_fpmd0l8uta8upow7",
22-
"request": 502643104,
21+
"transfer_code": "TRF_8opchtrhtjlfz90n",
22+
"request": 1068403325,
2323
"transferred_at": null,
24-
"updatedAt": "2024-02-01T08:34:07.000Z",
24+
"updatedAt": "2025-08-04T09:59:19.000Z",
2525
"recipient": {
2626
"active": true,
27-
"createdAt": "2021-10-21T11:08:04.000Z",
27+
"createdAt": "2023-07-11T15:42:27.000Z",
2828
"currency": "NGN",
29-
"description": null,
29+
"description": "",
3030
"domain": "test",
31-
"email": "[email protected]",
32-
"id": 19643784,
31+
"email": null,
32+
"id": 56824902,
3333
"integration": 463433,
34-
"metadata": {
35-
"custom_fields": [
36-
{
37-
"display_name": "Branch Name",
38-
"variable_name": "branchName",
39-
"value": "funny place, Alabama"
40-
},
41-
{
42-
"display_name": "Branch ID",
43-
"variable_name": "branchID",
44-
"value": "123"
45-
}
46-
]
47-
},
48-
"name": "Abbey Baker",
49-
"recipient_code": "RCP_rjs1szi4ax5hoeo",
34+
"metadata": null,
35+
"name": "Jekanmo Padie",
36+
"recipient_code": "RCP_gd9vgag7n5lr5ix",
5037
"type": "nuban",
51-
"updatedAt": "2023-03-29T08:39:39.000Z",
38+
"updatedAt": "2023-07-11T15:42:27.000Z",
5239
"is_deleted": false,
5340
"isDeleted": false,
5441
"details": {
5542
"authorization_code": null,
56-
"account_number": "0123456789",
57-
"account_name": "Abbey Baker",
58-
"bank_code": "058",
59-
"bank_name": "Guaranty Trust Bank"
43+
"account_number": "9876543210",
44+
"account_name": null,
45+
"bank_code": "044",
46+
"bank_name": "Access Bank"
6047
}
6148
},
6249
"session": {
6350
"provider": null,
6451
"id": null
6552
},
66-
"fee_charged": 0,
53+
"fee_charged": 1000,
6754
"fees_breakdown": null,
6855
"gateway_response": null
6956
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
languages:
2+
- sh
3+
- js
4+
- php
5+
- json
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const https = require('https')
2+
3+
const options = {
4+
hostname: 'api.paystack.co',
5+
port: 443,
6+
path: '/transfer/verify/{reference}',
7+
method: 'GET',
8+
headers: {
9+
Authorization: 'Bearer SECRET_KEY'
10+
}
11+
}
12+
13+
https.request(options, res => {
14+
let data = ''
15+
16+
res.on('data', (chunk) => {
17+
data += chunk
18+
});
19+
20+
res.on('end', () => {
21+
console.log(JSON.parse(data))
22+
})
23+
}).on('error', error => {
24+
console.error(error)
25+
})
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"status": true,
3+
"message": "Transfer retrieved",
4+
"data": {
5+
"amount": 100000,
6+
"createdAt": "2025-08-04T09:59:19.000Z",
7+
"currency": "NGN",
8+
"domain": "test",
9+
"failures": null,
10+
"id": 860670817,
11+
"integration": 463433,
12+
"reason": "Bonus for the week",
13+
"reference": "acv_9ee55786-2323-4760-98e2-6380c9cb3f67",
14+
"source": "balance",
15+
"source_details": null,
16+
"status": "success",
17+
"titan_code": null,
18+
"transfer_code": "TRF_8opchtrhtjlfz90n",
19+
"request": 1068403325,
20+
"transferred_at": null,
21+
"updatedAt": "2025-08-04T09:59:19.000Z",
22+
"recipient": {
23+
"active": true,
24+
"createdAt": "2023-07-11T15:42:27.000Z",
25+
"currency": "NGN",
26+
"description": "",
27+
"domain": "test",
28+
"email": null,
29+
"id": 56824902,
30+
"integration": 463433,
31+
"metadata": null,
32+
"name": "Jekanmo Padie",
33+
"recipient_code": "RCP_gd9vgag7n5lr5ix",
34+
"type": "nuban",
35+
"updatedAt": "2023-07-11T15:42:27.000Z",
36+
"is_deleted": false,
37+
"isDeleted": false,
38+
"details": {
39+
"authorization_code": null,
40+
"account_number": "9876543210",
41+
"account_name": null,
42+
"bank_code": "044",
43+
"bank_name": "Access Bank"
44+
}
45+
},
46+
"session": {
47+
"provider": null,
48+
"id": null
49+
},
50+
"fee_charged": 1000,
51+
"fees_breakdown": null,
52+
"gateway_response": null
53+
}
54+
}

0 commit comments

Comments
 (0)