List all shipping methods
How to fetch a collection of shipping methods via API
To fetch a collection of shipping methods, send a GET request to the /api/shipping_methods endpoint.
Request
GET https://yourdomain.commercelayer.io/api/shipping_methods
Example
The following request fetches a collection of shipping methods:
curl -g -X GET \
'https://yourdomain.commercelayer.io/api/shipping_methods/' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
{
"data": [
{
"id": "XAyRWNUzyN",
"type": "shipping_methods",
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN"
},
"attributes": {
"name": "Standard shipping",
"scheme": "flat",
"currency_code": "EUR",
"external_prices_url": "https://external_prices.yourbrand.com",
"price_amount_cents": 1000,
"price_amount_float": 10.0,
"formatted_price_amount": "€10,00",
"free_over_amount_cents": 9900,
"free_over_amount_float": 99.0,
"formatted_free_over_amount": "€99,00",
"use_subtotal": true,
"min_weight": 3.0,
"max_weight": 300.0,
"unit_of_weight": "gr",
"tax_code": "FR010000",
"disabled_at": "2018-01-01T12:00:00.000Z",
"shared_secret": "1c0994cc4e996e8c6ee56a2198f66f3c",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"market": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/market",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/market"
}
},
"shipping_zone": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/shipping_zone",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/shipping_zone"
}
},
"shipping_category": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/shipping_category",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/shipping_category"
}
},
"stock_location": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/stock_location",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/stock_location"
}
},
"delivery_lead_time_for_shipment": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/delivery_lead_time_for_shipment",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/delivery_lead_time_for_shipment"
}
},
"shipping_method_tiers": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/shipping_method_tiers",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/shipping_method_tiers"
}
},
"shipping_weight_tiers": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/shipping_weight_tiers",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/shipping_weight_tiers"
}
},
"attachments": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/attachments",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/attachments"
}
},
"notifications": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/notifications",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/notifications"
}
},
"versions": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/versions",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/versions"
}
},
"event_stores": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/relationships/event_stores",
"related": "https://yourdomain.commercelayer.io/api/shipping_methods/XAyRWNUzyN/event_stores"
}
}
},
"meta": {
"mode": "test",
"organization_id": "xRRkjDFafe",
"trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
}
},
{
"other": "... 9 shipping_methods (first page)"
}
],
"meta": {
"record_count": 140,
"page_count": 14
},
"links": {
"first": "https://yourdomain.commercelayer.io/api/shipping_methods?page[number]=1&page[size]=10",
"next": "https://yourdomain.commercelayer.io/api/shipping_methods?page[number]=2&page[size]=10",
"last": "https://yourdomain.commercelayer.io/api/shipping_methods?page[number]=14&page[size]=10"
}
}Remember that when you fetch a list of resources you get paginated result.
Sortable fields
The list of shipping methods can be sorted by the following fields:
Attributes
nameschemecurrency_codeprice_amount_centsfree_over_amount_centsiddisabled_atcircuit_statecircuit_failure_countcreated_atupdated_atreferencereference_origin
Relationships
marketshipping_zoneshipping_categorystock_location
Filterable fields
The list of shipping methods can be filtered by the following fields:
Attributes
nameschemecurrency_codeprice_amount_centsfree_over_amount_centsiddisabled_atcircuit_statecircuit_failure_countcreated_atupdated_atreferencereference_originmetadata
Relationships
marketshipping_zoneshipping_categorystock_locationshipping_method_tiersattachmentsnotifications
Last updated

