Carrier service rates not working for App Shipping Profiles - DeliveryProfile Api

Devven
Excursionist
18 1 1

We are using the delivery profiles api with graphql to automatically create a shipping profile upon adding our app but carrier rates are not working at checkout for app shipping profiles using a carrier service rates provided by app

 

Any Shopify developer or guru know how to fix this issue?

0 Likes
_JCC_
Shopify Staff
Shopify Staff
66 10 9

@Devven ,

Happy to help you out with this issue. Looking at the store in the screenshots referenced I believe the issue is in how the delivery profile is created. In particular it's in the specification of the participant of the methodDefinitionsToCreate that needs to be tweaked.

When defining the participant of the method definitions you have the option to set the participants' adaptToNewServices, and or also specify the participantServices (which are the names of the services returned from your carrier service endpoint).

If you leave adaptToNewServices as false, you'll want to delineate the participant services available like so:

 

{
	"profile": {
		"name": "test-shipping-profile",
		"locationGroupsToCreate": [
			{
				"locations": [
					"gid://shopify/Location/somelocationid"
				],
				"zonesToCreate": [
					{
						"name": "Canada",
						"countries": [
							{
								"code": "CA",
								"includeAllProvinces": true
							}
						],
						"methodDefinitionsToCreate": [
							{
								"active": true,
								"name": "example-shipping-profile-canada-cs",
								"description": "testing carrier service rate retrieval",
								"participant": {
									"adaptToNewServices": false,
									"carrierServiceId": "gid://shopify/DeliveryCarrierService/someid",
									"participantServices": [
										{
											"active": true,
											"name": "name of service"
										}
									]
								}
							}
						]
					}
				]
			}
		]
	}
}

 

With adaptToNewServices false, and no participantServices specified, even though your carrier service endpoint returned rates, Shopify want find any supported services.

Setting adaptToNewServices to true, with no participantServices specified will tell Shopify any rate you return from the carrier service endpoint should be offered to the customer in checkout.

I hope this helps clarify things, if you any other questions let me know.

Regards,

John

John C | Developer Support @ 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

0 Likes