Manage company addresses
Prerequisites
- Merchant API key (
X-ApiKey) - Authenticated user session (JWT bearer token)
- User associated with a company account
Goals
- Add new billing and shipping addresses to a company
- Update existing company address details
- Remove addresses that are no longer needed
Architecture at a glance
- Authenticate company user →
createCompanyAddress/updateCompanyAddress/deleteCompanyAddress→ Verify viagetCompany
APIs used
- Merchant API:
https://merchantapi.geins.io/graphql
Step-by-step
Create a company address
Use createCompanyAddress to add a new address. Each address must have an addressType that determines how it can be used during checkout: billing, shipping, or billingandshipping.
Request example
mutation createCompanyAddress(
$address: CreateCompanyAddressInputType!
$channelId: String
$languageId: String
$marketId: String
) {
createCompanyAddress(
address: $address
channelId: $channelId
languageId: $languageId
marketId: $marketId
)
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}",
"Authorization": "Bearer {JWT_TOKEN}"
}
{
"address": {
"firstName": "Anna",
"lastName": "Svensson",
"company": "Acme Trading AB",
"addressLine1": "Lagervägen 5",
"zip": "11133",
"city": "Stockholm",
"country": "SE",
"addressType": "shipping"
},
"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 createCompanyAddress($address:CreateCompanyAddressInputType!,$channelId:String,$languageId:String,$marketId:String){createCompanyAddress(address:$address,channelId:$channelId,languageId:$languageId,marketId:$marketId)}","variables":{"address":{"firstName":"Anna","lastName":"Svensson","company":"Acme Trading AB","addressLine1":"Lagervägen 5","zip":"11133","city":"Stockholm","country":"SE","addressType":"shipping"},"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
firstName, lastName, addressLine1, zip, city, country, and addressType. Optional fields include email, phone, company, careOf, addressLine2, addressLine3, and region.Response example
200 OK{
"data": {
"createCompanyAddress": true
}
}
Update an existing address
Use updateCompanyAddress to modify an existing address. Only the fields you provide are updated — omitted fields remain unchanged. You need the addressId from the getCompany query.
Request example
mutation updateCompanyAddress(
$addressId: String!
$address: UpdateCompanyAddressInputType!
$channelId: String
$languageId: String
$marketId: String
) {
updateCompanyAddress(
addressId: $addressId
address: $address
channelId: $channelId
languageId: $languageId
marketId: $marketId
)
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}",
"Authorization": "Bearer {JWT_TOKEN}"
}
{
"addressId": "102",
"address": {
"addressLine1": "Nya Lagervägen 12",
"zip": "11144",
"addressType": "billingandshipping"
},
"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 updateCompanyAddress($addressId:String!,$address:UpdateCompanyAddressInputType!,$channelId:String,$languageId:String,$marketId:String){updateCompanyAddress(addressId:$addressId,address:$address,channelId:$channelId,languageId:$languageId,marketId:$marketId)}","variables":{"addressId":"102","address":{"addressLine1":"Nya Lagervägen 12","zip":"11144","addressType":"billingandshipping"},"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
UpdateCompanyAddressInputType are optional. Only provide the fields you want to change. The country field expects a 2-character ISO 3166-1 alpha-2 code (e.g., SE).Response example
200 OK{
"data": {
"updateCompanyAddress": true
}
}
Delete an address
Use deleteCompanyAddress to remove an address from the company. You need the addressId from the getCompany query.
Request example
mutation deleteCompanyAddress(
$addressId: String!
$channelId: String
$languageId: String
$marketId: String
) {
deleteCompanyAddress(
addressId: $addressId
channelId: $channelId
languageId: $languageId
marketId: $marketId
)
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}",
"Authorization": "Bearer {JWT_TOKEN}"
}
{
"addressId": "102",
"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 deleteCompanyAddress($addressId:String!,$channelId:String,$languageId:String,$marketId:String){deleteCompanyAddress(addressId:$addressId,channelId:$channelId,languageId:$languageId,marketId:$marketId)}","variables":{"addressId":"102","channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
Response example
200 OK{
"data": {
"deleteCompanyAddress": true
}
}
Options
Multi-market support
All mutations support optional parameters for multi-market functionality:
channelId: Target specific sales channelslanguageId: Set content languagemarketId: Target specific markets
Authenticated access
Authentication is required for all company address mutations. The API uses the JWT bearer token to identify the user's company membership and scope operations 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}
Common pitfalls
- Invalid
addressTypevalue — Must be exactlybilling,shipping, orbillingandshipping. Other values will cause an error. - Invalid
countryformat — Use 2-character ISO 3166-1 alpha-2 codes (e.g.,SE,NO,DE), not full country names. - Addresses affect checkout flow — Company addresses are presented as selectable options during company checkout. Changes here are immediately reflected in the checkout address lists.