Beta
Not authenticated — log in first
VendorShipping Methods

Create Shipping Method

Create Shipping Method — vendor REST API endpoint.

POST/vendor/me/shipping-methodsVendor bearer token required

Create Shipping Method

Create a new shipping method for your vendor.

What this means in plain English

Adds a shipping method with per-country rates. Requires OWNER, ADMIN, or EDITOR role. Use FLAT_RATE with countryRates[].flatRate, or WEIGHT_BASED with baseRate + weightTiers.

When to use this

  • Setting up flat-rate or weight-based shipping for your catalog.

Request body

NameTypeRequiredDescription
namestringYesMethod display name.
pricingTypestringNo`FLAT_RATE` or `WEIGHT_BASED`. Defaults to server default when omitted.
currencystringNoISO currency code (max 3).
descriptionstringNoOptional description.
weightLimitMinnumberNoOptional minimum shipment weight.
weightLimitMaxnumberNoOptional maximum shipment weight.
countryRates[].countryCodestringYesISO country code for this rate (max 10).
countryRates[].flatRatenumberYesFlat rate for this country. Required for `FLAT_RATE` methods.
countryRates[].baseRatenumberNoBase rate for `WEIGHT_BASED` methods (used with weightTiers).
countryRates[].weightTiersarrayNoWeight tiers for `WEIGHT_BASED`: `[{ "minWeight": 0, "maxWeight": 5, "rate": 8.99 }]`. Omit for flat-rate methods.

Request example

curl -X POST 'https://api.next.gcommerce.glass/api/v1/vendor/me/shipping-methods' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Standard Shipping",
  "pricingType": "FLAT_RATE",
  "currency": "USD",
  "description": "5-7 business days",
  "countryRates": [
    {
      "countryCode": "US",
      "flatRate": 9.99
    }
  ]
}'

Response examples

201Created
{
  "id": "550e8400-e29b-41d4-a716-446655440060",
  "name": "Standard Shipping",
  "isActive": true,
  "pricingType": "FLAT_RATE",
  "weightLimitMin": null,
  "weightLimitMax": null,
  "currency": "USD",
  "description": "5-7 business days",
  "countryRates": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440061",
      "methodId": "550e8400-e29b-41d4-a716-446655440060",
      "countryCode": "US",
      "flatRate": "9.99",
      "baseRate": null,
      "weightTiers": []
    }
  ],
  "createdAt": "2025-03-01T10:00:00.000Z",
  "updatedAt": "2025-03-01T10:00:00.000Z"
}

Status codes

200

OK

Request succeeded.

401

Unauthorized

Missing or invalid bearer token.

403

Forbidden

Insufficient permissions for this action.

400

Bad Request

Validation failed or invalid parameters.

404

Not Found

Resource not found.

429

Too Many Requests

Global rate limit exceeded (10,000 requests per 10 minutes per IP).

500

Internal Server Error

Unexpected server error.

403

Forbidden

No vendor membership, or insufficient vendor role (requires OWNER, ADMIN, or EDITOR for write operations).

`countryRates` is required and must be a non-empty array. There is no top-level `flatRateAmount` — put the rate on each country entry as `flatRate`.
For weight-based pricing, set `pricingType` to `WEIGHT_BASED` and provide `baseRate` + `weightTiers` instead of (or in addition to) `flatRate`. Example:
```json { "name": "Weight-Based Shipping", "pricingType": "WEIGHT_BASED", "currency": "USD", "countryRates": [ { "countryCode": "US", "baseRate": 5.0, "weightTiers": [ { "minWeight": 0, "maxWeight": 5, "rate": 8.99 }, { "minWeight": 5, "maxWeight": 20, "rate": 14.99 } ] } ] } ```

Try it

Uses your saved session from login. Edit values and send a live request, or copy the cURL command.