Retrieving Shipping Rates

Hi,

i have integrated a 3rd party fedex carrier service. what i need is to display the estimated shipping costs / delivery costs. Before i do an order fulfilment or payment.

i have tried multiple multiple methods. but failed. The only smooth sailing integration was making use of GraphQL queries as such:

mutation cartCreate($input: CartInput!) {
      cartCreate(input: $input) {
        cart {
          id
          createdAt
          checkoutUrl
          lines(first: 10) {
            edges {
              node {
                id
                quantity
                merchandise {
                  ... on ProductVariant {
                    id
                  }
                }
              }
            }
          }
        }
        userErrors {
          field
          message
        }
      }
    }

and subsequently call this:

mutation cartDeliveryAddressesAdd($cartId: ID!, $addresses: [CartSelectableAddressInput!]!) {
      cartDeliveryAddressesAdd(cartId: $cartId, addresses: $addresses) {
        cart {
          id
          deliveryGroups(first: 10) {
            edges {
              node {
                id
                groupType
                deliveryOptions {
                  code
                  title
                  handle
                  deliveryMethodType
                  description
                  estimatedCost {
                    amount
                    currencyCode
                  }
                }
              }
            }
          }
        }
        userErrors {
          field
          message
        }
        warnings {
          code
          message
        }
      }
    }

However, the deliveryGroup returns an empty entry. there’s no price etc.
I just want to pass in my products the person is buying and get my estimated delivery costs.
Really appreciate if someone point me a detailed implementation. Thank you because this is getting really confusing and frustrating.

1 Like

Hi @gamesandgifts
you want to display estimates in front-end? And did you created API for graphql queries?