Shipping providers

Fixed price

You can use the shipping rates webhook when you want to handle shipping rates calculation by yourself. Snipcart will call your application at the URL you specify in the admin dashboard. Go to Settings > Carriers and enable API carrier.

You will be able to add unlimited shipping methods. Each method is defined by the description, the cost and the estimated time of arrival, which is optional. If you omit to set the delivery time, N/A will appear on the cart.

Integrated shipping providers

For the moment, we support six shipping solutions & providers for your e-commerce(FedEx, USPS, UPS, Canada Post, Australia Post, Purolator). If you decide to activate one of them, Snipcart will call their APIs for you and we will be able to provide your customers with an accurate shipping estimate.

Please note that if you decide to use one of these providers, you will need to define the weight of your items. See Product definition section for more information.

Webhooks Shipping API

You can use the shipping rates webhook when you want to handle shipping rates calculation by yourself. Snipcart will call your application at the URL you will specify in Snipcart dashboard. Go to Settings > Carriers and enable API carrier.

Snipcart will make a HTTP POST request to the URL you specified. The request body will contain all the current order details.

Request

Method POST

Content-Type application/json

Body

{
  "eventName": "shippingrates.fetch",
  "mode": "Live",
  "createdOn": "2015-02-21T14:58:02.6738454Z",
  "content": {
    "token": "22808196-0eff-4a6e-b136-3e4d628b3cf5",
    "creationDate": "2015-02-21T14:58:02.6738454Z",
    "modificationDate": "2015-02-21T14:58:02.6738454Z",
    "status": "Processed",
    "paymentMethod": "CreditCard",
    "email": "customer@snipcart.com",
    "cardHolderName": "Nicolas Cage",
    "billingAddressName": "Nicolas Cage",
    "billingAddressCompanyName": "Company name",
    "billingAddressAddress1": "888 The street",
    "billingAddressAddress2": "",
    "billingAddressCity": "Québec",
    "billingAddressCountry": "CA",
    "billingAddressProvince": "QC",
    "billingAddressPostalCode": "G1G 1G1",
    "billingAddressPhone": "(888) 888-8888",
    "shippingAddressName": "Nicolas Cage",
    "shippingAddressCompanyName": "Company name",
    "shippingAddressAddress1": "888 The street",
    "shippingAddressAddress2": "",
    "shippingAddressCity": "Québec",
    "shippingAddressCountry": "CA",
    "shippingAddressProvince": "QC",
    "shippingAddressPostalCode": "G1G 1G1",
    "shippingAddressPhone": "(888) 888-8888",
    "shippingAddressSameAsBilling": true,
    "finalGrandTotal": 310.00,
    "shippingAddressComplete": true,
    "creditCardLast4Digits": "4242",
    "shippingFees": 10.00,
    "shippingMethod": "Livraison",
    "items": [{
      "uniqueId": "eb4c9dae-e725-4dad-b7ae-a5e48097c831",
      "token": "22808196-0eff-4a6e-b136-3e4d628b3cf5",
      "id": "1",
      "name": "Movie",
      "price": 300.00,
      "originalPrice": 300.00,
      "quantity": 1,
      "url": "https://snipcart.com",
      "weight": 10.00,
      "description": "Something",
      "image": "http://placecage.com/50/50",
      "customFieldsJson": "[]",
      "stackable": true,
      "maxQuantity": null,
      "totalPrice": 300.0000,
      "totalWeight": 10.00
    }],
    "subtotal": 610.0000,
    "totalWeight": 20.00,
    "discounts": [],
    "willBePaidLater": false
  }
}

Response

Snipcart expects to receive a JSON object that contains an array of shipping rates.

Success

Response status code must be 2XX to indicate that the request has been handled successfully.

Required HTTP headers

Key Value
Content-Type application/json

Content

{
  "rates": [{
    "cost": 10,
    "description": "10$ shipping"
    }, {
    "cost": 20,
    "description": "20$ shipping",
    "guaranteedDaysToDelivery": 5
    },
    ...
  ]
}

Error

If you want Snipcart to show an error message to your customers, you can do so by returning us a 2XX status code with the following JSON object.

{
  "errors": [{
    "key": "invalid_postal_code",
    "message": "The postal code is invalid."
    },
    ...
  ]
}