younifyd
Menu

createInvoiceItem

Creates an 'Invoice item'.

Use it in a workflow

  1. Add a step and choose the Fluent Commerce connector.
  2. Pick the createInvoiceItem action (under Create).
  3. Fill in the fields below, then reference the result from later steps as {{createinvoiceitem.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 CreateInvoiceItem($input: CreateInvoiceItemInput) {
  createInvoiceItem(input: $input) {
    amount {
      amount
      scale
      unscaledValue
    }
    createdOn
    description
    id
    invoice {
      attributes {
        name
        type
        value
      }
      billingAccount {
        address
        attributes
        createdOn
        customer
        id
        name
        ref
        retailer
        status
        type
        updatedOn
        workflow
        workflowRef
        workflowVersion
      }
      createdOn
      creditMemos {
        attributes
        billingAccount
        createdOn
        currency
        defaultTaxType
        id
        invoice
        issueDate
        order
        ref
        returnOrder
        status
        subTotalAmount
        totalAmount
        totalBalance
        totalTax
        type
        updatedOn
        workflow
        workflowRef
        workflowVersion
      }
      currency {
        alphabeticCode
      }
      defaultTaxType {
        country
        group
        tariff
      }
      dueDate
      fulfilment {
        ref
      }
      id
      issueDate
      order {
        ref
        retailer
      }
      ref
      status
      subTotalAmount {
        amount
        scale
        unscaledValue
      }
      totalAmount {
        amount
        scale
        unscaledValue
      }
      totalBalance {
        amount
        scale
        unscaledValue
      }
      totalTax {
        amount
        scale
        unscaledValue
      }
      type
      updatedOn
      workflow {
        ref
        version
      }
      workflowRef
      workflowVersion
    }
    product {
      catalogue {
        ref
      }
      ref
    }
    ref
    taxAmount {
      amount
      scale
      unscaledValue
    }
    type
    unitAmount {
      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
descriptionstring
invoiceobjectrequired1 fields
productobject2 fields
refstringrequired
taxAmountobjectrequired3 fields
typestringrequired
unitAmountobjectrequired3 fields
unitQuantityobjectrequired2 fields
unitTaxTypeobject3 fields
json
{
  "input": {
    "amount": {
      "amount": 0,
      "scale": 0,
      "unscaledValue": 0
    },
    "invoice": {
      "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"
    },
    "description": "string",
    "product": {
      "catalogue": {
        "ref": "string"
      },
      "ref": "string"
    },
    "unitTaxType": {
      "country": "string",
      "group": "string",
      "tariff": "string"
    }
  }
}

Response

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

amountobject
amountnumber
scalenumber
unscaledValuenumber
createdOnstring
descriptionstring
idstring
invoiceobject
attributesarray<object>
billingAccountobject14 fields
createdOnstring
creditMemosarray<object>
currencyobject1 fields
defaultTaxTypeobject3 fields
dueDatestring
fulfilmentobject1 fields
idstring
issueDatestring
orderobject2 fields
refstring
statusstring
subTotalAmountobject3 fields
totalAmountobject3 fields
totalBalanceobject3 fields
totalTaxobject3 fields
typestring
updatedOnstring
workflowobject2 fields
workflowRefstring
workflowVersionnumber
productobject
catalogueobject1 fields
refstring
refstring
taxAmountobject
amountnumber
scalenumber
unscaledValuenumber
typestring
unitAmountobject
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.

Was this page helpful?