Skip to main content
The Billing Rates endpoint lets authorised users read and manage the weight-tier fee tables that Shiipp uses to calculate shipping charges. You can retrieve global platform defaults, inspect or override rates for a specific courier, copy defaults to a courier in a single call, and set the per-courier air freight multiplier — all through the same endpoint.

Endpoint

/api/GetCourierRates.php
Authentication: JWT Bearer token — include your token as Authorization: Bearer <token> on every request. This endpoint requires the billing:manage or courier:manage permission and is accessible to admin and manager roles only.

GET — Retrieve Rates

Send a GET request to fetch rate tables. Without a query parameter the response includes global default rates and a list of all couriers with their specific rate overrides. Append ?courier_id=<uuid> to scope the response to a single courier.

Query Parameters

courier_id
string
UUID of the courier whose specific rates you want to retrieve. When omitted, the response includes rate data for all couriers.

Response Fields

status
string
required
"success" on a successful retrieval.
data
object
required
If uses_global_rates is true for a courier, it means no courier-specific rates are defined and the global defaults apply to all their packages.

Example Response (Single Courier)

{
  "status": "success",
  "data": {
    "global_default_rates": [
      { "id": 1, "startweight": 0,     "endweight": 5,  "fee": 5.00  },
      { "id": 2, "startweight": 5.01,  "endweight": 15, "fee": 10.00 },
      { "id": 3, "startweight": 15.01, "endweight": 50, "fee": 18.00 }
    ],
    "courier": {
      "courier_id": "courier-uuid",
      "courier_name": "Express Couriers",
      "courier_code": "EXP",
      "air_freight_rate": 1.50,
      "specific_rates": [
        { "id": 10, "startweight": 0, "endweight": 5, "fee": 4.50 }
      ],
      "uses_global_rates": false
    }
  }
}

POST Actions

All POST requests must be sent as application/json. Every successful action returns the same envelope:
{
  "status": "success",
  "message": "Rates saved successfully."
}
Use the action field in the request body to specify the operation.

save_rates — Create or Update Rate Tiers

Upserts the complete rate table for a courier or for the global defaults. The submitted rates array is treated as the full intended state: rows with an id are updated, rows without an id are inserted, and any existing rows for that courier not present in the array are deleted.
action
string
required
Must be "save_rates".
courier_id
string
UUID of the courier whose rates you are setting. Set to null or omit entirely to update the global default rate table.
rates
array
required
Array of rate tier objects. Include id to update an existing row; omit id to create a new row.
Rows present in the database for the target courier that are not included in the rates array will be permanently deleted. Always submit the complete desired rate table in a single call.

copy_default — Copy Global Defaults to a Courier

Clears all existing specific rate rows for the specified courier and replaces them with an exact copy of the current global default tiers. After this action, uses_global_rates will be false and the courier will have its own mirrored copy of the defaults.
action
string
required
Must be "copy_default".
courier_id
string
required
UUID of the courier that should receive a copy of the global defaults.

delete_rate — Remove a Single Rate Tier

Deletes one rate tier row by its ID. Use this for surgical removals rather than a full save_rates replacement when only a single row needs to be dropped.
action
string
required
Must be "delete_rate".
rate_id
integer
required
The id of the rate tier row to delete.

update_air_freight — Set the Air Freight Rate

Updates the per-lb air freight rate charged by a specific courier. This value is applied on top of standard weight-tier fees for air shipments.
action
string
required
Must be "update_air_freight".
courier_id
string
required
UUID of the courier whose air freight rate you are updating.
air_freight_rate
number
required
New air freight rate per lb in the platform’s configured currency.