Solved

Checkout object returns null for certain fields even though webUrl has information

sam-parks
Tourist
7 0 1

After using the checkoutShippingLineUpdate mutation or the appendGiftCardMutation, the checkout object returned from this mutation: 

query($id: ID!){
  node(id: $id) {
    ... on Checkout {
      id
      email
      appliedGiftCards {
        amountUsedV2 {
          amount
          currencyCode
        }
        balanceV2 {
          amount
          currencyCode
        }
        id
      }
      requiresShipping
      shippingLine {
        handle
        priceV2 {
          amount
          currencyCode
        }
        title
      }
      availableShippingRates {
        ready
        shippingRates {
          handle
          title
          priceV2 {
            amount
            currencyCode
          }
        }
      }
      shippingAddress {
        address1
        address2
        city
        company
        country
        countryCodeV2
        firstName
        formattedArea
        id
        lastName
        latitude
        longitude
        name
        phone
        province
        provinceCode
        zip
      }
      completedAt
      createdAt
      currencyCode
      lineItems(first: 10) {
        edges {
          node {
            id
            quantity
            title
            discountAllocations {
              allocatedAmount {
                amount
                currencyCode
              }
            }
            variant {
              id
              priceV2 {
                amount
                currencyCode
              }
              title
              image {
                altText
                originalSrc
                id
              }
              compareAtPriceV2 {
                amount
                currencyCode
              }
              weight
              weightUnit
              availableForSale
              sku
              requiresShipping
            }
          }
        }
      }
      note
      webUrl
      updatedAt
      totalTaxV2 {
        amount
        currencyCode
      }
      totalPriceV2 {
        amount
        currencyCode
      }
      taxesIncluded
      taxExempt
      subtotalPriceV2 {
        amount
        currencyCode
      }
      orderStatusUrl
      order {
        id
      }
    }
  }
}

 

does not have any applied gift cards and the shipping line is null

When I navigate to the weburl for this checkout, I can see that the gift cards have been applied and that a shipping line is selected.

Why does the checkout object not have the information for these corresponding fields?

 

 

Accepted Solution (1)
_JCC_
Shopify Staff
200 27 55

This is an accepted solution.

Hey @sam-parks ,

In our logs I'm not seeing a subsequent query for the checkout after the checkoutShippingLineUpdate. For the checkout id provided I am seeing the query happening after an address update which does reset the shipping line to null.

If you take the checkout id provided in your earlier reply and just try that query with Insomnia or Postman do you see same where the shipping line is still null?

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

View solution in original post

Replies 10 (10)