Skip to content

Commit 5b7ff22

Browse files
Merge pull request #85 from PaystackOSS/patch-multi-split
Chore: Update Split requests and responses
2 parents 8333069 + 54e1bb5 commit 5b7ff22

File tree

33 files changed

+376
-520
lines changed

33 files changed

+376
-520
lines changed

dist/api/transaction-splits/add-account/requests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ url="https://api.paystack.co/split/:id/subaccount/add"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"subaccount": "ACCT_hdl8abxl8drhrl3",
7-
"share": 40000
6+
"subaccount": "ACCT_eg4sob4590pq9vb",
7+
"share": 20
88
}'
99
1010
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`
1111

1212
const js = `const https = require('https')
1313
1414
const params = JSON.stringify({
15-
"subaccount": "ACCT_hdl8abxl8drhrl3",
16-
"share": 40000
15+
"subaccount": "ACCT_eg4sob4590pq9vb",
16+
"share": 20
1717
})
1818
1919
const options = {
@@ -48,8 +48,8 @@ const php = `<?php
4848
$url = "https://api.paystack.co/split/:id/subaccount/add";
4949
5050
$fields = [
51-
"subaccount" => "ACCT_hdl8abxl8drhrl3",
52-
"share" => 40000
51+
"subaccount" => "ACCT_eg4sob4590pq9vb",
52+
"share" => 20
5353
];
5454
5555
$fields_string = http_build_query($fields);

dist/api/transaction-splits/add-account/response.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,51 @@
55
"status": true,
66
"message": "Subaccount added",
77
"data": {
8-
"id": 143,
9-
"name": "Test Doc",
8+
"id": 2703655,
9+
"name": "Halfsies",
1010
"type": "percentage",
1111
"currency": "NGN",
12-
"integration": 428626,
12+
"integration": 463433,
1313
"domain": "test",
14-
"split_code": "SPL_UO2vBzEqHW",
14+
"split_code": "SPL_RcScyW5jp2",
1515
"active": true,
16-
"bearer_type": "subaccount",
17-
"bearer_subaccount": 40809,
18-
"createdAt": "2020-06-30T11:52:24.000Z",
19-
"updatedAt": "2020-06-30T11:52:24.000Z",
16+
"bearer_type": "all-proportional",
17+
"bearer_subaccount": null,
18+
"createdAt": "2024-08-26T11:38:47.000Z",
19+
"updatedAt": "2024-08-26T11:50:47.000Z",
20+
"is_dynamic": false,
2021
"subaccounts": [
2122
{
2223
"subaccount": {
23-
"id": 40809,
24-
"subaccount_code": "ACCT_sv6roe394nkpu6j",
25-
"business_name": "Business Name",
26-
"description": "Business Description",
24+
"id": 1151727,
25+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
26+
"business_name": "Oasis Global",
27+
"description": "Oasis Global",
2728
"primary_contact_name": null,
2829
"primary_contact_email": null,
2930
"primary_contact_phone": null,
3031
"metadata": null,
31-
"percentage_charge": 20,
32-
"settlement_bank": "Business Bank",
33-
"account_number": "1234567890"
32+
"settlement_bank": "Guaranty Trust Bank",
33+
"currency": "NGN",
34+
"account_number": "0123456047"
3435
},
35-
"share": 30
36+
"share": 50
3637
},
3738
{
3839
"subaccount": {
39-
"id": 40811,
40-
"subaccount_code": "ACCT_7i76qpjh7rr6q3z",
41-
"business_name": "Business Name",
42-
"description": "Business Description",
40+
"id": 803508,
41+
"subaccount_code": "ACCT_eg4sob4590pq9vb",
42+
"business_name": "mmhm",
43+
"description": "mmhm",
4344
"primary_contact_name": null,
4445
"primary_contact_email": null,
4546
"primary_contact_phone": null,
4647
"metadata": null,
47-
"percentage_charge": 20,
48-
"settlement_bank": "Business Bank",
49-
"account_number": "0123456789"
48+
"settlement_bank": "Zenith Bank",
49+
"currency": "NGN",
50+
"account_number": "0000000000"
5051
},
51-
"share": 30
52+
"share": 20
5253
}
5354
],
5455
"total_subaccounts": 2

dist/api/transaction-splits/create/requests.js

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,27 @@ url="https://api.paystack.co/split"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
content_type="Content-Type: application/json"
55
data='{
6-
"name":"Percentage Split",
6+
"name":"Halfsies",
77
"type":"percentage",
88
"currency": "NGN",
99
"subaccounts":[{
10-
"subaccount": "ACCT_z3x6z3nbo14xsil",
11-
"share": 20
12-
},
13-
{
14-
"subaccount": "ACCT_pwwualwty4nhq9d",
15-
"share": 30
16-
}],
17-
"bearer_type":"subaccount",
18-
"bearer_subaccount":"ACCT_hdl8abxl8drhrl3"
10+
"subaccount": "ACCT_6uujpqtzmnufzkw",
11+
"share": 50
12+
}]
1913
}'
2014
2115
curl "$url" -H "$authorization" -H "$content_type" -d "$data" -X POST`
2216

2317
const js = `const https = require('https')
2418
2519
const params = JSON.stringify({
26-
"name":"Percentage Split",
20+
"name":"Halfsies",
2721
"type":"percentage",
2822
"currency": "NGN",
2923
"subaccounts":[{
30-
"subaccount": "ACCT_z3x6z3nbo14xsil",
31-
"share": 20
32-
},
33-
{
34-
"subaccount": "ACCT_pwwualwty4nhq9d",
35-
"share": 30
36-
}],
37-
"bearer_type":"subaccount",
38-
"bearer_subaccount":"ACCT_hdl8abxl8drhrl3"
24+
"subaccount": "ACCT_6uujpqtzmnufzkw",
25+
"share": 50
26+
}]
3927
})
4028
4129
const options = {
@@ -70,19 +58,13 @@ const php = `<?php
7058
$url = "https://api.paystack.co/split";
7159
7260
$fields = [
73-
'name' => "Percentage Split",
61+
'name' => "Halfsies",
7462
'type' => "percentage",
7563
'currency' => "NGN",
7664
'subaccounts' => [[
77-
"subaccount" => "ACCT_z3x6z3nbo14xsil",
78-
"share" => 20
79-
],
80-
[
81-
"subaccount" => "ACCT_pwwualwty4nhq9d",
82-
"share" => 30
83-
]],
84-
'bearer_type' => "subaccount",
85-
'bearer_subaccount' => "ACCT_hdl8abxl8drhrl3"
65+
"subaccount" => "ACCT_6uujpqtzmnufzkw",
66+
"share" => 50
67+
]]
8668
];
8769
8870
$fields_string = http_build_query($fields);

