Skip to navigation

Translations for Locations

The locations translatable fields are:

  • Name
  • Address 1
  • Address 2
  • Description
  • City
  • State (optional)
  • Meta Keywords
  • Name (Special hours)

Examples

Below are examples of GraphQL queries and mutations for retrieving and managing translation settings for locations.

Query translations

Query a list of translations

This query returns a paginated list of translations by resourceType, channel, and locale with a maximum of 50 results per request.

Example query: Query a list of translations
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: INVENTORY_LOCATIONS,
channelId: "bc/store/channel/1",
localeId: "bc/store/locale/en"
} first: 50) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}

Query a translation by resourceId

When querying a translation by resourceId, you must provide the full resourceId in the format bc/store/inventoryLocation/{location_id}.

This query returns a translation by resourceId.

Example query: Query a translation by resource id
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: INVENTORY_LOCATIONS,
channelId: "bc/store/channel/2",
localeId: "bc/store/locale/it",
resourceIds: ["bc/store/inventoryLocation/1", "bc/store/inventoryLocation/2"]
}) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}

Update a translation

This mutation updates a translation.

Example mutation: Update a translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
updateTranslations(input: {
resourceType: INVENTORY_LOCATIONS,
channelId: "bc/store/channel/1",
localeId: "bc/store/locale/es",
entities: [
{
resourceId: "bc/store/inventoryLocation/1",
fields: [
{
fieldName: "city",
value: "Ville (OVR) TEST ES"
},
{
fieldName: "state",
value: "État (OVR) TEST ES"
}
]
},
{
resourceId: "bc/store/inventoryLocation/2",
fields: [
{
fieldName: "city",
value: "Ville (OVR) TEST ES"
},
{
fieldName: "state",
value: "État (OVR) TEST ES"
}
]
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}

Delete a translation

The following mutation deletes a translation.

Example mutation: Delete a translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
deleteTranslations(input: {
resourceType: INVENTORY_LOCATIONS,
channelId: "bc/store/channel/1",
localeId: "bc/store/locale/en",
resources: [
{
resourceId: "bc/store/inventoryLocation/2",
fields: ["city", "state"],
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}