Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const resources = await client.translatableResources.list()spree api get /translatable_resources{
"data": [
{
"resource_type": "option_type",
"fields": [
{
"key": "label",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "option_value",
"fields": [
{
"key": "label",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "product",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "slug",
"type": "string"
},
{
"key": "meta_description",
"type": "string"
},
{
"key": "meta_title",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "product_type",
"fields": [
{
"key": "name",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "collection",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "permalink",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "category",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "pretty_name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "permalink",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "store",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "meta_description",
"type": "string"
},
{
"key": "meta_keywords",
"type": "string"
},
{
"key": "seo_title",
"type": "string"
},
{
"key": "customer_support_email",
"type": "string"
},
{
"key": "address",
"type": "string"
},
{
"key": "contact_phone",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "policy",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "body",
"type": "html"
}
],
"readable": true
},
{
"resource_type": "seller",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "about",
"type": "html"
}
],
"readable": false
}
]
}List translatable resources
Returns every translatable resource type and its translatable fields (key + content type), so clients can render translation editors generically.
Required scope: read_settings (for API-key authentication).
GET
/
api
/
v3
/
admin
/
translatable_resources
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const resources = await client.translatableResources.list()spree api get /translatable_resources{
"data": [
{
"resource_type": "option_type",
"fields": [
{
"key": "label",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "option_value",
"fields": [
{
"key": "label",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "product",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "slug",
"type": "string"
},
{
"key": "meta_description",
"type": "string"
},
{
"key": "meta_title",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "product_type",
"fields": [
{
"key": "name",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "collection",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "permalink",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "category",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "pretty_name",
"type": "string"
},
{
"key": "description",
"type": "html"
},
{
"key": "permalink",
"type": "string"
}
],
"readable": true
},
{
"resource_type": "store",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "meta_description",
"type": "string"
},
{
"key": "meta_keywords",
"type": "string"
},
{
"key": "seo_title",
"type": "string"
},
{
"key": "customer_support_email",
"type": "string"
},
{
"key": "address",
"type": "string"
},
{
"key": "contact_phone",
"type": "string"
}
],
"readable": false
},
{
"resource_type": "policy",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "body",
"type": "html"
}
],
"readable": true
},
{
"resource_type": "seller",
"fields": [
{
"key": "name",
"type": "string"
},
{
"key": "about",
"type": "html"
}
],
"readable": false
}
]
}Was this page helpful?
⌘I

