Create a shipping method

How to create a shipping method via API

To create a new shipping method, send a POST request to the /api/shipping_methods endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/shipping_methods

Arguments

Example

The following request creates a new shipping method:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/shipping_methods' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "shipping_methods",
    "attributes": {
      "name": "Standard shipping",
      "currency_code": "EUR",
      "external_prices_url": "https://external_prices.yourbrand.com",
      "price_amount_cents": 1000
    }
  }
}'

Last updated