Carrier Service API

Ruchi2
Shopify Partner
27 0 0

I have created a shipping service using shopify's carrier service API. I am getting rates on the checkout pages. But for some of the case, rates are not appearing. I am unable to to track why its happening. How can i access the error logs generated by shopify while calling my rates endpoint. How can i test this endpoint?

0 Likes
Plum_Tree_Group
Tourist
18 0 2

We are trying to do the same. Please can you advice how did you intregrate your custom carrier service url into checkout? i.e where do you define in shopify your url?

Thanks

0 Likes
HunkyBill
Shopify Expert
4374 36 468

How do you know a rate not showing is not your error? If you can generate a checkout where the rate you generate is legit and returned, but then not displayed by Shopify, you've stumbled across something alright, but otherwise, are you sure you're not:

  • late in returning an answer ie) slow
  • burning out on an error in your App

In my experience with that API, almost all complaints of no rates are due to those. The other problems were due to misconfigured servers. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Plum_Tree_Group
Tourist
18 0 2

Hey Ruchi - 

 

Did you use PHP as your library? We are not able to register the service. Can you share how did you do?

0 Likes
Ruchi2
Shopify Partner
27 0 0

Hi
Yes, I am using PHP library to register carrier service with the shopify store. I am using this library. and the code for the registering the carrier service is as follow.

$carrier_service = $shopify('POST /admin/carrier_services.json', array(), array
  (
     'carrier_service' => array
        (
      "name" => $service_name,
       "callback_url" => $clburl,
      "format" => "json",
      "service_discovery" => "true"
      )
      ));

 

I hope this helps you. If not, Make sure that the scope of your app are proper i.e it includes registring carrier service or the store on which you are trying to register the service has carrier service enabled. Check shopify plans for this.

0 Likes
seema4
Shopify Partner
1 0 0

Hello

Can you please help me out .I have to change the order payment status through ajax . In frontend i have create a from where i have inserted order id, status and i have to update that in back end order section with changed status and can you please help me how to work with php in shopify .
Please reply as ASAP .

Thanks

0 Likes
Ruchi2
Shopify Partner
27 0 0

You can create a private app for your store and an endpoint which accepts the order id and current status and requested status. In your ajax make an authenticated call to this endpoint and update the order status. Hope you get an idea.

0 Likes
Plum_Tree_Group
Tourist
18 0 2

Hi Ruchi 

 

Thanks so much. This worked. Couple of more more questions I have -

 

1. How did you get the request sent by shopify to your carrier service url? I tried $_POST but that did not work.

 

2. How did you sent Shopify back your custom rates? 

 

Thanks again.

0 Likes
Plum_Tree_Group
Tourist
18 0 2

Hi Ruchi - 

 

Any more thoughts on the above? 

0 Likes
Ruchi2
Shopify Partner
27 0 0

You can get the shopify data using the below line:
$postData = file_get_contents('php://input');

 

And try using the response specified here

https://docs.shopify.com/api/carrierservice

0 Likes