Ability to get return information such as return reason via the API

rodschuler
Shopify Partner
4 0 0

Hi,

I am trying to get the return information for orders in Shopify (such as return reason).  I can see the information in the Shopify application and it looks like it retrieves it via GraphQL in the OrderDetailsCards operation.  However, I've looked through the API specifications and I can't find anywhere that the information can be retrieved.  I also cannot use the graphQL being utilized in the OrderDetailsCards query as those fields/objects do not exist in the graphQL endpoint

 

e.g.

query returnQuery($orderId:ID!, $numRows: Int!) {
  order(id: $orderId) {
        id
        returns(first: $numRows) {
          edges {
            node {
              id
              ...returnAttributes
            }
          }
        }
      }
    }
fragment ReturnAttributes on Return {
  id
  name
  isClosed
  returnDeliveries {
    id
    returnLabel {
      id
      draft
      serviceName
      shippingPackage {
        id
        name
        displayDimensions
        __typename
      }
      totalWeight {
        unit
        value
        __typename
      }
      __typename
    }
    returnLabelFile {
      url
      __typename
    }
    trackingInfo {
      carrierName
      number
      url
      displayName
      __typename
    }
    __typename
  }
  returnLineItems(first: 30) {
    edges {
      cursor
      node {
        id
        ...ReturnLineItemAttributes
        __typename
      }
      __typename
    }
    pageInfo {
      hasNextPage
      __typename
    }
    __typename
  }
  reverseFulfillmentOrders(first: 1) {
    edges {
      node {
        id
        assignedLocation {
          id
          name
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
  supportedActions {
    ...SupportedActionsAttributes
    __typename
  }
  __typename
}

fragment ReturnLineItemAttributes on ReturnLineItem {
  id
  withCodeDiscountedTotalPriceSet {
    shopMoney {
      amount
      currencyCode
      __typename
    }
    presentmentMoney {
      amount
      currencyCode
      __typename
    }
    __typename
  }
  quantity
  returnReason
  returnReasonNote
  refundedQuantity
  restockSummaries {
    summaryDisplayInformation
    __typename
  }
  dispositionSummaries {
    summaryDisplayInformation
    __typename
  }
  fulfillmentLineItem {
    id
    lineItem {
      id
      ...LineItemAttributes
      __typename
    }
    __typename
  }
  __typename
}

fragment SupportedActionsAttributes on ReturnSupportedAction {
  action
  title
  externalUrl
  priority
  __typename
}

 

is a snippet of what the query to get the information in Shopify does but it does not appear to be supported in the API?  Is there any way to actually get the return information such as return reason out of Shopify through an API?

Thanks

Rod

Building the next generation of startups.
Replies 0 (0)