younifyd
Menu

returnRequest

Creates a return request that requires merchant approval before processing. The return has its status set to REQUESTED and the merchant must approve or decline it.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the returnRequest action (under Return).
  3. Fill in the fields below, then reference the result from later steps as {{returnrequest.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation ReturnRequest($input: ReturnRequestInput!) {
  returnRequest(input: $input) {
    return {
      closedAt
      createdAt
      decline {
        note
        reason
      }
      id
      name
      order {
        additionalFees
        alerts
        app
        attribution
        billingAddress
        billingAddressMatchesShippingAddress
        canMarkAsPaid
        canNotifyCustomer
        cancelReason
        cancellation
        cancelledAt
        capturable
        cartDiscountAmount
        cartDiscountAmountSet
        cartToken
        channel
        channelInformation
        checkoutToken
        clientIp
        closed
        closedAt
        confirmationNumber
        confirmed
        createdAt
        currencyCode
        currentCartDiscountAmountSet
        currentShippingPriceSet
        currentSubtotalLineItemsQuantity
        currentSubtotalPriceSet
        currentTaxLines
        currentTotalAdditionalFeesSet
        currentTotalDiscountsSet
        currentTotalDutiesSet
        currentTotalPriceSet
        currentTotalTaxSet
        currentTotalWeight
        customAttributes
        customer
        customerAcceptsMarketing
        customerJourney
        customerJourneySummary
        customerLocale
        discountCode
        discountCodes
        displayAddress
        displayFinancialStatus
        displayFulfillmentStatus
        disputes
        dutiesIncluded
        edited
        email
        estimatedTaxes
        fulfillable
        fulfillmentsCount
        fullyPaid
        hasTimelineComment
        id
        landingPageDisplayText
        landingPageUrl
        legacyResourceId
        merchantBusinessEntity
        merchantEditable
        merchantEditableErrors
        merchantOfRecordApp
        name
        netPayment
        netPaymentSet
        note
        number
        originalTotalAdditionalFeesSet
        originalTotalDutiesSet
        originalTotalPriceSet
        paymentCollectionDetails
        paymentGatewayNames
        paymentTerms
        phone
        physicalLocation
        poNumber
        presentmentCurrencyCode
        processedAt
        productNetwork
        publication
        purchasingEntity
        referralCode
        referrerDisplayText
        referrerUrl
        refundDiscrepancySet
        refundable
        registeredSourceUrl
        requiresShipping
        restockable
        retailLocation
        returnStatus
        risk
        riskLevel
        shippingAddress
        shippingLine
        shopifyProtect
        sourceIdentifier
        sourceName
        staffMember
        subtotalLineItemsQuantity
        subtotalPrice
        subtotalPriceSet
        tags
        taxExempt
        taxLines
        taxesIncluded
        test
        totalCapturable
        totalCapturableSet
        totalCashRoundingAdjustment
        totalDiscounts
        totalDiscountsSet
        totalOutstandingSet
        totalPrice
        totalPriceSet
        totalReceived
        totalReceivedSet
        totalRefunded
        totalRefundedSet
        totalRefundedShippingSet
        totalShippingPrice
        totalShippingPriceSet
        totalTax
        totalTaxSet
        totalTipReceived
        totalTipReceivedSet
        totalWeight
        transactionsCount
        unpaid
        updatedAt
      }
      requestApprovedAt
      returnShippingFees {
        amountSet
        id
      }
      staffMember {
        accountType
        active
        email
        exists
        firstName
        id
        initials
        isShopOwner
        lastName
        locale
        name
        phone
        privateData
      }
      status
      totalQuantity
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

inputobjectrequired

The input fields for requesting a return.

orderIdstringrequired
returnLineItemsarray<object>required6 fields
returnShippingFeeobject1 fields
json
{
  "input": {
    "orderId": "string",
    "returnLineItems": [
      {
        "fulfillmentLineItemId": "string",
        "quantity": "string",
        "restockingFee": "string",
        "returnReason": "string",
        "returnReasonDefinitionId": "string",
        "customerNote": "string"
      }
    ],
    "returnShippingFee": {
      "amount": {
        "amount": "string",
        "currencyCode": "string"
      }
    }
  }
}

Response

Read the result with {{returnrequest.response.data.data.returnRequest}}. If the API returns errors, the step fails and they are at {{returnrequest.response.data.errors}}.

returnobject
closedAtstring
createdAtstring
declineobject2 fields
idstring
namestring
orderobject40 fields
requestApprovedAtstring
returnShippingFeesarray<object>
staffMemberobject13 fields
statusstring

One ofCANCELEDCLOSEDOPENREQUESTEDDECLINED

totalQuantitynumber
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.