dist/api/transaction-splits/create/response.json

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,37 @@
55
"status": true,
66
"message": "Split created",
77
"data": {
8-
"id": 142,
9-
"name": "Test Doc",
8+
"id": 2703655,
9+
"name": "Halfsies",
1010
"type": "percentage",
1111
"currency": "NGN",
12-
"integration": 428626,
12+
"integration": 463433,
1313
"domain": "test",
14-
"split_code": "SPL_e7jnRLtzla",
14+
"split_code": "SPL_RcScyW5jp2",
1515
"active": true,
16-
"bearer_type": "subaccount",
17-
"bearer_subaccount": 40809,
18-
"createdAt": "2020-06-30T11:42:29.150Z",
19-
"updatedAt": "2020-06-30T11:42:29.150Z",
16+
"bearer_type": "all",
17+
"createdAt": "2024-08-26T11:38:47.506Z",
18+
"updatedAt": "2024-08-26T11:38:47.506Z",
19+
"is_dynamic": false,
2020
"subaccounts": [
2121
{
2222
"subaccount": {
23-
"id": 40809,
24-
"subaccount_code": "ACCT_z3x6z3nbo14xsil",
25-
"business_name": "Business Name",
26-
"description": "Business Description",
23+
"id": 1151727,
24+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
25+
"business_name": "Oasis Global",
26+
"description": "Oasis Global",
2727
"primary_contact_name": null,
2828
"primary_contact_email": null,
2929
"primary_contact_phone": null,
3030
"metadata": null,
31-
"percentage_charge": 20,
32-
"settlement_bank": "Business Bank",
33-
"account_number": "1234567890"
31+
"settlement_bank": "Guaranty Trust Bank",
32+
"currency": "NGN",
33+
"account_number": "0123456047"
3434
},
35-
"share": 20
36-
},
37-
{
38-
"subaccount": {
39-
"id": 40809,
40-
"subaccount_code": "ACCT_pwwualwty4nhq9d",
41-
"business_name": "Business Name",
42-
"description": "Business Description",
43-
"primary_contact_name": null,
44-
"primary_contact_email": null,
45-
"primary_contact_phone": null,
46-
"metadata": null,
47-
"percentage_charge": 20,
48-
"settlement_bank": "Business Bank",
49-
"account_number": "0123456789"
50-
},
51-
"share": 30
35+
"share": 50
5236
}
5337
],
54-
"total_subaccounts": 2
38+
"total_subaccounts": 1
5539
}
5640
}
5741
}

