How to
Get company info
Retrieve company details, addresses, and buyers for the authenticated user via the Merchant API.
Retrieve company information — including addresses and buyers — for the currently authenticated user. This query is read-only. To modify company data, see:
- Manage company settings — update the company name
- Manage company addresses — add, update, and remove addresses
- Manage company buyers — add, assign, update, and remove buyers
- Get company orders — retrieve order history for all company buyers
Prerequisites
- Merchant API key (
X-ApiKey) - Authenticated user session (JWT bearer token)
- User associated with a company account
Goals
- Fetch company details (name, VAT number, pricing flags)
- Retrieve associated addresses (billing, shipping)
- List buyers linked to the company
Architecture at a glance
- Authenticate user → Query
getCompany→ Receive company with addresses and buyers
APIs used
- Merchant API:
https://merchantapi.geins.io/graphql
Step-by-step
Query company information
Fetch the authenticated user's company profile with nested addresses and buyers.
Try it out in the GraphQL Playground using the query, headers and variables below.
Request example
query getCompany(
$channelId: String
$languageId: String
$marketId: String
) {
getCompany(
channelId: $channelId
languageId: $languageId
marketId: $marketId
) {
id
name
vatNumber
exVat
limitedProductAccess
addresses {
addressId
company
addressLine1
zip
city
country
addressType
}
buyers {
id
firstName
lastName
active
}
}
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}",
"Authorization": "Bearer {JWT_TOKEN}"
}
{
"channelId": "{CHANNEL_ID}",
"languageId": "{LANGUAGE_ID}",
"marketId": "{MARKET_ID}"
}
curl -X POST https://merchantapi.geins.io/graphql \
-H "Accept: application/json" \
-H "X-ApiKey: {MERCHANT_API_KEY}" \
-H "Authorization: Bearer {JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"query":"query getCompany($channelId:String,$languageId:String,$marketId:String){getCompany(channelId:$channelId,languageId:$languageId,marketId:$marketId){id name vatNumber exVat limitedProductAccess addresses{addressId company addressLine1 zip city country addressType} buyers{id firstName lastName active}}}","variables":{"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
The
channelId, languageId, and marketId arguments are optional and can be omitted to use default values.Response example
200 OKresponse.json
{
"data": {
"getCompany": {
"id": "12345",
"name": "Acme Trading AB",
"vatNumber": "SE556677889901",
"exVat": true,
"limitedProductAccess": false,
"addresses": [
{
"addressId": "101",
"company": "Acme Trading AB",
"addressLine1": "Industrivägen 10",
"zip": "11122",
"city": "Stockholm",
"country": "SE",
"addressType": "billingandshipping"
}
],
"buyers": [
{
"id": "1001",
"firstName": "Anna",
"lastName": "Svensson",
"active": true
}
]
}
}
}
Options
Multi-market support
All queries support optional parameters for multi-market functionality:
channelId: Target specific sales channelslanguageId: Set content languagemarketId: Target specific markets
Authenticated access
Authentication is required for this endpoint. The getCompany query returns data scoped to the currently authenticated user's company account. Without a valid JWT bearer token the request will fail with an authorization error.
Include the token in the Authorization header:
Authorization: Bearer {JWT_TOKEN}
See the authentication flow guide for details on obtaining and refreshing JWT tokens.
Common pitfalls
- Missing JWT token — This query requires authentication. An API key alone is not sufficient; include the
Authorization: Bearerheader. - User not linked to a company — If the authenticated user has no company account, the query returns
null. - Expecting all address fields — Only request the fields you need; some fields (e.g.,
addressLine2,careOf) may be empty.
Related
Get company infoGet company ordersManage company settingsManage company addressesManage company buyersUse multi-market supportGetCompany