Find shipping methods - Fabric

Find shipping methods

cURL

curl --request POST \
  --url 'https://api.fabric.inc/v3/shipping-methods/search?limit=10' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-channel-id: <x-fabric-channel-id>' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '
{
  "filters": [\
    {\
      "condition": "EQ",\
      "field": "shippingMethod.addressType",\
      "value": "APO"\
    },\
    {\
      "condition": "IN",\
      "field": "shippingMethod.maximumDays",\
      "values": [\
        10,\
        20\
      ]\
    }\
  ],
  "sort": "-shippingMethod.createdAt"
}
'
import requests

url = "https://api.fabric.inc/v3/shipping-methods/search?limit=10"

payload = {
    "filters": [\
        {\
            "condition": "EQ",\
            "field": "shippingMethod.addressType",\
            "value": "APO"\
        },\
        {\
            "condition": "IN",\
            "field": "shippingMethod.maximumDays",\
            "values": [10, 20]\
        }\
    ],
    "sort": "-shippingMethod.createdAt"
}
headers = {
    "x-fabric-tenant-id": "<x-fabric-tenant-id>",
    "x-fabric-channel-id": "<x-fabric-channel-id>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

Response Example

{
  "data": [\
    {\
      "code": "SDD",\
      "name": "Express Delivery",\
      "addressType": "APO",\
      "attributes": {\
        "carrier": "FedEx",\
        "type": "Next Day"\
      },\
      "carrier": "FedEx",\
      "cartValue": {\
        "max": 3.1,\
        "min": 2.1\
      },\
      "channelId": "12",\
      "configuredBy": "User3",\
      "cost": 20.5,\
      "createdAt": "2022-08-01T20:03:28.483Z",\
      "createdBy": "User1",\
      "currency": "USD",\
      "cutoffTime": 1330,\
      "description": "Express Delivery 2 - 5 days",\
      "dimension": {\
        "max": {\
          "height": 2.4,\
          "length": 4.6,\
          "uom": "EA",\
          "width": 3.5\
        },\
        "min": {\
          "height": 2.4,\
          "length": 4.6,\
          "uom": "EA",\
          "width": 3.5\
        }\
      },\
      "isDeleted": false,\
      "maximumDays": 5,\
      "minimumDays": 2,\
      "region": "CA",\
      "shippingMethodId": "5349b4ddd2781d08c09890f4",\
      "taxCode": "FR01",\
      "updatedAt": "2022-08-01T20:03:28.483Z",\
      "updatedBy": "User2",\
      "weight": {\
        "max": 3.1,\
        "min": 2.1\
      }\
    }\
  ],\
  "pagination": {\
    "count": 1000,\
    "limit": 10,\
    "offset": 1\
  },\
  "stats": [\
    "<string>"\
  ]\
}

Error Responses

{
  "errors": [\
    {\
      "message": "Invalid request",\
      "type": "CLIENT_ERROR"\
    }\
  ],\
  "message": "Bad request",\
  "type": "CLIENT_ERROR"
}
{
  "message": "Unauthorized request",\
  "type": "CLIENT_ERROR"
}
{
  "message": "Internal server error",\
  "type": "SERVER_ERROR"
}

Required Headers