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.

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
    }
  }
}
The channelId, languageId, and marketId arguments are optional and can be omitted to use default values.

Response example

200 OK
response.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 channels
  • languageId: Set content language
  • marketId: Target specific markets
Read more about channelId, languageId, and marketId in the how-to about using multi-market support.

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: Bearer header.
  • 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