Skip to content

Commit b5dec5e

Browse files
Merge pull request #83 from PaystackOSS/patch-subaccounts
Chore: Update Subaccount responses
2 parents 2240038 + 7dc8458 commit b5dec5e

File tree

13 files changed

+164
-231
lines changed

13 files changed

+164
-231
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"200": {
3-
"description": "200 Ok",
2+
"201": {
3+
"description": "201 Created",
44
"data": {
55
"status": true,
66
"message": "Subaccount created",
77
"data": {
8-
"integration": 100973,
8+
"business_name": "Oasis",
9+
"account_number": "0123456047",
10+
"percentage_charge": 30,
11+
"settlement_bank": "Guaranty Trust Bank",
12+
"currency": "NGN",
13+
"bank": 9,
14+
"integration": 463433,
915
"domain": "test",
10-
"subaccount_code": "ACCT_4hl4xenwpjy5wb",
11-
"business_name": "Sunshine Studios",
12-
"description": null,
13-
"primary_contact_name": null,
14-
"primary_contact_email": null,
15-
"primary_contact_phone": null,
16-
"metadata": null,
17-
"percentage_charge": 18.2,
16+
"account_name": "LARRY JAMES O",
17+
"product": "collection",
18+
"managed_by_integration": 463433,
19+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
1820
"is_verified": false,
19-
"settlement_bank": "Access Bank",
20-
"account_number": "0193274682",
2121
"settlement_schedule": "AUTO",
2222
"active": true,
2323
"migrate": false,
24-
"id": 55,
25-
"createdAt": "2016-10-05T13:22:04.000Z",
26-
"updatedAt": "2016-10-21T02:19:47.000Z"
24+
"id": 1151727,
25+
"createdAt": "2024-08-26T09:24:28.723Z",
26+
"updatedAt": "2024-08-26T09:24:28.723Z"
2727
}
2828
}
2929
}
30-
}
30+
}

dist/api/subaccounts/fetch/response.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@
55
"status": true,
66
"message": "Subaccount retrieved",
77
"data": {
8-
"integration": 100973,
8+
"integration": 463433,
9+
"bank": 9,
10+
"managed_by_integration": 463433,
911
"domain": "test",
10-
"subaccount_code": "ACCT_4hl4xenwpjy5wb",
11-
"business_name": "Sunshine Studios",
12+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
13+
"business_name": "Oasis",
1214
"description": null,
1315
"primary_contact_name": null,
14-
"primary_contact_email": "[email protected]",
16+
"primary_contact_email": null,
1517
"primary_contact_phone": null,
1618
"metadata": null,
17-
"percentage_charge": 18.9,
19+
"percentage_charge": 30,
1820
"is_verified": false,
19-
"settlement_bank": "Access Bank",
20-
"account_number": "0193274682",
21+
"settlement_bank": "Guaranty Trust Bank",
22+
"account_number": "0123456047",
2123
"settlement_schedule": "AUTO",
2224
"active": true,
2325
"migrate": false,
24-
"id": 55,
25-
"createdAt": "2016-10-05T13:22:04.000Z",
26-
"updatedAt": "2016-10-21T02:19:47.000Z"
26+
"currency": "NGN",
27+
"account_name": "LARRY JAMES O",
28+
"product": "collection",
29+
"id": 1151727,
30+
"createdAt": "2024-08-26T09:24:28.000Z",
31+
"updatedAt": "2024-08-26T09:24:28.000Z"
2732
}
2833
}
2934
}
30-
}
35+
}

