Skip to content

Commit 2dbc563

Browse files
Merge branch 'main' into PAYMENTS-11030
2 parents 2f3855e + de88f72 commit 2dbc563

29 files changed

+2430
-659
lines changed

docs/store-operations/translations/filters.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ The product filter translatable fields are:
1919
| Category, Brand, Variants, Custom Fields, Price, Rating | Display Name as the field name (e.g. `brand` or `category`) |
2020
| Other Filters | Display Name as `display_name` <br /> Has Free Shipping as `has_free_shipping` <br /> Is Featured as `is_featured` <br /> In Stock as `in_stock` |
2121

22-
<Callout type='warning'>
23-
While most translatable entities use a `resourceId` format of `bc/store/{{type}}/{id}}`, product filters use a different format.
24-
25-
Use `bc/store/ProductFilters/{filterName}`, using the filters above for reference.
26-
</Callout>
27-
2822
<Callout type='info'>
2923
Only string values are translatable. Numeric content such as product count or price values are not translatable.
3024
</Callout>
@@ -97,10 +91,10 @@ query {
9791
### Query a translation by `resourceId`
9892

9993
<Callout type='warning'>
100-
When querying a translation by `resourceId`, you must provide the full `resourceId` in the format `bc/store/product-filter/{filter_id}`.
94+
When querying by `resourceId`, the `resourceId` value must be constructed from the `filterName` using the format `bc/store/productFilters/{filterName}`. For example, the `filterName` `brand` becomes the `resourceId` `bc/store/productFilters/brand`.
10195
</Callout>
10296

103-
This query returns translation(s) by `resourceId`.
97+
This query returns translation(s) filtered by `resourceId`. For product filters, the `resourceId` is constructed from the `filterName` as shown in the callout above.
10498

10599
<Tabs items={['Request', 'Response']}>
106100
<Tab>

docs/store-operations/translations/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ The API currently supports translations for the following resource types, and mo
1010
* Common Fields
1111
* Product Options
1212
* Custom Fields
13+
* [Product Modifiers](/docs/store-operations/translations/product-modifiers)
1314
* [Product Listings](/docs/store-operations/translations/listings)
1415
* Categories
1516
* Brands
1617
* [Product Filters](/docs/store-operations/translations/filters)
1718
* [Locations](/docs/store-operations/translations/locations)
19+
* [Order Statuses](/docs/store-operations/translations/order-statuses)
20+
* [Promotions](/docs/store-operations/translations/promotions)
1821
* [Payment Methods](/docs/store-operations/translations/payments)
1922
* [Address Form Fields](/docs/store-operations/translations/address-form-fields)
2023
* [Customer Form Fields](/docs/store-operations/translations/customer-form-fields)
@@ -74,9 +77,12 @@ For more information on OAuth Scopes, see our [Guide to API Accounts](/docs/star
7477
## Resources
7578

7679
- [Product Translations](/docs/store-operations/translations/product)
80+
- [Product Modifiers Translations](/docs/store-operations/translations/product-modifiers)
7781
- [Product Listing Page Translations](/docs/store-operations/translations/listings)
7882
- [Product Filter Translations](/docs/store-operations/translations/filters)
7983
- [Inventory Locations Translations](/docs/store-operations/translations/locations)
84+
- [Order Status Translations](/docs/store-operations/translations/order-statuses)
85+
- [Promotions Translations](/docs/store-operations/translations/promotions)
8086
- [Payment Methods Translations](/docs/store-operations/translations/payments)
8187
- [Address Form Fields Translations](/docs/store-operations/translations/address-form-fields)
8288
- [Customer Form Fields Translations](/docs/store-operations/translations/customer-form-fields)
Lines changed: 337 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,337 @@
1+
# Translations for Order Statuses (Beta)
2+
3+
<Callout type='info'>
4+
The Translations Admin GraphQL API is currently available on Catalyst
5+
storefronts only.
6+
</Callout>
7+
8+
The following entities are translatable for order statuses:
9+
10+
- Label as `label`
11+
12+
<Callout type='info'>
13+
Order status IDs are predefined and static (0–14). Merchants can only change the status name. See the [Order Status REST API](https://developer.bigcommerce.com/docs/rest-management/orders/order-status#get-all-order-statuses) for the full list of statuses and their IDs.
14+
</Callout>
15+
16+
## Resource fields
17+
18+
| Entity Type | `resourceType` | `resourceId` Format |
19+
| --------------- | ----------------- | ---------------------------------- |
20+
| Order Status | `ORDER_STATUSES` | `bc/store/orderStatus/{status_id}` |
21+
22+
## Examples
23+
24+
Below are examples of GraphQL queries and mutations for retrieving and managing translation settings for order statuses.
25+
26+
### Query a List of Translations
27+
28+
This query returns up to 2 order status translations for the specified resource type, channel, and locale.
29+
30+
The request below uses several variables for reusability. Replace `{{channel_id}}` and `{{locale_code}}` with the appropriate values for your use case.
31+
32+
<Tabs items={['Request', 'Response']}>
33+
<Tab>
34+
35+
```graphql filename="Example query: Query a list of translations" showLineNumbers copy
36+
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
37+
X-Auth-Token: {{token}}
38+
39+
query {
40+
store {
41+
translations(
42+
filters: {
43+
resourceType: ORDER_STATUSES
44+
channelId: "bc/store/channel/{{channel_id}}"
45+
localeId: "bc/store/locale/{{locale_code}}"
46+
}
47+
first: 2
48+
) {
49+
edges {
50+
node {
51+
resourceId
52+
fields {
53+
fieldName
54+
original
55+
translation
56+
}
57+
}
58+
cursor
59+
}
60+
pageInfo {
61+
hasNextPage
62+
hasPreviousPage
63+
startCursor
64+
endCursor
65+
}
66+
}
67+
}
68+
}
69+
```
70+
71+
</Tab>
72+
<Tab>
73+
74+
```json filename="Example query: Query a list of translations" showLineNumbers copy
75+
{
76+
"data": {
77+
"store": {
78+
"translations": {
79+
"edges": [
80+
{
81+
"node": {
82+
"resourceId": "bc/store/orderStatus/0",
83+
"fields": [
84+
{
85+
"fieldName": "label",
86+
"original": "Incomplete",
87+
"translation": "Incomplete (FR)"
88+
}
89+
]
90+
},
91+
"cursor": "eyJpZCI6MH0"
92+
},
93+
{
94+
"node": {
95+
"resourceId": "bc/store/orderStatus/1",
96+
"fields": [
97+
{
98+
"fieldName": "label",
99+
"original": "Pending",
100+
"translation": "Pending (FR)"
101+
}
102+
]
103+
},
104+
"cursor": "eyJpZCI6MX0"
105+
}
106+
],
107+
"pageInfo": {
108+
"hasNextPage": true,
109+
"hasPreviousPage": false,
110+
"startCursor": "eyJpZCI6MH0",
111+
"endCursor": "eyJpZCI6MX0"
112+
}
113+
}
114+
}
115+
}
116+
}
117+
```
118+
119+
</Tab>
120+
</Tabs>
121+
122+
### Query a Translation by Resource ID
123+
124+
This query returns translation(s) by resourceId.
125+
126+
The request below uses several variables for reusability. Replace `{{resourceId}}`, `{{channel_id}}`, and `{{locale_code}}` with appropriate values for your use case. Make sure `resourceId` follows the format from the [Resource fields](#resource-fields) table.
127+
128+
<Tabs items={['Request', 'Response']}>
129+
<Tab>
130+
131+
```graphql filename="Example query: Query a translation by id" showLineNumbers copy
132+
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
133+
X-Auth-Token: {{token}}
134+
135+
query {
136+
store {
137+
translations(
138+
filters: {
139+
resourceType: ORDER_STATUSES
140+
channelId: "bc/store/channel/{{channel_id}}"
141+
localeId: "bc/store/locale/{{locale_code}}"
142+
resourceIds: ["{{resourceId}}"]
143+
}
144+
) {
145+
edges {
146+
node {
147+
resourceId
148+
fields {
149+
fieldName
150+
original
151+
translation
152+
}
153+
}
154+
cursor
155+
}
156+
}
157+
}
158+
}
159+
```
160+
161+
</Tab>
162+
<Tab>
163+
164+
```json filename="Example query: Query a translation by id" showLineNumbers copy
165+
{
166+
"data": {
167+
"store": {
168+
"translations": {
169+
"edges": [
170+
{
171+
"node": {
172+
"resourceId": "bc/store/orderStatus/1",
173+
"fields": [
174+
{
175+
"fieldName": "label",
176+
"original": "Pending",
177+
"translation": "Pending (FR)"
178+
}
179+
]
180+
},
181+
"cursor": "eyJpZCI6MX0"
182+
}
183+
]
184+
}
185+
}
186+
}
187+
}
188+
```
189+
190+
</Tab>
191+
</Tabs>
192+
193+
### Update a Translation
194+
195+
This mutation updates translated values for order statuses for a specific channel and locale.
196+
197+
<Tabs items={['Request', 'Response']}>
198+
<Tab>
199+
200+
```graphql filename="Example mutation: Update a translation" showLineNumbers copy
201+
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
202+
X-Auth-Token: {{token}}
203+
204+
mutation {
205+
translation {
206+
updateTranslations(
207+
input: {
208+
resourceType: ORDER_STATUSES,
209+
channelId: "bc/store/channel/{{channel_id}}",
210+
localeId: "bc/store/locale/{{locale_code}}",
211+
entities: [
212+
{
213+
resourceId: "bc/store/orderStatus/0",
214+
fields: [
215+
{ fieldName: "label", value: "Incomplete (FR)" }
216+
]
217+
},
218+
{
219+
resourceId: "bc/store/orderStatus/1",
220+
fields: [
221+
{ fieldName: "label", value: "Pending (FR)" }
222+
]
223+
}
224+
]
225+
}
226+
) {
227+
__typename
228+
errors {
229+
__typename
230+
... on ValidationError {
231+
message
232+
}
233+
... on EntityNotFoundError {
234+
id
235+
message
236+
}
237+
... on InvalidTranslationEntityFieldsError {
238+
id
239+
message
240+
fields
241+
}
242+
}
243+
}
244+
}
245+
}
246+
```
247+
248+
</Tab>
249+
<Tab>
250+
251+
```json filename="Example mutation: Update a translation" showLineNumbers copy
252+
{
253+
"data": {
254+
"translation": {
255+
"updateTranslations": {
256+
"__typename": "UpdateTranslationsResult",
257+
"errors": []
258+
}
259+
}
260+
}
261+
}
262+
```
263+
264+
</Tab>
265+
</Tabs>
266+
267+
### Delete a Translation
268+
269+
The following mutation removes translated values for specified order status fields, reverting them to the original values for a specific channel and locale.
270+
271+
<Tabs items={['Request', 'Response']}>
272+
<Tab>
273+
274+
```graphql filename="Example mutation: Delete a translation" showLineNumbers copy
275+
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
276+
X-Auth-Token: {{token}}
277+
278+
mutation {
279+
translation {
280+
deleteTranslations(
281+
input: {
282+
resourceType: ORDER_STATUSES,
283+
channelId: "bc/store/channel/{{channel_id}}",
284+
localeId: "bc/store/locale/{{locale_code}}",
285+
resources: [
286+
{
287+
resourceId: "bc/store/orderStatus/0",
288+
fields: ["label"]
289+
},
290+
{
291+
resourceId: "bc/store/orderStatus/1",
292+
fields: ["label"]
293+
}
294+
]
295+
}
296+
) {
297+
__typename
298+
errors {
299+
__typename
300+
... on ValidationError {
301+
message
302+
}
303+
... on EntityNotFoundError {
304+
id
305+
message
306+
}
307+
... on InvalidTranslationEntityFieldsError {
308+
id
309+
message
310+
fields
311+
}
312+
}
313+
}
314+
}
315+
}
316+
```
317+
318+
</Tab>
319+
<Tab>
320+
321+
```json filename="Example mutation: Delete a translation" showLineNumbers copy
322+
{
323+
"data": {
324+
"translation": {
325+
"deleteTranslations": {
326+
"__typename": "DeleteTranslationsResult",
327+
"errors": []
328+
}
329+
}
330+
}
331+
}
332+
```
333+
334+
</Tab>
335+
</Tabs>
336+
337+

0 commit comments

Comments
 (0)