Hi, I’m using the paid plans subscriptions for my visitors and once the plan is purchased, I want to send an invoice. A simple invoice get created & send to the subscriber successfully.
But as it’s necessary for few countries to add the customer tax details & address. So, I tried to update the created invoice in the events.js file.
But this showing me an error:
{“message”:“{"message":"balance USD -1.00 must be non negative","details":{}}”}
Then I tried to create an invoice, still the same issue. This error is captured by the .catch method.
After the issue, I even try the only sample code of Velo Reference & just changed the invoice id with my Invoice. Then also getting the issue.
I would like to know:
- Is this possible to add the customer tax info & address to the invoice by code?
- I would like to know the reason for the error.
Thanks for you time in advance. Looking forward to the responses.
Regards,
Rajjat Garg
For that error, do you know where the -1.00 is coming from?
That’s the point. Because I didn’t have any thing like this in the whole object. The field with the name balance I checked have value 0. I’ve add the whole object below for the reference just remove customer info & replace the ID details with some random text.
{
"title": "App02 Pro",
"currency": "USD",
"lineItems": [
{
"id": "Some ID",
"name": "App02 Pro",
"price": 20,
"quantity": 1,
"taxes": []
}
],
"locale": {
"language": "en"
},
"payments": [
{
"id": "Some ID",
"type": "",
"amount": 21,
"date": "2022-03-31T11:01:52.361Z"
}
],
"totals": {
"discountAmount": null,
"taxedAmount": 1,
"fees": [],
"subtotal": 20,
"total": 21
},
"dynamicTotals": {
"balance": 0,
"paidAmount": 21
},
"taxes": [
{
"name": "Sales Tax",
"rate": 5,
"taxable": 20,
"taxed": 1
}
],
"metadata": {
"notes": "Notes by",
"source": "ID",
"sourceRefId": "ID"
},
"dates": {
"issueDate": "2022-03-31T11:01:52.129Z",
"dueDate": "2022-03-31T11:01:52.129Z",
"lastSeenDate": "2022-03-31T11:46:43.708Z"
}
}
Okay, I will need to ask around about this one. In the meantime, you may want to submit this as a bug so customer support can research it too. They may be faster than I am.
How to report a bug
If you are using the bot and trying to get to a person just tell it no when it links you articles (unless the articles do help, but in this case likely not)
I’ve already notified to the customer support team yesterday. I would like to know, should I report this as bug or not because last time I send this to customer support team & they assured me that they have forward this to the relevant team.
@wix-expert-velo-cert Did they give you a ticket or something that I can follow up on? And, I’m not sure if it’s a bug or not yet hence the suggestion.
@amandam Here is the Request no. - 1363698185
@wix-expert-velo-cert Thank you. I will follow up with you when I have more information but it may not be until next week due to time zones and it being Friday.
@amandam I can understand about the time. Thanks for looking into this. Hope to hearing something positive from you soon.
But till then, can you please let me know that, Is this possible to add the customer tax info & address to the invoice by code?
I have not completed this personally but in looking at the API, there is an updateInvoice() function and under Customer there are address fields and under line items, I see taxes. Take a look and let me know if you think this is what you are looking for
API docs updateInvoice()
Ok, I can understand. I’ve gone through this but getting an error. That’s why not sure whether it’s possible or not. I will wait for the update on the error to get the final answer to this.
Thanks for your help. Have a great day ahead! 