Skip to content

Shipping rate

POST /v1/shipping_rate

Returns available shipping methods and their costs for a set of boxes, before you submit the order.

Request

Send username, password and secretkey along with a data object. See Making requests.

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "secretkey": "YOUR_SECRET_KEY",
  "data": {
    "shipping_address": {
      "name": "Jane Smith",
      "address": "456 Oak Avenue",
      "city": "Minneapolis",
      "zip": "55401",
      "state": "MN",
      "country": "US"
    },
    "order_info": [
      {
        "width": "5",
        "height": "5",
        "length": "5",
        "weight": "10.00"
      },
      {
        "width": "10",
        "height": "10",
        "length": "10",
        "weight": "20.00"
      }
    ],
    "shipping": {
      "carrier": "FEDEX",
      "package_type": "YOUR_PACKAGING"
    }
  }
}
curl -X POST https://gatewaybeta.marcofinearts.com/v1/shipping_rate \
  -H "Content-Type: application/json" \
  -d '{
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD",
    "secretkey": "YOUR_SECRET_KEY",
    "data": {
      "shipping_address": {
        "name": "Jane Smith",
        "address": "456 Oak Avenue",
        "city": "Minneapolis",
        "zip": "55401",
        "state": "MN",
        "country": "US"
      },
      "order_info": [
        {
          "width": "5",
          "height": "5",
          "length": "5",
          "weight": "10.00"
        },
        {
          "width": "10",
          "height": "10",
          "length": "10",
          "weight": "20.00"
        }
      ],
      "shipping": {
        "carrier": "FEDEX",
        "package_type": "YOUR_PACKAGING"
      }
    }
  }'

data fields

Field Required Validation Notes
shipping_address Yes Object Destination: name, address, city, zip, state, country.
order_info Yes Array One object per box.
order_info[].width Yes Numeric Box width.
order_info[].height Yes Numeric Box height.
order_info[].length Yes Numeric Box length.
order_info[].weight Yes Numeric Box weight.
shipping Yes Object
shipping.carrier Yes Valid carrier
shipping.package_type No

Response

{
  "res": "success",
  "rate": [
    {
      "title": "Ground home delivery",
      "method": "GROUND_HOME_DELIVERY",
      "cost": 22.67,
      "delivery_time": "FOUR_DAYS"
    },
    {
      "title": "Fedex express saver",
      "method": "FEDEX_EXPRESS_SAVER",
      "cost": 58.75,
      "delivery_time": "2026-02-28T19:00:00"
    },
    {
      "title": "Fedex 2 day",
      "method": "FEDEX_2_DAY",
      "cost": 84.57,
      "delivery_time": "2026-02-27T10:30:00"
    },
    {
      "title": "Standard overnight",
      "method": "STANDARD_OVERNIGHT",
      "cost": 121.77,
      "delivery_time": "2026-02-24T15:00:00"
    },
    {
      "title": "Priority overnight",
      "method": "PRIORITY_OVERNIGHT",
      "cost": 128.31,
      "delivery_time": "2026-02-24T10:30:00"
    }
  ]
}
{
  "res": "error",
  "code": "000",
  "message": "Error message."
}

Error codes

Code Error Description
1001 Authentication failed Your account is invalid or does not have API access. Check username, password and secretkey.
1002 Missing field One or more required fields are missing.
1004 Invalid data type Field must be numeric.
1009 Invalid country Invalid country code.
1010 Invalid state Invalid state code.
1013 Invalid data Unexpected error. Try again.
1022 Invalid data Shipping details or box data are invalid.