dist/api/subaccounts/list/response.json

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,29 @@
66
"message": "Subaccounts retrieved",
77
"data": [
88
{
9-
"integration": 129938,
10-
"domain": "test",
11-
"subaccount_code": "ACCT_cljt3j4cp0kb2gq",
12-
"business_name": "Business 2",
13-
"description": null,
9+
"id": 1151727,
10+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
11+
"business_name": "Oasis",
12+
"description": "Oasis",
1413
"primary_contact_name": null,
1514
"primary_contact_email": null,
1615
"primary_contact_phone": null,
1716
"metadata": null,
18-
"percentage_charge": 20,
19-
"is_verified": false,
20-
"settlement_bank": "Zenith Bank",
21-
"account_number": "0193274382",
22-
"active": true,
23-
"migrate": false,
24-
"id": 53,
25-
"createdAt": "2016-10-05T12:55:47.000Z",
26-
"updatedAt": "2016-10-05T12:55:47.000Z"
27-
},
28-
{
29-
"integration": 129938,
30-
"domain": "test",
31-
"subaccount_code": "ACCT_vwy3d1gck2c9gxi",
32-
"business_name": "Sunshine Studios",
33-
"description": null,
34-
"primary_contact_name": null,
35-
"primary_contact_email": null,
36-
"primary_contact_phone": null,
37-
"metadata": null,
38-
"percentage_charge": 20,
39-
"is_verified": false,
40-
"settlement_bank": "Access Bank",
41-
"account_number": "0128633833",
42-
"active": true,
43-
"migrate": false,
44-
"id": 35,
45-
"createdAt": "2016-10-04T09:06:00.000Z",
46-
"updatedAt": "2016-10-04T09:06:00.000Z"
47-
},
48-
{
49-
"integration": 129938,
50-
"domain": "test",
51-
"subaccount_code": "ACCT_5mikcokeaknxk1f",
52-
"business_name": "Business 2",
53-
"description": null,
54-
"primary_contact_name": null,
55-
"primary_contact_email": null,
56-
"primary_contact_phone": null,
57-
"percentage_charge": 20,
58-
"is_verified": false,
59-
"settlement_bank": "Access Bank",
60-
"account_number": "0000000000",
61-
"active": true,
62-
"migrate": false,
63-
"id": 34,
64-
"createdAt": "2016-10-04T08:46:18.000Z",
65-
"updatedAt": "2016-10-04T08:46:18.000Z"
17+
"percentage_charge": 30,
18+
"settlement_bank": "Guaranty Trust Bank",
19+
"bank_id": 9,
20+
"account_number": "0123456047",
21+
"currency": "NGN",
22+
"active": 1
6623
}
6724
],
6825
"meta": {
69-
"total": 20,
26+
"total": 27,
7027
"skipped": 0,
71-
"perPage": "3",
28+
"perPage": 50,
7229
"page": 1,
73-
"pageCount": 7
30+
"pageCount": 1
7431
}
7532
}
7633
}
77-
}
34+
}

dist/api/subaccounts/update/response.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@
55
"status": true,
66
"message": "Subaccount updated",
77
"data": {
8-
"integration": 100973,
98
"domain": "test",
10-
"subaccount_code": "ACCT_4hl4xenwpjy5wb",
11-
"business_name": "Sunshine Studios",
12-
"description": null,
9+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
10+
"business_name": "Oasis Global",
11+
"description": "Provide IT services",
1312
"primary_contact_name": null,
14-
"primary_contact_email": "[email protected]",
13+
"primary_contact_email": null,
1514
"primary_contact_phone": null,
1615
"metadata": null,
17-
"percentage_charge": 18.9,
16+
"percentage_charge": 30,
1817
"is_verified": false,
19-
"settlement_bank": "Access Bank",
20-
"account_number": "0193274682",
18+
"settlement_bank": "Guaranty Trust Bank",
19+
"account_number": "0123456047",
2120
"settlement_schedule": "AUTO",
2221
"active": true,
2322
"migrate": false,
24-
"id": 55,
25-
"createdAt": "2016-10-05T13:22:04.000Z",
26-
"updatedAt": "2016-10-21T02:19:47.000Z"
23+
"currency": "NGN",
24+
"account_name": "LARRY JAMES O",
25+
"product": "collection",
26+
"id": 1151727,
27+
"integration": 463433,
28+
"bank": 9,
29+
"managed_by_integration": 463433,
30+
"createdAt": "2024-08-26T09:24:28.000Z",
31+
"updatedAt": "2024-08-26T09:34:18.000Z"
2732
}
2833
}
2934
}
30-
}
35+
}

dist/doc/payments/split-payment/create-subaccount.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
const sh = `curl https://api.paystack.co/subaccount
22
-H "Authorization: Bearer YOUR_SECRET_KEY"
33
-H "Content-Type: application/json"
4-
-d '{ "business_name": "Cheese Sticks",
4+
-d '{ "business_name": "Oasis",
55
"bank_code": "058",
6-
"account_number": "0123456789",
7-
"percentage_charge": 20
6+
"account_number": "0123456047",
7+
"percentage_charge": 30
88
}'
99
-X POST`
1010

