Sage One - Accounts - v3 ES
Documentation of the Sage Business Cloud Accounting API.
Updates a Invoice Settings
Endpoint Availability
- Accounting Plus: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸
- Accounting Standard: 🇬🇧, 🇮🇪
- Accounting Start: 🇨🇦, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸
Access Control Restrictions
Requires the authenticated user to have any mentioned role in one of the listed areas:
- Area:
Settings
: Full Access
Request URL
Request headers
(optional)
string
Media type of the body sent to the API.
Request body
{
"invoice_settings": {
"next_invoice_number": 0,
"next_credit_note_number": 0,
"separate_invoice_credit_note_numbering": true,
"sales_invoice_number_prefix": "string",
"sales_credit_note_number_prefix": "string",
"invoice_terms_and_conditions": "string",
"default_note_on_invoice": "string",
"default_note_on_credit_note": "string",
"default_note_on_estimate": "string",
"default_note_on_quote": "string",
"next_quote_number": 0,
"quote_number_prefix": "string",
"estimate_number_prefix": "string",
"quote_default_days_to_expiry": 0,
"estimate_default_days_to_expiry": 0,
"quote_terms_and_conditions": "string",
"estimate_terms_and_conditions": "string",
"delivery_note_terms_and_conditions": "string",
"delivery_note_show_signature": true,
"delivery_note_show_picked": true,
"delivery_note_show_notes": true,
"delivery_note_show_contact_details": true,
"quick_entry_prefix": "string",
"late_payment_percentage": 0.0,
"prompt_payment_percentage": 0.0,
"show_auto_entrepreneur": true,
"show_insurance": true,
"insurer_id": "string",
"insurance_area": "string",
"insurance_type": "string",
"insurance_text": "string",
"payment_bank_account_id": "string",
"sales_corrective_invoice_number_prefix": "string",
"next_sales_corrective_invoice_number": 0,
"customer_credit_days": 0,
"vendor_credit_days": 0,
"document_headings": {
"sales_invoice": "string",
"sales_credit_note": "string",
"sales_corrective_invoice": "string",
"sales_quote": "string",
"sales_estimate": "string",
"pro_forma": "string",
"remittance_advice": "string",
"statement": "string",
"delivery_note": "string"
},
"line_item_titles": {
"description": "string",
"unit_price": "string",
"quantity": "string",
"discount": "string"
},
"footer_details": {
"column_1": "string",
"column_2": "string",
"column_3": "string"
},
"print_contact_details": {
"business_name": true,
"website": true,
"telephone": true,
"mobile": true,
"email_address": true,
"due_date": true,
"default_delivery_address": "string"
},
"print_statements": {
"days_overdue": true,
"table_of_balances": true
}
}
}
{
"type": "object",
"properties": {
"invoice_settings": {
"type": "object",
"properties": {
"next_invoice_number": {
"type": "integer",
"format": "int32",
"description": "The next invoice number",
"minimum": 1,
"maximum": 999999999
},
"next_credit_note_number": {
"type": "integer",
"format": "int32",
"description": "The next credit note number",
"minimum": 1,
"maximum": 999999999
},
"separate_invoice_credit_note_numbering": {
"type": "boolean",
"description": "Indicates whether to use separate or combined number sequences for invoices and credit notes"
},
"sales_invoice_number_prefix": {
"type": "string",
"description": "The prefix to use for sales invoices"
},
"sales_credit_note_number_prefix": {
"type": "string",
"description": "The prefix to use for sales credit notes"
},
"invoice_terms_and_conditions": {
"type": "string",
"description": "The default terms and conditions to include on invoices"
},
"default_note_on_invoice": {
"type": "string",
"description": "The default notes to include on invoices"
},
"default_note_on_credit_note": {
"type": "string",
"description": "The default notes to include on credit notes"
},
"default_note_on_estimate": {
"type": "string",
"description": "The default notes to include on estimates"
},
"default_note_on_quote": {
"type": "string",
"description": "The default notes to include on quotes"
},
"next_quote_number": {
"type": "integer",
"format": "int32",
"description": "The next quote number",
"minimum": 1,
"maximum": 999999999
},
"quote_number_prefix": {
"type": "string",
"description": "The prefix to use for sales quotes"
},
"estimate_number_prefix": {
"type": "string",
"description": "The prefix to use for sales estimates"
},
"quote_default_days_to_expiry": {
"type": "integer",
"format": "int32",
"description": "The default number of days before quotes expire",
"minimum": 0,
"maximum": 365
},
"estimate_default_days_to_expiry": {
"type": "integer",
"format": "int32",
"description": "The default number of days before estimates expire",
"minimum": 0,
"maximum": 365
},
"quote_terms_and_conditions": {
"type": "string",
"description": "The default terms and conditions to include on quotes"
},
"estimate_terms_and_conditions": {
"type": "string",
"description": "The default terms and conditions to include on estimates"
},
"delivery_note_terms_and_conditions": {
"type": "string",
"description": "The default terms and conditions to include on delivery notes"
},
"delivery_note_show_signature": {
"type": "boolean",
"description": "Indicates whether to include the signature lines on delivery notes"
},
"delivery_note_show_picked": {
"type": "boolean",
"description": "Indicates whether to include the picked column on delivery notes"
},
"delivery_note_show_notes": {
"type": "boolean",
"description": "Indicates whether to include the document notes on delivery notes"
},
"delivery_note_show_contact_details": {
"type": "boolean",
"description": "Indicates whether to include contact details on delivery notes"
},
"quick_entry_prefix": {
"type": "string",
"description": "The prefix to use for quick entries"
},
"late_payment_percentage": {
"type": "number",
"format": "double",
"description": "The percentage charge applied to late payment of invoices (France only)"
},
"prompt_payment_percentage": {
"type": "number",
"format": "double",
"description": "The percentage applied to late payment of invoices (France only)"
},
"show_auto_entrepreneur": {
"type": "boolean",
"description": "Indicates whether to include auto entrepreneur details on invoices (France only)"
},
"show_insurance": {
"type": "boolean",
"description": "Indicates whether to include insurance details on invoices (France only)"
},
"insurer_id": {
"type": "string",
"description": "The ID of the Insurer. (France only)"
},
"insurance_area": {
"type": "string",
"description": "The insurance area to be displayed on invoices (France only)"
},
"insurance_type": {
"type": "string",
"description": "The insurance type to be displayed on invoices (France only)"
},
"insurance_text": {
"type": "string",
"description": "The insurance mention to be displayed on invoices (France only)"
},
"payment_bank_account_id": {
"type": "string",
"description": "The ID of the Payment Bank Account."
},
"sales_corrective_invoice_number_prefix": {
"type": "string",
"description": "The sales corrective invoice number prefix (Spain only)"
},
"next_sales_corrective_invoice_number": {
"type": "integer",
"format": "int32",
"description": "The next sales corrective invoice number",
"minimum": 1,
"maximum": 2147483647
},
"customer_credit_days": {
"type": "integer",
"format": "int32",
"description": "The default delay within which the business' customer has to pay an invoice\nPrefer the (customer) contact's attribute 'credit_days' over this setting\nto calculate an invoice's date of payment; only if null, use this as default.\n",
"minimum": 0,
"maximum": 365
},
"vendor_credit_days": {
"type": "integer",
"format": "int32",
"description": "The default delay within which the business has to pay any vendor's invoice\nPrefer the specific (vendor) contact's attribute 'credit_days' over this setting;\nonly if null, use this as default.\n",
"minimum": 0,
"maximum": 365
},
"document_headings": {
"type": "object",
"properties": {
"sales_invoice": {
"type": "string",
"description": "The customisable sales invoice document header"
},
"sales_credit_note": {
"type": "string",
"description": "The customisable sales credit note document header"
},
"sales_corrective_invoice": {
"type": "string",
"description": "The customisable sales corrective invoice document header"
},
"sales_quote": {
"type": "string",
"description": "The customisable sales quote document header"
},
"sales_estimate": {
"type": "string",
"description": "The customisable sales estimate document header"
},
"pro_forma": {
"type": "string",
"description": "The customisable pro forma document header"
},
"remittance_advice": {
"type": "string",
"description": "The customisable remittance advice document header"
},
"statement": {
"type": "string",
"description": "The customisable statement document header"
},
"delivery_note": {
"type": "string",
"description": "The customisable delivery note document header"
}
}
},
"line_item_titles": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "The user defined description column title"
},
"unit_price": {
"type": "string",
"description": "The user defined unit price column title"
},
"quantity": {
"type": "string",
"description": "The user defined quantity column title"
},
"discount": {
"type": "string",
"description": "The user defined discount column title"
}
}
},
"footer_details": {
"type": "object",
"properties": {
"column_1": {
"type": "string",
"description": "The pdf footer details for column 1"
},
"column_2": {
"type": "string",
"description": "The pdf footer details for column 2"
},
"column_3": {
"type": "string",
"description": "The pdf footer details for column 3"
}
}
},
"print_contact_details": {
"type": "object",
"properties": {
"business_name": {
"type": "boolean",
"description": "Indicates whether business name is printed on the invoice"
},
"website": {
"type": "boolean",
"description": "Indicates whether website is printed on the invoice"
},
"telephone": {
"type": "boolean",
"description": "Indicates whether telephone is printed on the invoice"
},
"mobile": {
"type": "boolean",
"description": "Indicates whether mobile is printed on the invoice"
},
"email_address": {
"type": "boolean",
"description": "Indicates whether email address is printed on the invoice"
},
"due_date": {
"type": "boolean",
"description": "Indicates whether due date is printed on the invoice"
},
"default_delivery_address": {
"type": "string",
"description": "Indicates which contact address is used for the delivery address of the invoice. Valid options are: INVOICE_ADDRESS, CONTACT_DELIVERY_ADDRESS, NONE."
}
}
},
"print_statements": {
"type": "object",
"properties": {
"days_overdue": {
"type": "boolean",
"description": "Indicates whether days of overdue are printed in the contact's statement"
},
"table_of_balances": {
"type": "boolean",
"description": "Indicates whether table of balances is printed in the contact's statement"
}
}
}
}
}
},
"required": [
"invoice_settings"
],
"description": "Updates a Invoice Settings"
}
Response 200
Updates a Invoice Settings
Code samples
@ECHO OFF
curl -v -X PUT "https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
var uri = "https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings?" + queryString;
HttpResponseMessage response;
// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");
using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
response = await client.PutAsync(uri, content);
}
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings");
URI uri = builder.build();
HttpPut request = new HttpPut(uri);
request.setHeader("Content-Type", "application/json");
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
};
$.ajax({
url: "https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
},
type: "PUT",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings";
NSArray* array = @[
// Request parameters
@"entities=true",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"PUT"];
// Request headers
[_request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings');
$url = $request->getUrl();
$headers = array(
// Request headers
'Content-Type' => 'application/json',
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_PUT);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
})
try:
conn = httplib.HTTPSConnection('api.columbus.sage.com')
conn.request("PUT", "/es/sageone/accounts/v3/invoice_settings?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
})
try:
conn = http.client.HTTPSConnection('api.columbus.sage.com')
conn.request("PUT", "/es/sageone/accounts/v3/invoice_settings?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://api.columbus.sage.com/es/sageone/accounts/v3/invoice_settings')
request = Net::HTTP::Put.new(uri.request_uri)
# Request headers
request['Content-Type'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body