younifyd
Menu

createCreditMemoItem

Creates a 'Credit memo item'.

Use it in a workflow

  1. Add a step and choose the Fluent Commerce connector.
  2. Pick the createCreditMemoItem action (under Create).
  3. Fill in the fields below, then reference the result from later steps as {{createcreditmemoitem.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 CreateCreditMemoItem($input: CreateCreditMemoItemInput) {
  createCreditMemoItem(input: $input) {
    amount {
      amount
      scale
      unscaledValue
    }
    createdOn
    creditMemo {
      attributes {
        name
        type
        value
      }
      billingAccount {
        address
        attributes
        createdOn
        customer
        id
        name
        ref
        retailer
        status
        type
        updatedOn
        workflow
        workflowRef
        workflowVersion
      }
      createdOn
      currency {
        alphabeticCode
      }
      defaultTaxType {
        country
        group
        tariff
      }
      id
      invoice {
        attributes
        billingAccount
        createdOn
        creditMemos
        currency
        defaultTaxType
        dueDate
        fulfilment
        id
        issueDate
        order
        ref
        status
        subTotalAmount
        totalAmount
        totalBalance
        totalTax
        type
        updatedOn
        workflow
        workflowRef
        workflowVersion
      }
      issueDate
      order {
        ref
        retailer
      }
      ref
      returnOrder {
        ref
        retailer
      }
      status
      subTotalAmount {
        amount
        scale
        unscaledValue
      }
      totalAmount {
        amount
        scale
        unscaledValue
      }
      totalBalance {
        amount
        scale
        unscaledValue
      }
      totalTax {
        amount
        scale
        unscaledValue
      }
      type
      updatedOn
      workflow {
        ref
        version
      }
      workflowRef
      workflowVersion
    }
    creditReasonCode {
      label
      value
    }
    description
    id
    orderItem {
      order {
        ref
        retailer
      }
      ref
    }
    product {
      catalogue {
        ref
      }
      ref
    }
    ref
    returnOrderItem {
      ref
      returnOrder {
        ref
        retailer
      }
    }
    taxAmount {
      amount
      scale
      unscaledValue
    }
    type
    unitAmount {
      amount
      scale
      unscaledValue
    }
    unitCostAmount {
      amount
      scale
      unscaledValue
    }
    unitQuantity {
      quantity
      unit
    }
    unitTaxType {
      country
      group
      tariff
    }
    updatedOn
  }
}

Variables

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

inputobject
amountobjectrequired3 fields
creditMemoobjectrequired1 fields
creditReasonCodeobject2 fields
descriptionstring
orderItemobject2 fields
productobject2 fields
refstringrequired
returnOrderItemobject2 fields
taxAmountobjectrequired3 fields
typestringrequired
unitAmountobjectrequired3 fields
unitCostAmountobject3 fields
unitQuantityobjectrequired2 fields
unitTaxTypeobject3 fields
json
{
  "input": {
    "amount": {
      "amount": 0,
      "scale": 0,
      "unscaledValue": 0
    },
    "creditMemo": {
      "ref": "string"
    },
    "ref": "string",
    "taxAmount": {
      "amount": 0,
      "scale": 0,
      "unscaledValue": 0
    },
    "type": "string",
    "unitAmount": {
      "amount": 0,
      "scale": 0,
      "unscaledValue": 0
    },
    "unitQuantity": {
      "quantity": 0,
      "unit": "string"
    },
    "creditReasonCode": {
      "value": "string",
      "label": "string"
    },
    "description": "string",
    "orderItem": {
      "order": {
        "ref": "string",
        "retailer": "string"
      },
      "ref": "string"
    },
    "product": {
      "catalogue": {
        "ref": "string"
      },
      "ref": "string"
    },
    "returnOrderItem": {
      "ref": "string",
      "returnOrder": {
        "ref": "string",
        "retailer": "string"
      }
    }
  }
}

Response

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

amountobject
amountnumber
scalenumber
unscaledValuenumber
createdOnstring
creditMemoobject
attributesarray<object>
billingAccountobject14 fields
createdOnstring
currencyobject1 fields
defaultTaxTypeobject3 fields
idstring
invoiceobject22 fields
issueDatestring
orderobject2 fields
refstring
returnOrderobject2 fields
statusstring
subTotalAmountobject3 fields
totalAmountobject3 fields
totalBalanceobject3 fields
totalTaxobject3 fields
typestring
updatedOnstring
workflowobject2 fields
workflowRefstring
workflowVersionstring
creditReasonCodeobject
labelstring
valuestring
descriptionstring
idstring
orderItemobject
orderobject2 fields
refstring
productobject
catalogueobject1 fields
refstring
refstring
returnOrderItemobject
refstring
returnOrderobject2 fields
taxAmountobject
amountnumber
scalenumber
unscaledValuenumber
typestring
unitAmountobject
amountnumber
scalenumber
unscaledValuenumber
unitCostAmountobject
amountnumber
scalenumber
unscaledValuenumber
unitQuantityobject
quantitynumber
unitstring
unitTaxTypeobject
countrystring
groupstring
tariffstring
updatedOnstring

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