How to

Manage company settings

Update company properties for the authenticated user's company using Geins Merchant API.

Prerequisites

  • Merchant API key (X-ApiKey)
  • Authenticated user session (JWT bearer token)
  • User associated with a company account

Goals

  • Update the company name for the authenticated user's company
  • Understand which company properties are editable via the API

Architecture at a glance

  • Authenticate company user → Mutation updateCompany → Company updated → Confirm via getCompany

APIs used

  • Merchant API: https://merchantapi.geins.io/graphql

Step-by-step

Retrieve current company information

Before updating, query the current company details to confirm the values you want to change. See Get company info for full details on the getCompany query.

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
  }
}

Response example

200 OK
response.json
{
  "data": {
    "getCompany": {
      "id": "12345",
      "name": "Acme Trading AB",
      "vatNumber": "SE556677889901",
      "exVat": true
    }
  }
}

Update the company name

Use the updateCompany mutation to change the company name. The mutation accepts an UpdateCompanyInputType object. Currently, name is the only editable field. The mutation returns true on success.

Try it out in the GraphQL Playground using the query, headers and variables below.

Request example

mutation updateCompany(
  $company: UpdateCompanyInputType!
  $channelId: String
  $languageId: String
  $marketId: String
) {
  updateCompany(
    company: $company
    channelId: $channelId
    languageId: $languageId
    marketId: $marketId
  )
}
Only provided fields are updated. Omitted fields remain unchanged. Currently name is the only editable property; other fields such as vatNumber and exVat are read-only from this endpoint.

Response example

200 OK
response.json
{
  "data": {
    "updateCompany": true
  }
}

Options

Multi-market support

All mutations and 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 updateCompany mutation uses the JWT bearer token to identify the user's company membership and scope the update to that company. Without a valid 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

  • Expecting to update vatNumber or exVat — These properties are read-only from the Merchant API. Only name can be changed via updateCompany. Other company settings must be managed through the back-office.
  • User not linked to a company — If the authenticated user has no company account, the mutation will fail.
  • Missing JWT token — This mutation requires authentication. An API key alone is not sufficient; include the Authorization: Bearer header.
Related