POST {{baseurl}}/transit-accounts
- Staging
- Production
https://gw.stg.girostack.com/v1https://gw.prod.girostack.com/v1Headers
string
required
Pass your account’s secret key as the value.
Body Params
string
required
Value could be business’ name
string
required
Value should be
NGNstring
required
Value should be the
publicId of the wallet where you want incoming
transactions to be settled.string
Value should be a valid email address
object
The mobile number of the customer
{
"phoneNumber": "08142351599",
"isoCode": "NG"
}
curl --location --request POST '{{API_BASE_URL}}/transit-accounts' \
--header 'x-giro-key: {{SECRET_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"accountName": "John Doe",
"currency": "NGN",
"settlementAccount": "vba-19aeceea-1bd6-4e85-89fa-2ca0b1c57d61"
}'
const fetch = require("node-fetch");
const url = "{{API_BASE_URL}}/transit-accounts";
const headers = {
"x-giro-key": "{{SECRET_KEY}}",
"Content-Type": "application/json",
};
const body = JSON.stringify({
accountName: "John Doe",
currency: "NGN",
settlementAccount: "vba-19aeceea-1bd6-4e85-89fa-2ca0b1c57d61",
});
fetch(url, {
method: "POST",
headers: headers,
body: body,
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{API_BASE_URL}}/transit-accounts',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'x-giro-key: {{SECRET_KEY}}',
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => json_encode(array(
'accountName' => 'John Doe',
'currency' => 'NGN',
'settlementAccount' => 'vba-19aeceea-1bd6-4e85-89fa-2ca0b1c57d61',
))
));
$response = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if (curl_errno($curl)) {
echo 'Error: ' . curl_error($curl);
} else {
echo "Response Code: $httpcode\n";
echo $response;
}
curl_close($curl);
?>
{
"meta": {
"statusCode": 201,
"success": true,
"message": "TransitAccount successfully created"
},
"data": {
"publicId": "vba-6989bcba-15b0-4552-8d78-44fc0b1dd06d",
"auth": "678b12bbf36cc2c6b76635f95",
"account": "65b12bbf36e38c6bfbe35f95",
"settlementAccount": "vba-19aeceea-1bd6-4e85-89fa-2ca0b1c57d61",
"accountName": "John Doe",
"accountNumber": "9003053347",
"bankName": "Source MFB",
"bankCode": "090641",
"live": true,
"alias": "John Doe",
"processor": "source",
"reference": null,
"id": 2,
"createdAt": "2024-08-03T11:44:18.841Z",
"updatedAt": "2024-08-03T11:44:18.841Z",
"balance": 0,
"currency": "NGN",
"lastUpdated": "2024-08-03T11:44:18.841Z"
}
}
{
"meta": {
"statusCode": 400,
"error": {
"statusCode": 400,
"message": "Bad request / Validation error",
"messages": {
"settlementAccount": {
"isNotEmpty": "settlementAccount should not be empty",
"isString": "settlementAccount must be a string"
}
}
}
}
}