update invoice
I am trying to update (PUT method) an invoice from MAKE to WildApricot. So I created a google sheet with invoice Id listed and a Memo that I'd like to put on any invoices that are in my spreadsheet. Using the "Make an API Call" module in Make, I can do a GET, but cannot get the PUT to work at all.
Any help on getting the PUT method to work would be greatly appreciated.
Here is the Bundle Content for GET method that works:
[
{
"qs": [],
"url": "/accounts/54321/invoices/424242442",
"body": null,
"method": "GET"
}
]
For the PUT, I don't know how to reference the data I want to update, I thought it would be similar to above, but the info to update in the body, like memo: this is a memo. But that does not work.
Thank you.
-
Tracy R commented
I just accomplished a similar idea. I was struggling with creating the Array of Collections to get multiple line items into the invoice. Here is how I made it work...
URL: /accounts/{{1.Id}}/invoices/{{6.Id}}
where {{1.Id}} is coming from the WA Get Account Details module and {{6.Id}} is coming from the WA Create Invoice module (or the Google Sheet in your case)
Method: PUT
Query String: leave blank
Body:
{
"DocumentDate": "{{now}}",
"OrderDetails": [{{33.text}}],
"Memo": "this is the Internal Notes",
"PublicMemo": "this is the Comments for payer",
"Id": {{6.Id}}
}A few notes...
* Only include the things you want to change in the body.
* You MUST have the final Id entry in the body. This is the invoice Id. Even though it is part of the URL, it still needs to be included in the body.
Here's a picture of my Make and API Call module to help you. Note that I do not actually update the Memo and PublicMemo in my module, but I included them above because you mentioned Memo in your question.
Good luck! It's not easy with such limited documentation and examples. -
Tim Daniel commented
If you look at the API documentation you can see the data structure you need. Clicking the word "Model" beside "Example Value" gives you a bit more information about what information needs to be stored in each element of the associative array. Aside from that, given the lack of detailed documentation on the API with examples, it is a matter of experimentation.