Translations for Shipping Methods (Beta)

The Translations Admin GraphQL API is available on Catalyst storefronts by default and in early access for Stencil and other headless storefronts. To get early access, reach out to the BigCommerce support team.

The following entities are translatable for shipping methods:

  • Shipping Method Name as shipping_method_name

Resource fields

Entity TyperesourceTyperesourceId Format
Shipping MethodSHIPPING_METHODSbc/store/shippingMethod/{id}

Examples

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

Query a List of Translations

This query returns shipping method translations for the specified resource type, channel, and locale (up to 50).

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: SHIPPING_METHODS,
channelId: "bc/store/channel/{{channel_id}}",
localeId: "bc/store/locale/{{locale_code}}"
}) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
}

Query a Translation by Resource ID

This query returns a translation by resourceId.

When querying by resourceId, provide the full ID in the format bc/store/shippingMethod/{id}.

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

Update 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: SHIPPING_METHODS,
channelId: "bc/store/channel/{{channel_id}}",
localeId: "bc/store/locale/{{locale_code}}",
entities: [
{
resourceId: "bc/store/shippingMethod/1",
fields: [
{
fieldName: "shipping_method_name",
value: "Nuevo Nombre de Envío"
}
]
}
]
}) {
errors {
__typename
... on Error {
message
}
... on EntityNotFoundError {
message
}
... on ValidationError {
message
}
}
}
}
}

Delete 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: SHIPPING_METHODS,
channelId: "bc/store/channel/{{channel_id}}",
localeId: "bc/store/locale/{{locale_code}}",
resources: [
{
resourceId: "bc/store/shippingMethod/1",
fields: ["shipping_method_name"]
}
]
}) {
errors {
__typename
... on Error {
message
}
... on EntityNotFoundError {
message
}
... on ValidationError {
message
}
}
}
}
}