Spree Seller SDK
import { createSellerClient } from '@spree/seller-sdk'
const client = createSellerClient({
baseUrl: 'https://your-store.com',
jwtToken: 'eyJhbGciOi...',
sellerId: 'sel_UkLWZg9DAJ',
})
const { data: ruleTypes } = await client.deliveryMethods.ruleTypes()curl --request GET \
--url http://{defaultHost}/api/v3/seller/delivery_methods/rule_types \
--header 'Authorization: Bearer <token>' \
--header 'X-Spree-Seller-Id: <x-spree-seller-id>'{
"data": [
{
"type": "item_total_rule",
"name": "Item total",
"description": "Limits the delivery method to carts within an item total range",
"schema": {
"type": "object",
"properties": {
"minimum_amount": {
"type": [
"string",
"null"
],
"format": "money",
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_amount": {
"type": [
"string",
"null"
],
"format": "money",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "weight_rule",
"name": "Weight",
"description": "Limits the delivery method to packages within a weight range",
"schema": {
"type": "object",
"properties": {
"minimum_weight": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_weight": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "volume_rule",
"name": "Volume",
"description": "Limits the delivery method to shipments within a volume range, in cubic meters",
"schema": {
"type": "object",
"properties": {
"minimum_volume": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_volume": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "company_rule",
"name": "Company",
"description": "Offers the delivery method only to orders placed for a company, or only to orders that are not",
"schema": {
"type": "object",
"properties": {
"company_orders_only": {
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
}
]
}List the conditions a method can carry
The eligibility rules a seller may put on their own method, with the preference schema each form is rendered from.
GET
/
api
/
v3
/
seller
/
delivery_methods
/
rule_types
Spree Seller SDK
import { createSellerClient } from '@spree/seller-sdk'
const client = createSellerClient({
baseUrl: 'https://your-store.com',
jwtToken: 'eyJhbGciOi...',
sellerId: 'sel_UkLWZg9DAJ',
})
const { data: ruleTypes } = await client.deliveryMethods.ruleTypes()curl --request GET \
--url http://{defaultHost}/api/v3/seller/delivery_methods/rule_types \
--header 'Authorization: Bearer <token>' \
--header 'X-Spree-Seller-Id: <x-spree-seller-id>'{
"data": [
{
"type": "item_total_rule",
"name": "Item total",
"description": "Limits the delivery method to carts within an item total range",
"schema": {
"type": "object",
"properties": {
"minimum_amount": {
"type": [
"string",
"null"
],
"format": "money",
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_amount": {
"type": [
"string",
"null"
],
"format": "money",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "weight_rule",
"name": "Weight",
"description": "Limits the delivery method to packages within a weight range",
"schema": {
"type": "object",
"properties": {
"minimum_weight": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_weight": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "volume_rule",
"name": "Volume",
"description": "Limits the delivery method to shipments within a volume range, in cubic meters",
"schema": {
"type": "object",
"properties": {
"minimum_volume": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
},
"maximum_volume": {
"type": [
"string",
"null"
],
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"additionalProperties": false
}
},
{
"type": "company_rule",
"name": "Company",
"description": "Offers the delivery method only to orders placed for a company, or only to orders that are not",
"schema": {
"type": "object",
"properties": {
"company_orders_only": {
"type": "boolean",
"default": true
}
},
"additionalProperties": false
}
}
]
}Was this page helpful?
⌘I

