AccountRight API - Creating Invoice with Voucher as a line item

2 REPLIES
jevatsas
4 Posts
User
Australia
jevatsas

4Posts

1Kudos

0Solutions

Re: AccountRight API - Creating Invoice with Voucher as a line item

Thanks a lot! Having quantity: -1 and total: -25 works.

Ultimate Partner Mike_James
3,495 Posts
Ultimate Partner
New Zealand
Mike_James
Ultimate Partner

3495Posts

1311Kudos

421Solutions

Accepted Solution Solved Solution

Re: AccountRight API - Creating Invoice with Voucher as a line item

Hi @jevatsas, have you tried making both the qty and total negative?


Regards, Mike (mike@datawise.co.nz)
DataWise Limited (www.datawise.co.nz), developers of:
DataWise Report Writer - Custom Reporting from MYOB programs
(Including AccountRight Classic/Live, and exo Payroll)

Highlighted
jevatsas
4 Posts
User
Australia
jevatsas

4Posts

1Kudos

0Solutions

Solved: Go to Solution

AccountRight API - Creating Invoice with Voucher as a line item

Please exlain how can we add a voucher to the Invoice using API?

 

The example below demonstrates how we try to submit a voucher item that should reduce total cost by $25.27:

 

[ { ShipQuantity: 1,
    Description: 'Item Descr',
    Total: '79.95',
    TaxCode: { UID: 'b0a0bf61-648b-4c56-bb7b-ea01ee6ac19c' },
    Item: { UID: '3b225320-4e01-4e54-ad6a-99b096fc1400' } },
  { ShipQuantity: 1,
    Description: 'Item Descr',
    Total: '84.95',
    TaxCode: { UID: 'b0a0bf61-648b-4c56-bb7b-ea01ee6ac19c' },
    Item: { UID: '3b225320-4e01-4e54-ad6a-99b096fc1400' } },
  { ShipQuantity: -1,
    Total: 25.27,
    TaxCode: { UID: 'b0a0bf61-648b-4c56-bb7b-ea01ee6ac19c' },
    Item: { UID: '16d7cdeb-d34e-45bd-8d9f-a91a045286d7' } } ]

When we try to POST this as a new invoice the next error is returned:

 

[ { Name: 'ValidationError',
    Message: 'CommonRules_DecimalMinValue',
    AdditionalDetails: 'UnitAmountSmiley SadSaleEventItemLine)',
    ErrorCode: 1007,
    Severity: 'Error' } ]

If I put item quantity to "1" instead of "-1" - invoice is created, but then this item becomes an opposite of the voucher by increasing total cost by $25 instead of reducing.

 

 

I've also tried sending this voucher as quantity "1" and total "-25": MYOB API returns with the exactly same error message.

 

AccountRight API v2 is being used.

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post