patch
https://secure.fusebill.com/v1/Invoices
Make as-needed changes to invoices that have been posted. Changes to invoices have limited implementation. Financial changes are done through reversals or re-issuing 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
{
"invoiceNumber": 283,
"invoiceSignature": "<p><img src=\"https://fbhostedpagesdev.blob.core.windows.net/local/logo-636308250883322560.png\" alt=\"{user}\"> <strong>mattLtest</strong> \n</p>\n<p><em>{user} | | [][1]</em></p>\n<p>[1]: </p>\n",
"poNumber": null,
"effectiveTimestamp": "2017-06-09T13:16:43",
"postedTimestamp": "2017-06-09T13:16:43",
"charges": [
{
"quantity": 1,
"unitPrice": 22,
"amount": 22,
"name": "Tiered product 2",
"description": null,
"glCode": "",
"effectiveTimestamp": "2017-06-09T13:16:43",
"proratedUnitPrice": null,
"startServiceDate": "2017-06-09T13:16:43",
"endServiceDate": "2017-06-25T04:00:00",
"rangeQuantity": null,
"isReversable": true,
"discount": null,
"discounts": [],
"subscriptionProduct": {
"id": 123456,
"uri": "https://secure.fusebill.com/v1/subscriptionProducts/{ID}"
},
"purchase": null,
"chargeTiers": [
{
"label": "0-2",
"quantity": 1,
"unitPrice": 22,
"amount": 22
}
],
"id": 123456,
"uri": null
}
],
"subtotal": 22,
"invoiceAmount": 22,
"totalPayments": 0,
"outstandingBalance": 22,
"terms": "Net10",
"customerId": 123456,
"invoiceCustomer": {
"firstName": "John",
"middleName": null,
"lastName": "Smith",
"companyName": null,
"suffix": null,
"primaryEmail": null,
"primaryPhone": null,
"secondaryEmail": null,
"secondaryPhone": null,
"title": "",
"reference": null,
"status": null,
"customerAccountStatus": null,
"currency": "USD",
"customerReference": null,
"customerAcquisition": null,
"monthlyRecurringRevenue": 0,
"netMonthlyRecurringRevenue": 0,
"salesforceId": null,
"salesforceAccountType": null,
"salesforceSynchStatus": null,
"netsuiteId": null,
"netsuiteCustomerType": null,
"portalUserName": null,
"parentId": null,
"quickBooksLatchType": null,
"quickBooksId": null,
"quickBooksSyncToken": null,
"id": 0,
"uri": null
},
"invoiceCustomerAddressPreference": {
"contactName": null,
"shippingInstructions": null,
"useBillingAddressAsShippingAddress": false,
"billingAddress": null,
"shippingAddress": null,
"id": 0,
"uri": null
},
"sumOfCreditNotes": 0,
"totalWriteoffs": 0,
"taxes": [],
"totalDiscount": 0,
"paymentSchedules": [
{
"dueDateTimestamp": "2017-06-19T13:16:43",
"status": "Due",
"amount": 22,
"outstandingBalance": 22,
"daysDueAfterTerm": 0
}
],
"notes": "api test",
"customerReferenceValue": "",
"openingArBalance": 0,
"closingArBalance": 22,
"invoiceInMemoryOnly": false,
"invoiceRevisions":[],
"id": 162281,
"uri": "https://secure.fusebill.com/v1/Invoices/{ID}"
} 200