younifyd
Menu

paymentTermsCreate

Create payment terms on an order. To create payment terms on a draft order, use a draft order mutation and include the request with the DraftOrderInput.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the paymentTermsCreate action (under Payment).
  3. Fill in the fields below, then reference the result from later steps as {{paymenttermscreate.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 PaymentTermsCreate($referenceId: ID!, $paymentTermsAttributes: PaymentTermsCreateInput!) {
  paymentTermsCreate(
    referenceId: $referenceId
    paymentTermsAttributes: $paymentTermsAttributes
  ) {
    paymentTerms {
      draftOrder {
        acceptAutomaticDiscounts
        allVariantPricesOverridden
        allowDiscountCodesInCheckout
        amountDueLaterSet
        amountDueNowSet
        anyVariantPricesOverridden
        appliedDiscount
        billingAddress
        billingAddressMatchesShippingAddress
        completedAt
        createdAt
        currencyCode
        customAttributes
        customer
        defaultCursor
        deposit
        discountCodes
        email
        hasTimelineComment
        id
        invoiceEmailTemplateSubject
        invoiceSentAt
        invoiceUrl
        legacyResourceId
        lineItemsSubtotalPrice
        marketName
        marketRegionCountryCode
        name
        note2
        order
        paymentTerms
        phone
        platformDiscounts
        poNumber
        presentmentCurrencyCode
        purchasingEntity
        ready
        reserveInventoryUntil
        shippingAddress
        shippingLine
        status
        subtotalPrice
        subtotalPriceSet
        tags
        taxExempt
        taxLines
        taxesIncluded
        totalDiscountsSet
        totalLineItemsPriceSet
        totalPrice
        totalPriceSet
        totalQuantityOfLineItems
        totalShippingPrice
        totalShippingPriceSet
        totalTax
        totalTaxSet
        totalWeight
        transformerFingerprint
        updatedAt
        visibleToCustomer
        warnings
      }
      due
      dueInDays
      id
      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
      }
      overdue
      paymentTermsName
      paymentTermsType
      translatedName
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

referenceIdstringrequired

Specifies the reference orderId to add the payment terms for.

paymentTermsAttributesobjectrequired

The attributes used to create the payment terms.

paymentTermsTemplateIdstringrequired
paymentSchedulesarray<object>2 fields
json
{
  "referenceId": "string",
  "paymentTermsAttributes": {
    "paymentTermsTemplateId": "string",
    "paymentSchedules": [
      {
        "issuedAt": "string",
        "dueAt": "string"
      }
    ]
  }
}

Response

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

paymentTermsobject
draftOrderobject40 fields
dueboolean
dueInDaysnumber
idstring
orderobject40 fields
overdueboolean
paymentTermsNamestring
paymentTermsTypestring

One ofRECEIPTNETFIXEDFULFILLMENTUNKNOWN

translatedNamestring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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