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

subaccount_codestring
Filter by subaccount code
namestring
The name of the split
activeboolean
The status of the split
per_pageinteger
The number of records to fetch per request
pageinteger
The offset to retrieve data from
fromstring
The start date
tostring
The end date

Response

200
statusrequiredboolean
messagerequiredstring
datarequiredarray[object]
metarequiredobject
5 object properties
totalrequiredinteger
skippedrequiredinteger
perPagerequiredinteger
pagerequiredinteger
pageCountrequiredinteger
GET/split
curl 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.data
Response
{
  "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

namerequiredstring
Name of the transaction split
typerequiredstring
The type of transaction split you want to create.
Enumpercentageflat
subaccountsrequiredarray[object]
A list of object containing subaccount code and number of shares
currencyrequiredstring
The transaction currency
EnumNGNGHSZARUSD
bearer_typestring
This allows you specify how the transaction charge should be processed
Enumsubaccountaccountall-proportionalall
bearer_subaccountstring
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
statusrequiredboolean
messagerequiredstring
datarequiredobject
15 object properties
idrequiredinteger
namerequiredstring
typerequiredstring
currencyrequiredstring
integrationrequiredinteger
domainrequiredstring
split_coderequiredstring
activerequiredboolean
bearer_typerequiredstring
bearer_subaccountinteger
createdAtrequiredstring
updatedAtrequiredstring
is_dynamicrequiredboolean
subaccountsrequiredarray[object]
total_subaccountsrequiredinteger
POST/split
curl 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 POST
import { 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.data
Response
{
  "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

idrequiredinteger
The ID of the split configuration to fetch

Response

200
statusrequiredboolean
messagerequiredstring
datarequiredobject
15 object properties
idrequiredinteger
namerequiredstring
typerequiredstring
currencyrequiredstring
integrationrequiredinteger
domainrequiredstring
split_coderequiredstring
activerequiredboolean
bearer_typerequiredstring
bearer_subaccountrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
is_dynamicrequiredboolean
subaccountsrequiredarray[object]
total_subaccountsrequiredinteger
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.data
Response
{
  "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

idrequiredstring

Request Body

namestring
Name of the transaction split
activeboolean
Toggle status of split. When true, the split is active, else it's inactive
bearer_typestring
This allows you specify how the transaction charge should be processed
Enumsubaccountaccountall-proportionalall
bearer_subaccountstring
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
statusrequiredboolean
messagerequiredstring
datarequiredobject
15 object properties
idrequiredinteger
namerequiredstring
typerequiredstring
currencyrequiredstring
integrationrequiredinteger
domainrequiredstring
split_coderequiredstring
activerequiredboolean
bearer_typerequiredstring
bearer_subaccountrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
is_dynamicrequiredboolean
subaccountsrequiredarray[object]
total_subaccountsrequiredinteger
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 PUT
import { 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.data
Response
{
  "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

idrequiredinteger
The ID of the split configuration to fetch

Request Body

subaccountstring
Subaccount code of the customer or partner
shareinteger
The percentage or flat quota of the customer or partner

Response

200
statusrequiredboolean
messagerequiredstring
datarequiredobject
15 object properties
idrequiredinteger
namerequiredstring
typerequiredstring
currencyrequiredstring
integrationrequiredinteger
domainrequiredstring
split_coderequiredstring
activerequiredboolean
bearer_typerequiredstring
bearer_subaccountrequiredinteger
createdAtrequiredstring
updatedAtrequiredstring
is_dynamicrequiredboolean
subaccountsrequiredarray[object]
total_subaccountsrequiredinteger
POST/split/{id}/subaccount/add
curl 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 POST
import { 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.data
Response
{
  "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

idrequiredinteger
The ID of the split configuration to fetch

Request Body

subaccountstring
Subaccount code of the customer or partner
shareinteger
The percentage or flat quota of the customer or partner

Response

200
statusrequiredboolean
messagerequiredstring
POST/split/{id}/subaccount/remove
curl 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 POST
import { 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.data
Response
{
  "status": true,
  "message": "Subaccount removed"
}
{
  "status": false,
  "message": "An error occurred",
  "meta": {
    "nextStep": "string"
  },
  "type": "string",
  "code": "validation_error",
  "errorCodeMappingNotFound": true
}