Split
A collection of endpoints for spliting a transaction and managing the splits
Copy link List Splits
List the transaction splits available on your integration
Query Parameters
Filter by subaccount code
The name of the split
The status of the split
The number of records to fetch per request
The offset to retrieve data from
The start date
The end date
Response
200
5 object properties
GET
/splitcurl https://api.paystack.co/split \
-H "Authorization: Bearer YOUR_SECRET_KEY"import { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.list({
subaccount_code: "ACCT_dskvlw3y3dMukmt",
name: "NAME"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.list({
subaccount_code: "ACCT_dskvlw3y3dMukmt",
name: "NAME"
})
puts response.dataResponse
{
"status": true,
"message": "Split retrieved",
"data": [
{
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:38:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 50
}
],
"total_subaccounts": 1
}
],
"meta": {
"total": 98,
"skipped": 0,
"perPage": 50,
"page": 1,
"pageCount": 2
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Create Split
Create a split configuration for transactions
Request Body
Name of the transaction split
The type of transaction split you want to create.
Enumpercentageflat
A list of object containing subaccount code and number of shares
The transaction currency
EnumNGNGHSZARUSD
This allows you specify how the transaction charge should be processed
Enumsubaccountaccountall-proportionalall
This is the subaccount code of the customer or partner that would bear the transaction charge if you specified subaccount as the bearer type
Response
200
15 object properties
POST
/splitcurl https://api.paystack.co/split \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Halfsies",
"type": "percentage",
"subaccounts": [],
"currency": "NGN"
}' \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.create({
name: "Halfsies",
type: "percentage",
subaccounts: [],
currency: "NGN"
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.create({
name: "Halfsies",
type: "percentage",
subaccounts: [],
currency: "NGN"
})
puts response.dataResponse
{
"status": true,
"message": "Split created",
"data": {
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all",
"createdAt": "2024-08-26T11:38:47.506Z",
"updatedAt": "2024-08-26T11:38:47.506Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 50
}
],
"total_subaccounts": 1
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Fetch Split
Get details of a split configuration for a transaction
Path Parameters
The ID of the split configuration to fetch
Response
200
15 object properties
GET
/split/{id}curl https://api.paystack.co/split/4896895 \
-H "Authorization: Bearer YOUR_SECRET_KEY"import { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.fetch("4896895");
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.fetch("4896895")
puts response.dataResponse
{
"status": true,
"message": "Split retrieved",
"data": {
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:38:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 50
}
],
"total_subaccounts": 1
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Update Split
Update a split configuration for transactions
Path Parameters
Request Body
Name of the transaction split
Toggle status of split. When true, the split is active, else it's inactive
This allows you specify how the transaction charge should be processed
Enumsubaccountaccountall-proportionalall
This is the subaccount code of the customer or partner that would bear the transaction charge if you specified subaccount as the bearer type
Response
200
15 object properties
PUT
/split/{id}curl https://api.paystack.co/split/SPLIT_ID \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "NAME",
"active": true
}' \
-X PUTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.update("SPLIT_ID", {
name: "NAME",
active: true
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.update("SPLIT_ID", {
name: "NAME",
active: true
})
puts response.dataResponse
{
"status": true,
"message": "Split group updated",
"data": {
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all-proportional",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:50:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 50
}
],
"total_subaccounts": 1
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Add Subaccount to Split
Add a subaccount to a split configuration, or update the share of an existing subaccount
Path Parameters
The ID of the split configuration to fetch
Request Body
Subaccount code of the customer or partner
The percentage or flat quota of the customer or partner
Response
200
15 object properties
POST
/split/{id}/subaccount/addcurl https://api.paystack.co/split/4896895/subaccount/add \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"subaccount": "ACCT_6uujpqtzmnufzkw",
"share": 50
}' \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.addSubaccount("4896895", {
subaccount: "ACCT_6uujpqtzmnufzkw",
share: 50
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.add_subaccount("4896895", {
subaccount: "ACCT_6uujpqtzmnufzkw",
share: 50
})
puts response.dataResponse
{
"status": true,
"message": "Subaccount added",
"data": {
"id": 2703655,
"name": "Halfsies",
"type": "percentage",
"currency": "NGN",
"integration": 463433,
"domain": "test",
"split_code": "SPL_RcScyW5jp2",
"active": true,
"bearer_type": "all-proportional",
"bearer_subaccount": null,
"createdAt": "2024-08-26T11:38:47.000Z",
"updatedAt": "2024-08-26T11:50:47.000Z",
"is_dynamic": false,
"subaccounts": [
{
"subaccount": {
"id": 1151727,
"subaccount_code": "ACCT_6uujpqtzmnufzkw",
"business_name": "Oasis Global",
"description": "Oasis Global",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Guaranty Trust Bank",
"currency": "NGN",
"account_number": "0123456047"
},
"share": 50
},
{
"subaccount": {
"id": 803508,
"subaccount_code": "ACCT_eg4sob4590pq9vb",
"business_name": "mmhm",
"description": "mmhm",
"primary_contact_name": null,
"primary_contact_email": null,
"primary_contact_phone": null,
"metadata": null,
"settlement_bank": "Zenith Bank",
"currency": "NGN",
"account_number": "0000000000"
},
"share": 20
}
],
"total_subaccounts": 2
}
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}Copy link Remove Subaccount from split
Remove a subaccount from a split configuration
Path Parameters
The ID of the split configuration to fetch
Request Body
Subaccount code of the customer or partner
The percentage or flat quota of the customer or partner
Response
200
POST
/split/{id}/subaccount/removecurl https://api.paystack.co/split/4896895/subaccount/remove \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"subaccount": "ACCT_6uujpqtzmnufzkw",
"share": 50
}' \
-X POSTimport { Paystack } from "@paystack/paystack-sdk";
const paystack = new Paystack({ secretKey: process.env.PAYSTACK_SECRET_KEY! });
const response = await paystack.split.removeSubaccount("4896895", {
subaccount: "ACCT_6uujpqtzmnufzkw",
share: 50
});
console.log(response.data);require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
response = paystack.split.remove_subaccount("4896895", {
subaccount: "ACCT_6uujpqtzmnufzkw",
share: 50
})
puts response.dataResponse
{
"status": true,
"message": "Subaccount removed"
}{
"status": false,
"message": "An error occurred",
"meta": {
"nextStep": "string"
},
"type": "string",
"code": "validation_error",
"errorCodeMappingNotFound": true
}