XeroAPI / Xero-OpenAPI

An OpenAPI description of the Xero API

Home Page:https://developer.xero.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this properly typed for is-money vendor ext?

SerKnight opened this issue · comments

Hi @jenksguo - wondering if this field should be typed as is-money. Currently rolling into ruby for the money types to have proper BigDecimal format, but this seems like it should just be: type: number format: double

        Quantity:
          description: LineItem Quantity
          type: number
          format: double
          x-is-money: true

For reference, this is the full list of ( minus six that I could not find), for all the fields that have the x-is-money tag

SubTotal: Total of bank transaction excluding taxes
SubTotal: The subtotal of the credit note excluding taxes
SubTotal: Total of invoice excluding taxes
SubTotal: The subtotal of the overpayment excluding taxes
SubTotal: The subtotal of the prepayment excluding taxes
SubTotal: Total of purchase order excluding taxes
SubTotal: Total of quote excluding taxes.
SubTotal: Total of receipt excluding taxes
SubTotal: Total of invoice excluding taxes
Total: Total of bank transaction tax inclusive
Total: The total of the Credit Note(subtotal + total tax)
Total: The total of an expense claim being paid
Total: Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts
Total: The total of the overpayment (subtotal + total tax)
Total: The total of the prepayment(subtotal + total tax)
Total: Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax)
Total: Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts
Total: Total of receipt tax inclusive (i.e. SubTotal + TotalTax)
Total: Total of Invoice tax inclusive (i.e. SubTotal + TotalTax)
TotalTax: Total tax on bank transaction
TotalTax: The total tax on the credit note
TotalTax: Total tax on invoice
TotalTax: The total tax on the overpayment
TotalTax: The total tax on the prepayment
TotalTax: Total tax on purchase order
TotalTax: Total tax on quote
TotalTax: Total tax on receipt
TotalTax: Total tax on invoice
Quantity: LineItem Quantity
TaxAmount: The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if
TaxAmount: Total tax on a journal line
TaxAmount: The calculated tax amount based on the TaxType and LineAmount
UnitAmount: LineItem Unit Amount
Amount: 'amount of the transaction'
Amount: The amount of the payment. Must be less than or equal to the
Amount: the amount being applied to the invoice
Amount: The amount of the payment. Must be less than or equal to the
DiscountAmount: Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.
NetAmount: Net amount of journal line. This will be a positive value for a debit and negative for a credit
GrossAmount: Gross amount of journal line (NetAmount + TaxAmount).
LineAmount: 'total for line. Debits are positive, credits are negative value'
DiscountRate: Percentage discount being applied to a line item (only supported on  ACCREC invoices – ACC PAY invoices and credit notes in Xero do not
Discount: The default discount rate for the contact (read only)
CurrencyRate: The currency rate
CurrencyRate: The currency rate for a multicurrency invoice. If no rate is
CurrencyRate: The currency rate for a multicurrency invoice. If no rate is
CurrencyRate: The currency rate for a multicurrency overpayment. If no rate is
CurrencyRate: Exchange rate when payment is received. Only used for non base
CurrencyRate: The currency rate for a multicurrency prepayment. If no rate is
CurrencyRate: The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used.
RemainingCredit: The remaining credit balance on the Credit Note
RemainingCredit: The remaining credit balance on the overpayment
RemainingCredit: The remaining credit balance on the prepayment
AmountDue: The amount due to be paid for an expense claim
AmountDue: Amount remaining to be paid on invoice
CISDeduction: CIS deduction for UK contractors
TotalDiscount: Total of discounts applied on the invoice line items
TotalDiscount: Total of discounts applied on the purchase order line items
TotalDiscount: Total of discounts applied on the quote line items
AmountPaid: The amount still to pay for an expense claim
AmountPaid: Sum of payments received for invoice
AmountCredited: Sum of all credit notes, over-payments and pre-payments applied to
TotalCostPool: The value of the item on hand. Calculated using average cost
QuantityOnHand: The quantity of the item on hand
UnitPrice: Unit Price of the item. By default UnitPrice is rounded to two
Box1: Box 1 on 1099 Form
Box2: Box 2 on 1099 Form
Box3: Box 3 on 1099 Form
Box4: Box 4 on 1099 Form
Box5: Box 5 on 1099 Form
Box6: Box 6 on 1099 Form
Box7: Box 7 on 1099 Form
Box8: Box 8 on 1099 Form
Box9: Box 9 on 1099 Form
Box10: Box 10 on 1099 Form
Box11: Box 11 on 1099 Form
Box13: Box 13 on 1099 Form
Box14: Box 14 on 1099 Form
DisplayTaxRate: Tax Rate (decimal to 4dp) e.g 12.5000
EffectiveRate: Effective Tax Rate (decimal to 4dp) e.g 12.5000
Rate: Tax Rate (up to 4dp)

@SerKnight is-money should be, the monetary values and any values that is used for calculating money transactions. My understanding is high decimal and normal float in math calculation will reduce the resolution of the numbers, hence the large set of the is-money label.

Closed issue & PR, explanation in #260

While 1-2 fields related to quantity are not technically money, they do require on the same granularity of rounding that this x-tag was implemented for.