Parcel Billable Weight

Apply a caller-supplied dimensional-weight divisor and billing increment per parcel using millimeters, grams and integer upward rounding.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /parcel-billable-weight/v1/check with an x402 V2 client.

Worked example

Request

{
  "mm3_per_gram": 5000,
  "increment_g": 500,
  "parcels": [
    {
      "length_mm": 300,
      "width_mm": 200,
      "height_mm": 100,
      "actual_g": 650
    },
    {
      "length_mm": 100,
      "width_mm": 100,
      "height_mm": 50,
      "actual_g": 1120
    }
  ]
}

Result

{
  "total_billable_g": 3000,
  "parcels": [
    {
      "dimensional_g": 1200,
      "billable_g": 1500,
      "basis": "dimensional"
    },
    {
      "dimensional_g": 100,
      "billable_g": 1500,
      "basis": "actual"
    }
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter