-
Notifications
You must be signed in to change notification settings - Fork 56
Add Shipping Methods and Tax Rates Translation Docs #1222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ The API currently supports translations for the following resource types, and mo | |
| * Brands | ||
| * [Product Filters](/docs/store-operations/translations/filters) | ||
| * [Locations](/docs/store-operations/translations/locations) | ||
| * [Shipping Methods](/docs/store-operations/translations/shipping-methods) | ||
| * [Tax Rates](/docs/store-operations/translations/tax-rates) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| Refer to the [Error Handling](/docs/store-operations/translations/errors) guide for understanding and handling errors while managing translations. | ||
|
|
||
|
|
@@ -74,4 +76,6 @@ For more information on OAuth Scopes, see our [Guide to API Accounts](/docs/star | |
| - [Product Listing Page Translations](/docs/store-operations/translations/listings) | ||
| - [Product Filter Translations](/docs/store-operations/translations/filters) | ||
| - [Inventory Locations Translations](/docs/store-operations/translations/locations) | ||
| - [Shipping Methods Translations](/docs/store-operations/translations/shipping-methods) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - [Tax Rates Translations](/docs/store-operations/translations/tax-rates) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - [Error Handling Reference](/docs/store-operations/translations/errors) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,291 @@ | ||
| # Translations for Shipping Methods (Beta) | ||
|
|
||
| <Callout type='info'> | ||
| The Translations Admin GraphQL API is currently available on Catalyst | ||
| storefronts only. | ||
| </Callout> | ||
|
|
||
| The following entities are translatable for shipping methods: | ||
|
|
||
| - Shipping Method Name as `shipping_method_name` | ||
|
|
||
| ## Resource fields | ||
|
|
||
| | Entity Type | `resourceType` | `resourceId` Format | | ||
| | ------------------ | ------------------ | ---------------------------------------- | | ||
| | Shipping Method | `SHIPPING_METHODS` | `bc/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). | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example query: Query a list of translations" showLineNumbers copy | ||
| 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 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example query: Query a list of translations" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "store": { | ||
| "translations": { | ||
| "edges": [ | ||
| { | ||
| "node": { | ||
| "resourceId": "bc/store/shippingMethod/1", | ||
| "fields": [ | ||
| { | ||
| "fieldName": "shipping_method_name", | ||
| "original": "Dev Test 1", | ||
| "translation": "espanol" | ||
| } | ||
| ] | ||
| }, | ||
| "cursor": "" | ||
| } | ||
| ], | ||
| "pageInfo": { | ||
| "hasNextPage": false, | ||
| "hasPreviousPage": false, | ||
| "startCursor": "eyJyZXNvdXJjZUlkIjoxfQ", | ||
| "endCursor": "eyJyZXNvdXJjZUlkIjoxfQ" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Query a Translation by Resource ID | ||
|
|
||
| This query returns a translation by `resourceId`. | ||
|
|
||
| <Callout type='info'> | ||
| When querying by `resourceId`, provide the full ID in the format `bc/store/shippingMethod/{id}`. | ||
| </Callout> | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example query: Query a translation by id" showLineNumbers copy | ||
| 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 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example query: Query a translation by id" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "store": { | ||
| "translations": { | ||
| "edges": [ | ||
| { | ||
| "node": { | ||
| "resourceId": "bc/store/shippingMethod/1", | ||
| "fields": [ | ||
| { | ||
| "fieldName": "shipping_method_name", | ||
| "original": "Dev Test 1", | ||
| "translation": "espanol" | ||
| } | ||
| ] | ||
| }, | ||
| "cursor": "" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Update a Translation | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example mutation: Update a translation" showLineNumbers copy | ||
| 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 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example mutation: Update a translation" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "translation": { | ||
| "updateTranslations": { | ||
| "errors": [] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Delete a Translation | ||
|
|
||
| <Tabs items={['Request', 'Response']}> | ||
| <Tab> | ||
|
|
||
| ```graphql filename="Example mutation: Delete a translation" showLineNumbers copy | ||
| 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 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab> | ||
|
|
||
| ```json filename="Example mutation: Delete a translation" showLineNumbers copy | ||
| { | ||
| "data": { | ||
| "translation": { | ||
| "deleteTranslations": { | ||
| "errors": [] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to /docs/store-operations/translations/shipping-methods is dead
no-dead-urlsremark-lint