Update Subaccount

Create a new subaccount on your Terraswitch account.

PUT {{ BASE_URL }}/v1/corporate/subaccount/{{code}}

Body Parameters

Property
Data Type
Description
Example
Required

name

string

The name of the subaccount

"Corporate NATS"

No

description

string

Your description for the subaccount

"This is a business partner"

No

accountNo

string

The recipient bank account number to settle money to.

"0125318431"

No

bankCode

string

The bank sort code for the account number provided. Use the List Banks endpoint.

"035"

No

email

string

The contact email for the subaccount

No

phoneNumber

string

The 11-digit phone number for the subaccount

"08137031202"

No

phoneCode

string

The dial country code for the phone number provided. Defaulted to "+234"

"+234"

No

split

object

The defined object to hold payment split data.

N/A

No

split.type

string

Type of split. This can either be percentage or flat

"percentage"

No

split.value

number

The value of the split. For percentage, range is between 1 - 100 and it cannot be more than 100.

10.05

No

import Axios from 'axios';

// set the api url
const API_URL = `${BASE_URL}/v1/corporate/subaccount/${code}`;

// define request body
const data = {
    name: "Corporate NATS", 
    description: "Corporate NATS subaccount for terraswitch", 
    accountNo: "", 
    bankCode: "", 
    email: "", 
    phoneCode: "", 
    phoneNumber: "", 
    split: {
        type: "percentage",
        value: 10.99
    }
}

// make request using axios
Axios({
    method: "PUT",
    url: `${API_URL}`,
    headers: {
        lg: 'en',
        ch: 'web'
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
    },
    data: data
}).then((resp) => {
    console.log(resp)
}).catch((err) => {
    console.log(err)
})

Last updated