Skip to main content
POST
/
send
/
groups
Create a group
curl --request POST \
  --url https://staging-api.chip-in.asia/api/send/groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'checksum: <checksum>' \
  --header 'epoch: <epoch>' \
  --data '
{
  "name": "Vendor Payouts"
}
'
import requests

url = "https://staging-api.chip-in.asia/api/send/groups"

payload = { "name": "Vendor Payouts" }
headers = {
"epoch": "<epoch>",
"checksum": "<checksum>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
epoch: '<epoch>',
checksum: '<checksum>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: 'Vendor Payouts'})
};

fetch('https://staging-api.chip-in.asia/api/send/groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-api.chip-in.asia/api/send/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Vendor Payouts'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"checksum: <checksum>",
"epoch: <epoch>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://staging-api.chip-in.asia/api/send/groups"

payload := strings.NewReader("{\n \"name\": \"Vendor Payouts\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("epoch", "<epoch>")
req.Header.Add("checksum", "<checksum>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://staging-api.chip-in.asia/api/send/groups")
.header("epoch", "<epoch>")
.header("checksum", "<checksum>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Vendor Payouts\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging-api.chip-in.asia/api/send/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["epoch"] = '<epoch>'
request["checksum"] = '<checksum>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Vendor Payouts\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 1,
  "name": "Vendor Payouts",
  "created_at": "2024-06-15T08:00:00.000Z",
  "updated_at": "2024-06-15T08:00:00.000Z"
}
{
"message": "Bad request",
"code": 400,
"data": {}
}
{
"message": "Unauthorized",
"code": 401,
"data": {}
}
{
"message": "You are not authorized to perform this action",
"code": 403,
"data": {}
}
{
"message": "Record not found",
"code": 404,
"data": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

epoch
integer<int64>
required

Unix epoch timestamp Unix timestamp (seconds).

Example:

1619740800

checksum
string
required

Refer to checksum calculation

Body

application/json

Request body for creating a group.

name
string
required
Example:

"Vendor Payouts"

Response

Successful response

A group that labels a set of bank accounts (for example, Vendor Payouts or Employee Payroll).

id
integer<int64>
Example:

1

name
string
Example:

"Vendor Payouts"

created_at
string<date-time>
read-only

Object creation time in UTC.

Example:

"2024-06-15T08:00:00.000Z"

updated_at
string<date-time>
read-only

Object updated time in UTC.

Example:

"2024-06-15T08:00:00.000Z"