Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How to use the carrier API for a Shopify app development?

How to use the carrier API for a Shopify app development?

jayreigning
Shopify Partner
1 0 0

Hello Guys,

I am working on a shipping app for a store(first time developing a Shopify app). I would like to create a carrier service with my endpoint of choice which will return the rate for orders. I have set up the app as per the documentation using the recommended configuration, I have then proceeded to add the following script in app.js

 

 

const shopify = new Shopify({

  shopName: 'example.myshopify.com',

  apiKey: 'xxxxxxxxx0b21fe0b2c6cce561a9', // used client ID from the plugin set up page on the partner

  password: 'xxxxxxxxxxef185ecb5b55a715d96', // Used client secret from the plugin set up page on the partner

  // Or use the access token if using OAuth

  // accessToken: 'your-access-token',

});

 

 




shopify.carrierService.create({   name: 'Aspiring International Shipping',   callback_url: 'https://example.com/api/shopify/int-shipping',   service_discovery: true, });

 

 

Now I can install the app in my store, in development mode but I am not getting the request payload on API endpoint, I am not sure if the carrier service was created and cannot assess if the script ran successfully. I am finding different solutions some involving using Postman but it is not proving successful. Any comment or guidance will be much appreciated

Replies 0 (0)