Skip to content

List Companies ​

Returns the companies your API key's user can raise payment requests for. Use an id from here as requestingCompany when you create a request.

Endpoint ​

MethodURL
GET/api/companies

No query parameters, no body. Sign it like any GET:

<timestamp>.GET./api/companies.

Response ​

data is an array of companies (complete in one response, not paginated):

FieldTypeDescription
idstringCompany ID. Use it as requestingCompany
namestringCompany name

Only companies where the user can create requests at one or more sites are listed. If the user cannot create requests anywhere, data is [].

Example ​

bash
TS=$(date +%s)
SIG=$(printf '%s' "$TS.GET./api/companies." \
  | openssl dgst -sha256 -hmac "$SIGNING_SECRET" \
  | sed 's/^.* //')
curl "$BASE_URL/api/companies" \
  -H "x-api-key: $API_KEY" \
  -H "x-timestamp: $TS" \
  -H "x-signature: $SIG"
js
// callJohari is from the Signing page
const result = await callJohari("GET", "/api/companies");
console.log(result.data);
python
# call_johari is from the Signing page
result = call_johari("GET", "/api/companies")
print(result["data"])

Response 200:

json
{
  "status": "success",
  "data": [
    {
      "id": "6650f1a2b3c4d5e6f7a8b901",
      "name": "Example Construction Ltd"
    },
    {
      "id": "6650f1a2b3c4d5e6f7a8b902",
      "name": "Example Developers Ltd"
    }
  ],
  "message": "Companies fetched successfully"
}

Common mistakes ​

Hard-coding IDs from another environment

The test server and the live server have different IDs. Look them up on each environment, or keep a separate mapping for each.

This is your first test

GET /api/companies is the simplest signed call. If it returns 200, your key, secret, clock and signing are all correct.