Create Shipping Option
Create a shipping option.
In: header
Query Parameters
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
Request Body
application/json
The flat-rate shipping option's name.
The ID of the associated service zone.
The ID of the associated shipping profile.
The flat-rate shipping option's data, useful for the fulfillment provider handling its processing.
The shipping option's price type. If flat, the shipping option has a fixed price set in prices. Otherwise, the shipping option's price is calculated by the fulfillment provider.
"flat" | "calculated"The ID of the fulfillment provider handling this shipping option.
The shipping option type's details.
The shipping option's prices.
The ID of the shipping option type that this shipping option belongs to.
The shipping option's rules.
The shipping option's metadata.
Response Body
application/json
application/json
text/plain
application/json
application/json
application/json
application/json
curl -X POST "https://{tenant}.api.myxclade.com/admin/shipping-options" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "service_zone_id": "string", "shipping_profile_id": "string", "price_type": "flat", "provider_id": "string", "prices": [ { "currency_code": "usd", "amount": 0 } ] }'{
"shipping_option": {
"id": "string",
"name": "string",
"price_type": "calculated",
"service_zone_id": "string",
"service_zone": {},
"provider_id": "string",
"provider": {
"id": "string",
"is_enabled": true
},
"shipping_option_type_id": "string",
"type": {
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z",
"label": "string",
"description": "string",
"code": "string",
"shipping_option_id": "string"
},
"shipping_profile_id": "string",
"shipping_profile": {
"id": "string",
"name": "string",
"type": "string",
"metadata": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
},
"rules": [
{
"id": "string",
"attribute": "is_return",
"operator": "gt",
"value": "true",
"shipping_option_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
}
],
"prices": [
{
"price_rules": [
{
"id": "string",
"value": "string",
"operator": "gt",
"attribute": "string",
"price_id": "string",
"priority": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
}
],
"rules_count": 0,
"id": "string",
"title": "string",
"currency_code": "usd",
"amount": 0,
"raw_amount": {},
"min_quantity": 0,
"max_quantity": 0,
"price_set_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
}
],
"data": {},
"metadata": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted_at": "2019-08-24T14:15:22Z"
}
}{
"message": "Discount must be set to dynamic",
"type": "not_allowed"
}"Unauthorized"{
"message": "Entity with id 1 was not found",
"type": "not_found"
}{
"code": "unknown_error",
"message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.",
"type": "QueryRunnerAlreadyReleasedError"
}{
"code": "invalid_request_error",
"message": "Discount with code TEST already exists.",
"type": "duplicate_error"
}{
"code": "api_error",
"message": "An error occured while hashing password",
"type": "database_error"
}