dist/api/transaction-splits/fetch/response.json

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,38 @@
55
"status": true,
66
"message": "Split retrieved",
77
"data": {
8-
"id": 143,
9-
"name": "Test Doc",
10-
"split_code": "SPL_UO2vBzEqHW",
11-
"integration": 428626,
12-
"domain": "test",
8+
"id": 2703655,
9+
"name": "Halfsies",
1310
"type": "percentage",
14-
"active": 1,
1511
"currency": "NGN",
16-
"bearer_type": "subaccount",
17-
"bearer_subaccount": 40809,
18-
"created_at": "2020-06-30T11:52:24.000Z",
19-
"updated_at": "2020-06-30T11:52:24.000Z",
12+
"integration": 463433,
13+
"domain": "test",
14+
"split_code": "SPL_RcScyW5jp2",
15+
"active": true,
16+
"bearer_type": "all",
17+
"bearer_subaccount": null,
18+
"createdAt": "2024-08-26T11:38:47.000Z",
19+
"updatedAt": "2024-08-26T11:38:47.000Z",
20+
"is_dynamic": false,
2021
"subaccounts": [
2122
{
2223
"subaccount": {
23-
"id": 40809,
24-
"subaccount_code": "ACCT_z3x6z3nbo14xsil",
25-
"business_name": "Business Name",
26-
"description": "Business Description",
27-
"primary_contact_name": null,
28-
"primary_contact_email": null,
29-
"primary_contact_phone": null,
30-
"metadata": null,
31-
"percentage_charge": 80,
32-
"settlement_bank": "Business Bank",
33-
"account_number": "1234567890"
34-
},
35-
"share": 30
36-
},
37-
{
38-
"subaccount": {
39-
"id": 40811,
40-
"subaccount_code": "ACCT_pwwualwty4nhq9d",
41-
"business_name": "Business Name",
42-
"description": "Business Description",
24+
"id": 1151727,
25+
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
26+
"business_name": "Oasis Global",
27+
"description": "Oasis Global",
4328
"primary_contact_name": null,
4429
"primary_contact_email": null,
4530
"primary_contact_phone": null,
4631
"metadata": null,
47-
"percentage_charge": 80,
48-
"settlement_bank": "Business Bank",
49-
"account_number": "0123456789"
32+
"settlement_bank": "Guaranty Trust Bank",
33+
"currency": "NGN",
34+
"account_number": "0123456047"
5035
},
51-
"share": 20
36+
"share": 50
5237
}
5338
],
54-
"total_subaccounts": 2
39+
"total_subaccounts": 1
5540
}
5641
}
5742
}

0 commit comments

Comments
 (0)