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 viagetCompany
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
}
}
{
"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}}","variables":{"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
Response example
200 OKresponse.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
)
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}",
"Authorization": "Bearer {JWT_TOKEN}"
}
{
"company": {
"name": "Acme Trading International AB"
},
"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":"mutation updateCompany($company:UpdateCompanyInputType!,$channelId:String,$languageId:String,$marketId:String){updateCompany(company:$company,channelId:$channelId,languageId:$languageId,marketId:$marketId)}","variables":{"company":{"name":"Acme Trading International AB"},"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
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 OKresponse.json
{
"data": {
"updateCompany": true
}
}
Options
Multi-market support
All mutations and 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 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
vatNumberorexVat— These properties are read-only from the Merchant API. Onlynamecan be changed viaupdateCompany. 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: Bearerheader.
Related
Get company infoGet company ordersManage company settingsManage company addressesManage company buyersUse multi-market supportUpdateCompany