patch https://secure.fusebill.com/v1/Invoices
A draft invoice that has not yet been posted and is in status “Ready” can have some modifications applied to it prior to being posted. This can be achieved by using the Patch Draft Invoice call to modify specific elements of the invoice.
Request Parameters
Property | Type | Description | Required |
---|---|---|---|
id | Integer | This is the Fusebill generated ID of the draft invoice you wish to modify. | Yes |
notes | String | Billing agents can write notes on draft invoices. Once posted, the note is final. [Max Length: 500 characters] | Optional |
netTermsSet | Boolean | This primes Fusebill to change the invoice's net terms to something different than the default. Pair this with netTerms to define which value to set. | Optional |
netTerms | Enum:{Net0, Net5, Net7, Net10, Net15, Net21, Net30, Net45, Net60, Net75, Net90, MFI1, DayOfMonth1, DayOfMonth2, DayOfMonth3, ... DayOfMonth29, DayOfMonth30, DayOfMonth31} | Set non-default net terms on the invoice. Requires netTermsSet to be true | Optional |
hideOnSSP | Boolean | Hide invoice from appearing on Customer Portal when True and hideOnSSP set to True. | Optional |
hideOnSSPSet | Boolean | When set to True, it will update to the value set on hideOnSSP. | Required to set the value of hideOnSSP. |
curl -X PATCH "https://secure.fusebill.com/v1/Invoices/" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}" \
-d "{id:{InvoiceId},notes:'I patched this note onto the invoice.'}"
//Json Payload
string jsonData =
"{id:{InvoiceId},notes:'I patched this note onto the invoice.'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Invoices/");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "PATCH";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(jsonData);
streamWriter.Flush();
streamWriter.Close();
}
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
#Import library JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {"id":{id},"notes":'I patched this note onto the invoice.'}
#Pass in your URI, Payload and Headers
r = requests.patch('https://secure.fusebill.com/v1/Invoices', data=json.dumps(payload), headers=headers)
print(r.content)
{
"id": 123456
"netTerms": "Net30",
"netTermsSet": true,
"hideOnSSP": true,
"hideOnSSPSet": true,
}
Response