Translations for Product Custom Fields (Beta)
The Translations Admin GraphQL API for managing product custom field translations is available on Catalyst storefronts only.
The product custom fields translatable data points are:
- Name
- Value
Querying Product Custom Field Translations (Storefront API)
Product custom field translations are returned in the current locale determined by the context (e.g., Accept-Language
header, channel settings, or session locale).
Example: Query a product custom field in a given locale
Example query: Query product custom field in a locale
GRAPHQL https://storefront.example.com/graphql
Accept-Language: es
query {
site {
product(entityId: "123") {
entityId
customFields {
entityId
name
value
}
}
}
}
Managing Product Custom Field Translations (Admin API)
Product custom field translation management (list, update, delete) is available via the Admin GraphQL API. These mutations and queries are not available on the Storefront API.
Query a List of Product Custom Field Translations
Example query: Query a list of product custom field translations
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: PRODUCT_CUSTOM_FIELDS,
channelId: "bc/store/channel/5",
localeId: "bc/store/locale/es"
} first: 50) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}
Query a Product Custom Field Translation by Resource ID
⚠️
When querying a translation by resourceId, you must provide the full resourceId in the format bc/store/product-custom-field/{custom_field_id}
.
Example query: Query a product custom field translation by id
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: PRODUCT_CUSTOM_FIELDS,
channelId: "bc/store/channel/4",
localeId: "bc/store/locale/fr",
resourceIds: ["bc/store/product-custom-field/456"]
}) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}
Update a Product Custom Field Translation
Example mutation: Update a product custom field translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
updateTranslations(input: {
resourceType: PRODUCT_CUSTOM_FIELDS,
channelId: "bc/store/channel/2",
localeId: "bc/store/locale/es",
entities: [
{
resourceId: "bc/store/product-custom-field/456",
fields: [
{ fieldName: "name", value: "Material (ES)" },
{ fieldName: "value", value: "Algodón" }
]
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}
Delete a Product Custom Field Translation
Example mutation: Delete a product custom field translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
deleteTranslations(input: {
resourceType: PRODUCT_CUSTOM_FIELDS,
channelId: "bc/store/channel/2",
localeId: "bc/store/locale/es",
resources: [
{
resourceId: "bc/store/product-custom-field/456",
fields: ["name", "value"]
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}
Did you find what you were looking for?