d
Topic
Jamie D. Developer Experience
Posts:
533
Last edited July 19, 2017
g
1
upvotes

New parameter being added to CarrierService payload This post is outdated

Hey Shopify Developers,

As of Thursday July 20th, 2017, a new parameter will be added to Carrier Service rate requests sent by Shopify – a locale parameter which represents the language of the customer browsing the storefront.

Here is example of a payload that will be sent:

{ "rate": {
    "items": [
      {
        "price": "10.00",
        "name": "Draft - 151cm",
        "title": "Draft",
        "requires_shipping": true,
        "quantity": 1,
        "product_id": 108828309,
        "properties": [],
        "id": 510711879,
        "grams": 1500,
        "sku": "draft-151",
        "taxable": true,
        "vendor": null,
        "variant_title": "151cm",
        "fulfillment_status": null,
        "gift_card": false,
        "fulfillment_service": "manual",
        "fulfillable_quantity": 1,
        "variant_id": 43729076,
        "variant_inventory_management": "shipwire",
        "product_exists": true,
        "tax_lines": [
          {
            "price": "1.34",
            "rate": 0.06,
            "title": "GST"
          }
        ],
        "total_discount": "0.00"
      }
    ],
    "destination": {
      "address1": "123 Amoebobacterieae St",
      "name": "Bob Bobsen",
      "city": "Ottawa",
      "address2": "",
      "address3": null,
      "company_name": "",
      "country": "CA",
      "postal_code": "K2P0V6",
      "phone": "(555)555-5555",
      "fax": null,
      "address_type": null,
      "province": "ON"
    },
    "origin": {
      "address1": "190 MacLaren Street",
      "name": null,
      "city": "Ottawa",
      "address2": null,
      "address3": null,
      "company_name": "Cadetgear",
      "country": "CA",
      "postal_code": "K2P 0L6",
      "phone": null,
      "fax": null,
      "address_type": null,
      "province": "ON"
    },
    "currency": "USD",
    "locale": "en"
  }
}

Carrier Services can use this information to serve rate titles in the customer's native language.

As always, please comment in this thread if you have any questions or concerns!

i
Replies
Posts:
21
July 21, 2017

Hi Jamie,

This is great news! I see in your example that you have included some extra parameters for the items, are these going to be included too? At the moment i can see the new 'locale' parameter but not the additional ones on the items, i think the ones on the items will be especially beneficial for merchants looking to create advanced shipping logic via the carrier shipping API.

Thanks!

Min

Posts:
195
August 01, 2017
g
1
upvotes

Hello Jamie.

 

Thanks for adding this. Any additional info added to Carrier service calls is welcomed.

For me, I really need coupon and/or order/cart information sent in the Carrier request so that I can provide better logic when returning free shipping options.

The main thing I'm really looking for is coupon info, but you guys might as well return the full cart/order so that devs can use more complex logic and returning shipping rates based off what the customer is purchasing.

 

Here's my old thread on that:

https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/carrierservice-api-access-to-coupon-discount-information-331288

Posts:
195
Last edited August 19, 2017
g
2
upvotes

Any feedback on this Jamie? It would be super helpful if Shopify could pass along more order data to these endpoints, like DISCOUNTS/Coupons so that merchants can create more advanced logic in their carrierServices.

 

Also I would suggest updating the carrierService documentation to reflect this change here:
https://help.shopify.com/api/reference/carrierservice

Jesper Madsen Member
Posts:
3
August 22, 2017

Hi Jamie,

This is great news :-)

How ever, as Jordan is writing, total order value or discount value is critical.

We have a lot of merchants complaining that they calculate free shipping from e.g. 100 USD in order value, but the API does not take coupon codes into account, so merchants are giving free shipping away if customers buys products for 100 USD and apply a discount of 10% e.g. ... This is a dealbreaker for a lot of merchants...

Jesper Madsen, Shopify App Developer, Shoptigrator IVS