Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

how can I add a company as a logistics and delivery provider for my shop?

how can I add a company as a logistics and delivery provider for my shop?

bimingda
Shopify Partner
4 0 0

what I want to do?

 I want to  add a company as a logistics and delivery provider such as UPS for my shop, this company is my delivery provider.

 

my problem is :

I add a custom app for my shop. and the app  register a carrier service  to shopify successfully, the company name is "my carrier service", but I can't find it in the shipping carrier list company list(as blow).
(the app got the access scope "shipping"
 )

thank you!

bimingda_0-1719912677453.png

 

 

my code is like this:

 

public CarrierServiceBo createCarrierService(String name, String callBackUrl) throws IOException {
        String url = String.format(carrierServiceUrl, devStoreNo);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type","application/json");
        headers.put("X-Shopify-Access-Token", token);

        CarrierServiceCreateReq carrierServiceCreateReq = new CarrierServiceCreateReq();
        carrierServiceCreateReq.getCarrier_service().setName(name);
        carrierServiceCreateReq.getCarrier_service().setCallback_url(callBackUrl);

        HttpClientResult clientResult = HttpClientUtil.post(url, GSON.toJson(carrierServiceCreateReq), "application/json", headers);
        log.info("response: {}", GSON.toJson(clientResult));
        if (clientResult.getCode() != 201) {
            return null;
        }

        String content = clientResult.getContent();
        CarrierServiceBoRoot carrierServiceBoRoot = GSON.fromJson(content, CarrierServiceBoRoot.class);

        return carrierServiceBoRoot.getCarrier_service();
    }
Replies 3 (3)

Liam
Community Manager
3108 344 889

Hi Bimingda

 

Where exactly are you setting the company name as "my carrier service"?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

bimingda
Shopify Partner
4 0 0

Dear @Liam, thanks for your reply.

the name "my carrier service" is set out the function createCarrierService like this.

 

 

CarrierServiceBo carrierServiceBo = carrierServiceBiz.createCarrierService("my carrier service", callBackUrl);

 

 

 

Have a nice day!

TrackingMore_
Tourist
49 0 2

hi @bimingda 

 

I've answered the same question here, you can have a look: https://community.shopify.com/c/shopify-apps/how-can-i-add-a-company-as-a-logistics-and-delivery-pro...

 

Hope this helps you😀

Seamless and effortless parcel tracking at your fingertips.
The ultimate all-in-one shipment tracking app. Easily integrates with your store and drives repeat sales.
Official Website I TrackingMore Shopify App