1111
const js = `const https = require('https')
1212
1313
const params = JSON.stringify({
14-
"business_name": "Cheese Sticks",
14+
"business_name": "Oasis",
1515
"bank_code": "058",
16-
"account_number": "0123456789",
17-
"percentage_charge": 20
16+
"account_number": "0123456047",
17+
"percentage_charge": 30
1818
})
1919
2020
const options = {
@@ -49,10 +49,10 @@ const php = `<?php
4949
$url = "https://api.paystack.co/subaccount";
5050
5151
$fields = [
52-
'business_name' => "Cheese Sticks",
52+
'business_name' => "Oasis",
5353
'bank_code' => "058",
54-
'account_number' => "0123456789",
55-
'percentage_charge' => 20
54+
'account_number' => "0123456047",
55+
'percentage_charge' => 30
5656
];
5757
5858
$fields_string = http_build_query($fields);
@@ -81,27 +81,26 @@ const json = `{
8181
"status": true,
8282
"message": "Subaccount created",
8383
"data": {
84-
"business_name": "Cheese Sticks",
85-
"account_number": "0123456789",
86-
"percentage_charge": 20,
84+
"business_name": "Oasis",
85+
"account_number": "0123456047",
86+
"percentage_charge": 30,
8787
"settlement_bank": "Guaranty Trust Bank",
8888
"currency": "NGN",
8989
"bank": 9,
9090
"integration": 463433,
9191
"domain": "test",
92-
"account_name": "Jamie Ng",
92+
"account_name": "LARRY JAMES O",
9393
"product": "collection",
9494
"managed_by_integration": 463433,
95-
"subaccount_code": "ACCT_xxxxxxxxxxxx",
95+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
9696
"is_verified": false,
9797
"settlement_schedule": "AUTO",
9898
"active": true,
9999
"migrate": false,
100-
"id": 1026585,
101-
"createdAt": "2024-01-17T13:34:08.807Z",
102-
"updatedAt": "2024-01-17T13:34:08.807Z"
100+
"id": 1151727,
101+
"createdAt": "2024-08-26T09:24:28.723Z",
102+
"updatedAt": "2024-08-26T09:24:28.723Z"
103103
}
104-
}
105-
`
104+
}`
106105

107106
export {sh, js, php, json}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"200": {
3-
"description": "200 Ok",
2+
"201": {
3+
"description": "201 Created",
44
"data": {
55
"status": true,
66
"message": "Subaccount created",
77
"data": {
8-
"integration": 100973,
8+
"business_name": "Oasis",
9+
"account_number": "0123456047",
10+
"percentage_charge": 30,
11+
"settlement_bank": "Guaranty Trust Bank",
12+
"currency": "NGN",
13+
"bank": 9,
14+
"integration": 463433,
915
"domain": "test",
10-
"subaccount_code": "ACCT_4hl4xenwpjy5wb",
11-
"business_name": "Sunshine Studios",
12-
"description": null,
13-
"primary_contact_name": null,
14-
"primary_contact_email": null,
15-
"primary_contact_phone": null,
16-
"metadata": null,
17-
"percentage_charge": 18.2,
16+
"account_name": "LARRY JAMES O",
17+
"product": "collection",
18+
"managed_by_integration": 463433,
19+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
1820
"is_verified": false,
19-
"settlement_bank": "Access Bank",
20-
"account_number": "0193274682",
2121
"settlement_schedule": "AUTO",
2222
"active": true,
2323
"migrate": false,
24-
"id": 55,
25-
"createdAt": "2016-10-05T13:22:04.000Z",
26-
"updatedAt": "2016-10-21T02:19:47.000Z"
24+
"id": 1151727,
25+
"createdAt": "2024-08-26T09:24:28.723Z",
26+
"updatedAt": "2024-08-26T09:24:28.723Z"
2727
}
2828
}
2929
}
30-
}
30+
}

src/api/subaccounts/fetch/response.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,31 @@
55
"status": true,
66
"message": "Subaccount retrieved",
77
"data": {
8-
"integration": 100973,
8+
"integration": 463433,
9+
"bank": 9,
10+
"managed_by_integration": 463433,
911
"domain": "test",
10-
"subaccount_code": "ACCT_4hl4xenwpjy5wb",
11-
"business_name": "Sunshine Studios",
12+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
13+
"business_name": "Oasis",
1214
"description": null,
1315
"primary_contact_name": null,
14-
"primary_contact_email": "[email protected]",
16+
"primary_contact_email": null,
1517
"primary_contact_phone": null,
1618
"metadata": null,
17-
"percentage_charge": 18.9,
19+
"percentage_charge": 30,
1820
"is_verified": false,
19-
"settlement_bank": "Access Bank",
20-
"account_number": "0193274682",
21+
"settlement_bank": "Guaranty Trust Bank",
22+
"account_number": "0123456047",
2123
"settlement_schedule": "AUTO",
2224
"active": true,
2325
"migrate": false,
24-
"id": 55,
25-
"createdAt": "2016-10-05T13:22:04.000Z",
26-
"updatedAt": "2016-10-21T02:19:47.000Z"
26+
"currency": "NGN",
27+
"account_name": "LARRY JAMES O",
28+
"product": "collection",
29+
"id": 1151727,
30+
"createdAt": "2024-08-26T09:24:28.000Z",
31+
"updatedAt": "2024-08-26T09:24:28.000Z"
2732
}
2833
}
2934
}
30-
}
35+
}

0 commit comments

Comments
 (0)