This section explains how to use OAuth 2.0 to allow Sage One users to authorize third party applications to access their data without sharing their actual login details.
When you register your client application for the Sage One API, you are provided with:
client_id
client_secret
signing_secret
The following diagram shows the process for the OAuth2 handshake:
Redirect to the Sage One authorization server:
https://www.sageone.com/oauth2/auth
response_type
- This is the type of response that you expect to receive. This is always code
.client_id
- The client id you received from Sage One when you registered.redirect_uri
- The callback URL. This is where your users will be sent after authorizing.scope
- Lets you specify the type of access to allow. Can be readonly
or full_access
. Read only does not allow you to modify any Sage One data. If you do not provide this parameter, the default is full access.state
- A string used to protect against CSRF attacks. Although state is optional, we recommend including this. This should be a string that cannot be guessed. Note: If the value of the state parameter returned in the response does not match the state that was provided in the original request, it does not originate from the original request and you must not continue.https://www.sageone.com/oauth2/auth?response_type=code&client_id=4b64axxxxxxxxxx00710&redirect_uri=https://myapp.com/auth/callback &scope=full_access
When this endpoint is hit, the user is prompted to sign in to Sage One and asked if they want to authorize your application.
If the user allows access to your application, they are redirected to the callback URL along with an authorization code and relevant country code which can be read from the response:
GET /auth/callback?code=12a0f9c12cxxxxxxxxxxxxxxx92a48cc1f237ead&country=gb
The authorization code expires after 60 seconds.
Error | Description |
---|---|
access_denied |
This error occurs when the Sage One business user chooses not to authorise your application. |
invalid_request |
This error occurs when a required parameter is missing, invalid or provided more than once. |
invalid_scope |
This error occurs when the scope provided is invalid or unknown. You should ensure that scope in your request is either readonly or full_access . |
server_error |
This generic error occurs when the authorization server encounters something unexpected that prevents it from fulfilling the request. |
temporarily_unavailable |
This error occurs when the authorization server is unavailable. We recommend waiting for 10 minutes before retrying. |
unauthorized_client |
This error occurs when the client is not authorized to perform this action. This may be due to an incorrect client_id value. |
unsupported_response_type |
This error occurs when the authorization server does not support the method being used to request the code. You should ensure that the response_type in your request is code . |
You should now request an access token in exchange for the authorization code.
To do this, send a POST request to:
https://api.sageone.com/oauth2/token
client_id
- The client id you received from Sage One when you registered.client_secret
- The client secret you received from Sage One when you registered.code
- The authorization code provided in the response from the previous step.grant_type
- The type of grant the code relates to. Either authorization_code
or refresh_token
.redirect_uri
- The callback URL used to get the authorization code.POST /oauth2/token HTTP/1.1 Host: api.sageone.com client_id=4b64axxxxxxxxxx00710& client_secret=iNumzTxxxxxxxxxxhVHstrqWesH8tm9& code=12a0f9c12cxxxxxxxxxxxxxxx92a48cc1f237ead& grant_type=authorization_code& redirect_uri=https://myapp.com/auth/callback
The response includes the access token:
{ "access_token": "cULSIjxxxxxIhbgbjX0R6MkKO", "scope": "full_access", "token_type": "Bearer", "expires_in": 86400, "refresh_token": "b06b13xxxxxa275f08bfb57a3" }
Error | Description |
---|---|
invalid_request |
This error occurs when a required parameter is missing, invalid or provided more than once. |
invalid_grant |
This error occurs when the grant_type provided is invalid or unknown. This error also occurs when the refresh token is expired or revoked. |
invalid_client |
This error occurs when the client cannot be authenticated. for example, if the client_id or client_secret are incorrect or invalid. |
unauthorized_client |
This error occurs when the client is not authorized to use the specified grant_type. |
unsupported_grant_type |
This error occurs when the authorization server does not support the grant_type specified. You should ensure that the grant_type in your request is authorization_code or refresh_token . |
During the authorization exchange, you are issued with an access token and a refresh token and you must include the access token in every API call.
The access token expires after 1 hour.
You can use the refresh token to obtain a new access token without the user having to sign in again to allow access.
To do this, send a POST request to:
https://api.sageone.com/oauth2/token
client_id
- The client id you received from Sage One when you registered.client_secret
- The client secret you received from Sage One when you registered.refresh_token
- The refresh token provided in the response from the previous step.grant_type
- This must be refresh_token
.POST /oauth2/token HTTP/1.1 Host: api.sageone.com client_id=4b64axxxxxxxxxx00710& client_secret=iNumzTxxxxxxxxxxhVHstrqWesH8tm9& refresh_token=b06b13xxxxxa275f08bfb57a3& grant_type=refresh_token
The response includes the new access token and a new refresh token:
{ "refresh_token":"b0dfbxxxxx2ccf531", "expires_in":3600, "scope":"full_access", "access_token":"51913xxxxx9180d2", "token_type":"Bearer" }
To ensure that a request has not been intercepted or tampered with in transit, every API call you make to Sage One must include an OAuth 1.0a HMAC-SHA1 signature.
This also enables us to ensure that individual requests cannot be submitted more than once.
We have provided the sageone_api_signer
gem to handle the signing of your requests in Ruby.
In this example, we are making a POST request to:
https://api.sageone.com/accounts/v2/contacts?config_setting=foo
and the following parameters are included in the request body:
contact[contact_type_id]: 1 contact[name]: My Customer
To generate your signature base string, you need to determine the following:
Request Method | This is the http request verb converted to upper case. For Sage One API requests this will always be GET , POST , PUT or DELETE . |
Base URL | This is the URL to which the request is directed with the query parameters removed. You must include the protocol, https:// Example base url: https://api.sageone.com/accounts/v2/contacts |
Parameter String | This is a percent encoded string representing the parameters from both the request body and the URL query string.
config_setting=foo&contact%5Bcontact_type_id%5D=1& contact%5Bname%5D=My%20Customer |
nonce | This is a unique token that your application should generate for each request. Sage One will use this value to prevent a request from being submitted more than once. The recommended way to generate a nonce is by base64 encoding 32 bytes of random data and stripping out all non-word characters. However, any approach which produces a relatively random alphanumeric string is acceptable. Example nonce: d6657d14f6d3d9de453ff4b0dc686c6d |
These four items must now be encoded and joined to form the signature base string:
Example signature base string:
POST&https%3A%2F%2Fapi.sageone.com%2Faccounts%2Fv2%2Fcontacts&config_setting%3Dfoo%26contact%255Bcontact_type_id%255D%3D1%26contact%255Bname%255D%3DMy%2520Customer&d6657d14f6d3d9de453ff4b0dc686c6d
Your signature base string should contain exactly 3 '&' characters.
To generate your Signing key, you need the following:
Signing Secret | This is provided when you register your client application. Example signing secret: 297850d556xxxxxxxxxxxxxxxxxxxxe722db1d2a |
Access Token | This is the access token acquired during the OAuth authorization process. Example access token: cULSIjxxxxxIhbgbjX0R6MkKO |
These two values must now be joined to generate the Signing key:
Example signing key:
297850d556xxxxxxxxxxxxxxxxxxxxe722db1d2a&cULSIjxxxxxIhbgbjX0R6MkKO
To generate your signature, you must pass the values of your Signature base string and your Signing key to the HMAC-SHA1 hashing algorithm.
The output of the HMAC signing function is a binary string. This must be base64 encoded to produce the signature string.
For example, the binary string output may look like this:
]\x01\x7FC\xFDj>=\xBB\x8D\xF5dA\xC3@\xCF\x19L\x88\x9A
Converting this to base64 gives the signature for the request:
XQF/Q/1qPj27jfVkQcNAzxlMiJo=
You must include this signature and the nonce in your request header.
To validate your request signature, you can direct your API call to the test endpoint.
For example:
https://api.sageone.com/test/accounts/v2/contacts
When hitting the test endpoint, you must replace your own signing secret with the string: "TestSigningSecret"
Valid requests will return 200 OK
.
Missing parameters will result in 400 BAD_REQUEST
and the response will include information about the missing or incorrect parameters:
{ "error": "Authorization header is missing.", "error_description": "Please provide an 'Authorization' header with the following format: Bearer xxxxx." }
If the signature provided in the request does not match the signature that is generated by the authorization server, a 400 BAD_REQUEST
is returned and the JSON response includes the output of each step:
{ "base_url": "https://api.sageone.com/test/accounts/v2/contacts", "nonce": "TestNonce", "parameter_string": "alpha=75&config_setting=foo&qux=foo_bar", "request_method": "GET", "signature": "MS3hIbKYQ+4ImIC/Dpjkk2hvYRY=", "signature_base_string": "GET&https%3A%2F%2Fapi.sageone.com%2Ftest%2Faccounts%2Fv2%2Fcontacts&alpha%3D75%26config_setting%3Dfoo%26qux%3Dfoo_bar&TestNonce", "signing_key": "TestSigningSecret&TestToken", "signing_secret": "TestSigningSecret", "token": "TestToken" }
You can compare these values to the values returned by your application to help you identify and correct the problem.
Creating a valid signature requires you to percent encode certain values.
To ensure that the resulting string is correct, your algorithm must be RFC3986 compliant. The following characters are unreserved and should not be encoded:
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | - | _ | . | ~ |
Ruby:
module PercentEncode UNSAFE = /[^\w\-\_\.\~]/.freeze def self.escape(text) URI.escape(text, PercentEncode::UNSAFE) end end
Lua:
function percent_encode(str) if (str) then str = string.gsub (str, "([^%w%-%_%.%~])", function (c) return string.format ("%%%02X", string.byte(c)) end) end return str end
You can use the following examples to test your percent encoding:
Original string | Encoded string |
---|---|
https://api.sageone.com | https%3A%2F%2Fapi.sageone.com |
Smith + Partners! | Smith%20%2B%20Partners%21 |
Smith, Jones & Partners! | Smith%2C%20Jones%20%26%20Partners%21 |
웃 | %EC%9B%83 |
This section explains how to make an API call once you have the Access Token and request signature.
Once you have the Access Token and OAuth Signature, you can make calls to the Sage One API for the specific user.
You must include the following in your request header:
Authorization: Bearer ***your_access_token*** X-Signature: ***your_OAuth_signature*** X-Nonce: ***your_nonce*** Accept: */* Content-Type: application/x-www-form-urlencoded User-Agent: ***your_application***
$ curl https://api.sageone.com/accounts/v2/products \ -H "Authorization: Bearer cULSIjxxxxxIhbgbjX0R6MkKO" \ -H "X-Signature: jdg635wvsxxxxxxxxxxx5Yv6u78" \ -H "X-Nonce: kYjzVBB8Y0ZxxxxxxxxxxxxgmZeNu2VS4cg" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: North Park Support Services"
{ "$totalResults": 2, "$resources": [ { "sales_price_includes_tax": 0, "lock_version": 0, "sales_price": "35.0", "description": "Product 1", "$key": 1, "tax_code": { "id": 1, "$key": 1 }, "ledger_account": { "id": 923, "$key": 923 }, "last_cost_price": "25.0", "product_code": "PRODUCT001", "id": 1, "extra_info": "" }, { "sales_price_includes_tax": 0, "lock_version": 0, "sales_price": "9.0", "description": "Product 2", "$key": 2, "tax_code": { "id": 1, "$key": 1 }, "ledger_account": { "id": 923, "$key": 923 }, "last_cost_price": "5.0", "product_code": "PRODUCT002", "id": 2, "extra_info": "" } ], "$itemsPerPage": 20, "$startIndex": 0 }
Required and optional parameters are documented for each individual endpoint.
Required parameters are indicated by a red bullet and optional parameters are indicated by a blue bullet. For example:
required_parameter
string
This is a required parameter. You must provide this for POST and PUT requests.
optional_parameter
string
This is an optional parameter.
When making a POST or a PUT request, you must supply the required parameters. You can also provide any optional parameters as required.
Content-Type: application/x-www-form-urlencoded
.Parameters are not required for GET or DELETE requests.
For successful GET, PUT and DELETE requests, you will receive an HTTP status code 200 and the body will contain the requested data in a JSON array.
For successful POST requests, you will receive an HTTP status code 201 and the body will include the created item(s)
The Sage One API is SData compliant. GET requests return records as an SData paginated response. For example:
{ "$totalResults": 200, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Current", "$key": 1 }, #... ] }
$totalResults
- the number of results included.$startIndex
- shows the first record in this range.$itemsPerPage
- the number of records returned on each page.$resources
- the actual records matching the query.In this example, our page includes 20 records. To return records 101 - 150, you would include the $startIndex
and $itemsPerPage
params in your request:
/accounts/v2/example_resource?$startIndex=100&$itemsPerPage=50
We have created the following sample applications to help get you started:
These are simple applications that include authentication and the signing of requests.
Responds with information about the business.
name
string
Business name
website
string
Business web site url
telephone
string
Telephone number
mobile
string
Mobile telephone number
street_1
string
Business address street
street_2
string
Business address village/area
city
string
Business address town / city
county
string
Business address county / region
postcode
string
Business address postcode / ZIP code
country
country
Business address country
Toggle Child Attributesname
string
Country name
code
string
The two-letter country code as defined by ISO 3166-1.
{ "name": "Braga City Bar", "website": "http://www.example.com", "telephone": "+351(0)253-123456789", "mobile": "", "street_1": "Rua da Murgueira, 9/9A,Ap. 5785", "street_2": "Zambujal", "city": "Braga", "county": "Corvo", "postcode": "4720-001", "country": { "name": "Portugal", "code": "PT" } }
Responds with address and contact information about the business.
No parameters required.
$ curl https://api.sageone.com/core/v2/business \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "name": "Braga City Bar", "website": "http://www.example.com", "telephone": "+351(0)253-123456789", "mobile": "", "street_1": "Rua da Murgueira, 9/9A,Ap. 5785", "street_2": "Zambujal", "city": "Braga", "county": "Corvo", "postcode": "4720-001", "country": { "name": "Portugal", "code": "PT" } }
Updates the business information.
Responds with updated information about the business.
name
string
Business name
website
string
Business web site url
telephone
string
Telephone number
mobile
string
Mobile telephone number
street_1
string
Business address street
street_2
string
Business address village/area
city
string
Business address town / city
county
string
Business address county / region
postcode
string
Business address postcode / ZIP code
$ curl -X PUT https://api.sageone.com/core/v2/business \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "business[name]=Bar de Braga" \ -d "business[website]=http://www.example.com/updated" \ -d "business[telephone]=+351(0)253-236798541" \ -d "business[mobile]=07222 555 222" \ -d "business[street_1]=Rua da Murgueira, 10" \ -d "business[street_2]=Zambujal, 12" \ -d "business[city]=Braga Est" \ -d "business[county]=Corvo" \ -d "business[postcode]=4720-002"
{ "name": "Bar de Braga", "website": "http://www.example.com/updated", "telephone": "+351(0)253-236798541", "mobile": "07222 555 222", "street_1": "Rua da Murgueira, 10", "street_2": "Zambujal, 12", "city": "Braga Est", "county": "Corvo", "postcode": "4720-002", "country": { "name": "Portugal", "code": "PT" } }
This resource allows you to look up business relationships for the authenticated user.
Implementation of this endpoint is on a per-country basis. Countries without an implementation will return an empty array.
business_relationships[]
Business Relationship
The Business Relationship
{
"business_relationships": []
}
Responds with an array of business relationships.
No parameters required.
$ curl https://api.sageone.com/core/v2/business_relationships \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{
"business_relationships": []
}
This resource allows you to read summary data about the authenticated user account.
business
Business Summary
Business account summary information.
Toggle Child Attributesis_demo
boolean
Is this account a demo account?
user
User Summary
User account summary information.
Toggle Child Attributesownership[]
business_ownerships
business ownerships.
Toggle Child Attributesname
string
Business name
sageone_guid
sageone_guid
Sage One Global Unique Identifier.
services[]
service subscription
Service subscriptions for the business
Toggle Child Attributesuid
string
Service unique identifier
name
string
Service name
{ "business": { "is_demo": false }, "user": { "ownerships": [ { "name": "Braga City Bar", "sageone_guid": "9eec9c9e500b2594588455ddba0f091c", "services": [ { "uid": "facturacao_standard", "name": "Faturação Standard" } ] } ] } }
Responds with summary business and user account information.
No parameters required.
$ curl https://api.sageone.com/core/v2/me \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "business": { "is_demo": false }, "user": { "ownerships": [ { "name": "", "sageone_guid": "1abcdefghi23456j7890k1234567l8m9", "services": [ { "uid": "accounts_extra", "name": "Accounts Extra" } ] } ] } }
Responds with information about the user.
first_name
string
User's first name
last_name
string
User's last name
string
User's email address
{ "first_name": "Maria", "last_name": "Ferreira", "email": "maria.ferreira@sage.pt" }
Responds with the user's name and email information.
No parameters required.
$ curl https://api.sageone.com/core/v2/me \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "first_name": "Maria", "last_name": "Ferreira", "email": "maria.ferreira@sage.pt" }
Update user information.
Responds with updated information about the user.
first_name
string
User first name
last_name
string
User last name
$ curl -X PUT https://api.sageone.com/core/v2/business \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "business[first_name]=Maria Jesús" \ -d "business[last_name]=Ferreira Gomes"
{ "first_name": "Maria Jesus", "last_name": "Ferreira Gomes", "email": "maria.ferreira.g@sage.pt" }
This refers to the type of bank account. Examples include current account and savings account.
This resource allows you to look up your Account Types in Sage One.
id
integer
The ID of the Account Type.
name
string
The name of the Account Type.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
{ "id": 2, "name": "Dinheiro", "$symbol": "CASH_IN_HAND", "$key": 2 }
Responds with all Account Types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/account_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 5, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Corrente", "$symbol": "CURRENT", "$key": 1 }, { "id": 2, "name": "Dinheiro", "$symbol": "CASH_IN_HAND", "$key": 2 }, { "id": 3, "name": "Poupanças", "$symbol": "SAVINGS", "$key": 3 }, { "id": 4, "name": "Cartão de Crédito", "$symbol": "CREDIT_CARD", "$key": 4 }, { "id": 5, "name": "Empréstimos", "$symbol": "LOAN", "$key": 5 } ] }
Responds with the Account Type for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/account_types/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "name": "Corrente", "$symbol": "CURRENT", "$key": 1 }
This refers to the artefact statuses in Sage One. An artefact can be either invoice, credit note (both sales and purchase) or sales quote.
This resource provides a look up of the artefact statuses in Sage One.
id
integer
Artefact Status ID.
name
string
The name of the Artefact Status.
$key
integer
This is the SData key.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
{ "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }
Responds with all Artefact Statuses.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/artefact_statuses \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 4, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }, { "id": 2, "name": "Parcialmente pago", "$symbol": "PART_PAID", "$key": 2 }, { "id": 3, "name": "Pago", "$symbol": "PAID", "$key": 3 }, { "id": 4, "name": "Cancelado", "$symbol": "VOID", "$key": 4 } ] }
This resource allows you to look up your Bank Accounts in Sage One.
id
integer
The ID of the Bank Account.
account_name
string
The name of the Bank Account.
account_number
string
The Bank Account number.
sort_code
string
The Bank Account sort code.
telephone
string
The contact telephone number for the Bank Account.
string
The contact email address for the Bank Account.
address[]
address
The Bank Account branch address.
Toggle Child Attributesstreet_one
string
street_two
string
town
string
county
string
postcode
string
country[]
$key
integer
This is the SData key.
account_type[]
account_type
Toggle Child Attributesid
integer
The ID of the Account Type.
$key
integer
This is the SData key.
ledger_account[]
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
$key
integer
This is the SData key.
balance
decimal
The current balance for the Bank Account.
$key
integer
This is the SData key.
{ "id": 11, "account_name": "Current", "account_number": "12345678", "sort_code": "112233", "telephone": "0845 1234567", "email": "contact@examplebank.com", "address": { "street_one": "Bank Street", "street_two": "", "town": "Banksville", "county": "Tyne and Wear", "postcode": "NE1 1AA", "country": { "$key": null }, "$key": 23 }, "account_type": { "id": 1, "$key": 1 }, "ledger_account": { "id": 415, "$key": 415 }, "balance": "12345.0", "$key": 11 }
Responds with all Bank Accounts.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/bank_accounts \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 2, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 11, "account_name": "Current", "account_number": "12345678", "sort_code": "112233", "telephone": "0845 1234567", "email": "contact@examplebank.com", "address": { "street_one": "Bank Street", "street_two": "", "town": "Banksville", "county": "Tyne and Wear", "postcode": "NE1 1AA", "country": { "$key": null }, "$key": 23 }, "account_type": { "id": 1, "$key": 1 }, "ledger_account": { "id": 415, "$key": 415 }, "balance": "12345.0", "$key": 11 }, { "id": 12, "account_name": "Cash in Hand", "account_number": "", "sort_code": "", "telephone": "", "email": "", "address": { "street_one": "", "street_two": "", "town": "", "county": "", "postcode": "", "country": { "$key": null }, "$key": 24 }, "account_type": { "id": 5, "$key": 5 }, "ledger_account": { "id": 416, "$key": 416 }, "balance": "0.0", "$key": 12 } ] }
Responds with the Bank Account for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/bank_accounts/5 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 11, "account_name": "Current", "account_number": "12345678", "sort_code": "112233", "telephone": "0845 1234567", "email": "contact@examplebank.com", "address": { "street_one": "Bank Street", "street_two": "", "town": "Banksville", "county": "Tyne and Wear", "postcode": "NE1 1AA", "country": { "$key": null }, "$key": 23 }, "account_type": { "id": 1, "$key": 1 }, "ledger_account": { "id": 415, "$key": 415 }, "balance": "12345.0", "$key": 11 }
Creates a new Bank Account.
No parameters required.
$ curl -X POST https://api.sageone.com/accounts/v2/bank_accounts \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" -d "bank_account[account_name]=account name" \ -d "bank_account[account_type_id]=2"
Not available.
Update the specified Bank Account.
No parameters required.
$ curl -X PUT https://api.sageone.com/accounts/v2/bank_accounts/3 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" -H "User-Agent: ***your_application***" \ -d "bank_account[account_name]=new Checking Account"
Not available.
This resource provides a look up of the contact types in Sage One.
id
integer
The ID of the Contact Type.
name
string
The name of the Contact Type.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
{ "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 }
Responds with all Contact Types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/contact_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 2, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 }, { "id": 2, "name": "Fornecedor", "$symbol": "SUPPLIER", "$key": 2 } ] }
Responds with the Contact Type for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/contact_types/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 }
This resource allows you to read, add, update and delete Contacts in Sage One.
id
integer
The ID of the Contact.
company
string
The company name of the Contact.
contact_type[]
contact_type
Toggle Child Attributesid
integer
The ID of the Contact Type.
name
string
The name of the Contact Type.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
string
The Contact email address.
mobile
string
The Contact mobile number.
name
string
The name of the Contact.
notes
string
Notes relevant to the Contact.
tax_number
string
The Contact tax/VAT number.
telephone
string
The Contact telephone number.
main_address
address
The Contact main address.
Toggle Child Attributesid
integer
street_one
string
First line of the main address, maximum 50 characters.
street_two
string
Second line of the main address, maximum 50 characters.
town
string
Town/City for the main address, maximum 50 characters.
county
string
County for the main address, maximum 50 characters.
postcode
string
Post code for the main address, in format 0000-000.
country
country
Toggle Child Attributesid
integer
The ID of the Country.
code
name
string
The name of the Country.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
delivery_address
address
The Contact delivery address.
Toggle Child Attributesid
address_id
street_one
string
First line of the delivery address, maximum 50 characters.
street_two
string
Second line of the delivery address, maximum 50 characters.
town
string
Town/City for the delivery address, maximum 50 characters.
county
string
County for the delivery address, maximum 50 characters.
postcode
string
Post code for the delivery address, in format 0000-000.
country
country
Toggle Child Attributesid
integer
The ID of the Country.
code
name
string
The name of the Country.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
withholding_tax
withholding_tax
The withholding tax of the Contact
Toggle Child Attributesid
withholding_tax_id
name
withholding_tax_name
percentage
decimal
$key
integer
This is the SData key.
$url
$key
integer
This is the SData key.
{ "id": 1, "company": "company name", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "María Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 }
Responds with all Contacts.
If required, you can filter the response by including the optional parameters shown below.
contact_type
integer
Use this to get either customers(1) or suppliers(2). For example, use /accounts/v2/contacts?contact_type=1 to get only customers.
string
Use this to find a contact by their email address. For example, /accounts/v2/contacts?email=fred@email.com
search
string
Use this to filter by the contact name or company name (not case sensitive). For example, /accounts/v2/contacts?search=fred
$ curl https://api.sageone.com/accounts/v2/contacts \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "company": "Sage Stars", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "María Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 } ] }
Responds with the Contact for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/contacts/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "company": "Sage Stars", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "Maria Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 }
Creates a new Contact record.
name
string
The name of the contact, maximum 50 characters.
company_name
string
The name of the company, maximum 50 characters.
contact_type_id
integer
The type of the contact. 1 = Customer, 2 = Supplier.
string
The email address of the contact, maximum 100 characters. Email must be valid.
telephone
string
The telephone number of the contact, maximum 50 characters.
mobile
string
The mobile number of the contact, maximum 50 characters.
notes
string
Any notes for the contact record, maximum 500 characters.
tax_number
string
The tax/VAT number of the contact.
main_address[]
address
The Contact address.
Toggle Child Parametersstreet_one
string
First line of the main address, maximum 50 characters.
street_two
string
Second line of the main address, maximum 50 characters.
town
string
Town for the main address, maximum 50 characters.
county
string
County for the main address, maximum 50 characters.
postcode
string
Post code for the main address, must have the format 0000-000 for Portuguese addresses.
country_id
integer
The ID of the Country.
delivery_address[]
address
The Contact address.
Toggle Child Parametersstreet_one
string
First line of the delivery address, maximum 50 characters.
street_two
string
Second line of the delivery address, maximum 50 characters.
town
string
Town for the delivery address, maximum 50 characters.
county
string
County for the delivery address, maximum 50 characters.
postcode
string
Post code for the delivery address, must have the format 0000-000 for Portuguese addresses
country_id
integer
The ID of the Country.
withholding_tax_id
string
The Tax Rate of the Contact.
$ curl -X POST https://api.sageone.com/accounts/v2/contacts \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "contact[company]=Sage Stars" \ -d "contact[contact_type_id]=1" \ -d "contact[name]=Maria Ferreira" \ -d "contact[email]=maria.ferreira@sage.pt" \ -d "contact[mobile]=931 234 779" \ -d "contact[notes]=This lady has a native knack for science" \ -d "contact[tax_number]=123456789" \ -d "contact[telephone]=0800 33 03000" \ -d "contact[main_address][line_1]=Rua da Murgueira, 9/9A,Ap. 5785 " \ -d "contact[main_address][line_2]=Zambujal" \ -d "contact[main_address][line_3]=Amadora" \ -d "contact[main_address][postcode]=2611-865" \ -d "contact[main_address][country_id]=175" \ -d "contact[delivery_address][line_1]=Rua da Murgueira, 9/9A,Ap. 5785 C" \ -d "contact[delivery_address][line_2]=Zambujal" \ -d "contact[delivery_address][line_3]=Amadora" \ -d "contact[delivery_address][postcode]=2611-865" \ -d "contact[delivery_address][country_id]=175" \ -d "contact[withholding_tax_id]=1"
{ "id": 1, "company": "Sage Stars", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "Maria Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 }
Updates an existing Contact record.
name
string
The name of the contact, maximum 50 characters.
company_name
string
The name of the company, maximum 50 characters.
contact_type_id
integer
The type of the contact. 1 = Customer, 2 = Supplier.
string
The email address of the contact, maximum 100 characters. Email must be valid.
telephone
string
The telephone number of the contact, maximum 50 characters.
mobile
string
The mobile number of the contact, maximum 50 characters.
notes
string
Any notes for the contact record, maximum 500 characters.
tax_number
string
The tax/VAT number of the contact.
main_address[]
address
The Contact address.
Toggle Child Parametersstreet_one
string
First line of the main address, maximum 50 characters.
street_two
string
Second line of the main address, maximum 50 characters.
town
string
Town for the main address, maximum 50 characters.
county
string
County for the main address, maximum 50 characters.
postcode
string
Post code for the main address, must have the format 0000-000 for portuguese addresses.
country_id
integer
The ID of the Country.
delivery_address[]
address
The Contact address.
Toggle Child Parametersstreet_one
string
First line of the delivery address, maximum 50 characters.
street_two
string
Second line of the delivery address, maximum 50 characters.
town
string
Town for the delivery address, maximum 50 characters.
county
string
County for the delivery address, maximum 50 characters.
postcode
string
Post code for the delivery address, must have the format 0000-000 for portuguese addresses.
country_id
integer
The ID of the Country.
withholding_tax_id
string
The Tax Rate of the Contact.
$ curl -X PUT https://api.sageone.com/accounts/v2/contacts/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "contact[company]=Sage Stars PT" \ -d "contact[contact_type_id]=1"
{ "id": 1, "company": "Sage Stars PT", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "Maria Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 }
Deletes an existing Contact record.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/contacts/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "company": "Sage Stars PT", "contact_types": [ { "id": 1, "name": "Cliente", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "maria.ferreira@sage.pt", "mobile": "931 234 779", "name": "Maria Ferreira", "notes": "This lady has a native knack for science", "tax_number": "123456789", "telephone": "0800 33 03000", "main_address": { "id": 1, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 ", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 1 }, "delivery_address": { "id": 2, "street_one": "Rua da Murgueira, 9/9A,Ap. 5785 C", "street_two": "Zambujal", "town": "Amadora", "county": null, "postcode": "2611-865", "country": { "id": 175, "code": "PT", "name": "Portugal", "$key": 175 }, "$key": 2 }, "$url": "/accounts/v2/contacts/1", "withholding_tax": { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, "$key": 1 }
Countries are referenced in Sage One wherever an address is specified. For example, in a Contact record.
This resource allows you to look up the Countries in Sage One.
code
string
The two-letter country code as defined by ISO 3166-1.
id
integer
The ID of the Country.
name
string
The name of the Country.
$key
integer
This is the SData key.
{ "id": 1, "code": "AF", "name": "Afghanistan", "$key": 1 }
Responds with all Countries.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/countries \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 238, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 3, "code": "AF", "name": "Afeganistão", "$key": 3 }, { "id": 236, "code": "ZA", "name": "África do Sul", "$key": 236 }, { "#...": "#..." } ] }
Responds with the Country for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/countries/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "code": "AD", "name": "Andorra", "$key": 1 }
These are called types of expense in Sage One and are the categories a user can make purchases against. Users can create their own expense types to suit their business.
This resource allows you to look up the Expense Types.
id
integer
The ID of the Expense Type.
name
string
The name of the Expense Type.
nominal
string
The nominal code for the Expense Type.
tax_code[]
integer
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The Tax Rate description.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
{ "id": 439, "name": "Cost (goods)", "nominal_code": 5000, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 439 }
Responds with all Expense Types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/expense_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 22, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 439, "name": "Cost (goods)", "nominal_code": 5000, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 439 }, { "id": 440, "name": "Materials", "nominal_code": 5010, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 440 }, { "id": 441, "name": "Shipping", "nominal_code": 5015, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 441 }, { "id": 442, "name": "Dividend cost", "nominal_code": 8900, "tax_code": { "id": 5, "name": "NO_VAT", "$key": 5 }, "$key": 442 }, { "#...": "#..." } ] }
This refers to 'Other Expense' transactions in Sage One.
This resource allows you to read, add, update and delete Expense transactions from Sage One.
Not available.
Not available.
Responds with all Expense transactions.
If required, you can include the optional parameters below in your request URL to filter the response by date range.
from_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
You can limit the response to instances created within a date range. You must supply both the from_date and the to_date. The date format can be either YYYY-MM-DD or DD/MM/YYYY. However, if using DD/MM/YYYY, you must supply an additional parameter, classic_dates=true
to_date
updated_or_created_since
string
Date string represented as YYYY-MM-DD. See ISO 8601.
Use this to limit the response to instances created, updated, or deleted since a given date (format: YYYY-MM-DDT(+|-)hh:mm ) or date-time (format: YYYY-MM-DDThh:mm:ss(+|-)hh:mm ). For example, /accounts/v2/expenses?updated_or_created_since=2014-06-25 or /accounts/v2/expenses?updated_or_created_since=2014-06-25T10:30:00-04:00. The timezone offset ( (+|-)hh:mm ) defaults to UTC if it is not provided. Note: Client data is stored in Eastern Time (US & Canada) on the servers so please set the Eastern Time offset to get the correct response.
$ curl https://api.sageone.com/accounts/v2/expenses?from_date=2014-05-29&to_date=2014-06-10 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
Not available.
Responds with the Expense transaction for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/expenses/2 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
Not available.
Creates a new Expense transaction.
No parameters required.
$ curl -X POST https://api.sageone.com/accounts/v2/expenses \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" -d "date=2014-06-20" \ -d "total=415.0" \ -d "bank_account_id=12" \ -d "ledger_account_id=134" \ -d "payment_method_id=4" \
Not available.
Update the specified Expense transaction.
No parameters required.
Not available.
Not available.
Delete the specified Expense transaction.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/expenses/5 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
Not available.
This resource allows you to read and update financial settings.
financial_year_end_date
coa_template
string
The chart of accounts (COA) that is used by the business.
tax_submission_frequency_type
Tax Submission Frequency Type
Toggle Child Attributesid
integer
The tax submission frequency type ID.
name
string
The tax submission frequency type name.
$symbol
string
The identifier of the tax submission frequency type.
$key
integer
This is the SData key.
tax_scheme
Tax Scheme
The current tax scheme.
Toggle Child Attributesid
integer
The tax scheme ID.
name
string
The tax scheme name.
$symbol
string
The identifier of the tax scheme.
$key
integer
This is the SData key.
tax_number
string
The VAT ID of the business (USt-ID) always will be null.
$key
integer
This is the SData key.
{ "financial_year_end_date": null, "coa_template": "Default", "tax_submission_frequency_type": { "id": 1, "name": "Trimestral", "$symbol": "QUARTERLY", "$key": 1 }, "tax_scheme": { "id": 1, "name": "Standard", "$symbol": "STANDARD", "$key": 1 }, "tax_number": "123456789", "$key": 1 }
Responds with the financial settings for the business.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/financial_settings \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "financial_year_end_date": null, "coa_template": "Default", "tax_submission_frequency_type": { "id": 1, "name": "Trimestral", "$symbol": "QUARTERLY", "$key": 1 }, "tax_scheme": { "id": 1, "name": "Standard", "$symbol": "STANDARD", "$key": 1 }, "tax_number": "123456789", "$key": 1 }
These are called types of sale in Sage One and are the categories a user can make sales against. Users can create their own sales types to suit their business.
This resource allows you to look up these sales types.
id
integer
The ID of the Income Type.
name
string
The name of the Income Type.
nominal
string
The nominal code for the Income Type.
tax_code[]
integer
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The Tax Rate description.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
{ "id": 433, "name": "Shop sales", "nominal_code": 4000, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 433 }
Responds with all Income Types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/income_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 6, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 433, "name": "Shop sales", "nominal_code": 4000, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 433 }, { "id": 434, "name": "Web sales (UK)", "nominal_code": 4001, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 434 }, { "id": 435, "name": "Service sales", "nominal_code": 4010, "tax_code": { "id": 1, "name": "STANDARD", "$key": 1 }, "$key": 435 }, { "#...": "#..." } ] }
This refers to 'Other Income' transactions in Sage One.
This resource allows you to read, add, update and delete income transactions from Sage One.
id
integer
The ID of the Income transaction.
date
invoice_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
The date of the invoice associated with the Income.
amount
decimal
The net amount of the Income.
tax_amount
decimal
The tax amount of the Income.
gross_amount
decimal
The gross amount of the Income.
tax_percentage_rate
decimal
The tax rate percentage for the Income.
tax_code[]
integer
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
$key
integer
This is the SData key.
tax_scheme_period_id
integer
The ID of the tax period for the Income.
reference
string
The reference of the Income.
contact[]
contact
The customer associated with the Income.
Toggle Child Attributesid
integer
The ID of the Contact.
$key
integer
This is the SData key.
source[]
source
Toggle Child Attributesid
integer
The ID of the Income Type.
$key
integer
This is the SData key.
destination[]
destination
The bank account receiving the Income.
Toggle Child Attributesid
integer
The ID of the Ledger Account.
$key
integer
This is the SData key.
payment_method[]
payment_method
Toggle Child Attributesid
integer
The ID of the Income Method.
$key
integer
This is the SData key.
voided
boolean
The void status of the Income.
$key
integer
This is the SData key.
{ "id": 524, "date": "15/10/2012", "invoice_date": "", "amount": "44.0", "tax_amount": "0.0", "gross_amount": "44.0", "tax_percentage_rate": "0.0", "tax_code": { "id": 5, "$key": 5 }, "tax_scheme_period_id": 11, "reference": "", "contact": { "id": 375, "$key": 375 }, "source": { "id": 452, "$key": 452 }, "destination": { "id": 416, "$key": 416 }, "payment_method": { "id": 5, "$key": 5 }, "voided": false, "lock_version": 0, "$key": 524 }
Responds with all Incomes.
If required, you can include the optional parameters below in your request URL to filter the response by date range.
from_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
You can limit the response to instances created in a date range. You must supply both the from_date and the to_date. For example, /accounts/accounts/v2/incomes?from_date=01/01/2012&to_date=31/12/2012
to_date
$ curl https://api.sageone.com/accounts/v2/incomes?from_date=15/10/2012&to_date=15/10/2012 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 522, "date": "15/10/2012", "invoice_date": "", "amount": "44.0", "tax_amount": "0.0", "gross_amount": "44.0", "tax_percentage_rate": "0.0", "tax_code": { "id": 5, "$key": 5 }, "tax_scheme_period_id": 11, "reference": "", "contact": { "id": 375, "$key": 375 }, "source": { "id": 454, "$key": 454 }, "destination": { "id": 416, "$key": 416 }, "payment_method": { "id": 1, "$key": 1 }, "voided": false, "lock_version": 0, "$key": 522 } ] }
Responds with the Income for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/incomes/522 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 522, "date": "15/10/2012", "invoice_date": "", "amount": "44.0", "tax_amount": "0.0", "gross_amount": "44.0", "tax_percentage_rate": "0.0", "tax_code": { "id": 5, "$key": 5 }, "tax_scheme_period_id": 11, "reference": "", "contact": { "id": 375, "$key": 375 }, "source": { "id": 454, "$key": 454 }, "destination": { "id": 416, "$key": 416 }, "payment_method": { "id": 1, "$key": 1 }, "voided": false, "lock_version": 0, "$key": 522 }
Creates a new Income transaction.
date
string
The date of the Income in the format dd/mm/yyyy.
amount
decimal
The net amount of the Income, maximum value 99999999.99
tax_amount
decimal
The tax amount of the Income, maximum value 99999999.99
tax_percentage_rate
decimal
The tax rate percentage for the Income.
tax_code_id
integer
The ID of the Tax Rate for this transaction.
source_id
integer
The ID of the Income Type.
destination_id
payment_method_id
integer
The ID of the Income Method.
invoice_date
string
The date of the invoice associated with the Income if applicable. In the format dd/mm/yyyy.
reference
string
The reference of the Income.
contact_id
is_tax_included
boolean
Set to 1 if the amount includes tax.
$ curl -X POST https://api.sageone.com/accounts/v2/incomes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "income[date]=01/08/2014" \ -d "income[amount]=100.0" \ -d "income[tax_amount]=20.0" \ -d "income[tax_percentage_rate]=20.0" \ -d "income[tax_code_id]=1" \ -d "income[source_id]=434" \ -d "income[destination_id]=415" \ -d "income[payment_method_id]=2"
{ "id": 527, "date": "01/08/2014", "invoice_date": "01/08/2014", "amount": "100.0", "tax_amount": "20.0", "gross_amount": "120.0", "tax_percentage_rate": "20.0", "tax_code": { "id": 1, "$key": 1 }, "tax_scheme_period_id": 11, "reference": null, "contact": { "$key": null }, "source": { "id": 434, "$key": 434 }, "destination": { "id": 415, "$key": 415 }, "payment_method": { "id": 2, "$key": 2 }, "voided": false, "lock_version": 0, "$key": 527 }
Updates an existing Income transaction.
date
string
The date of the Income in the format dd/mm/yyyy.
amount
decimal
The net amount of the Income, maximum value 99999999.99
tax_amount
decimal
The tax amount of the Income, maximum value 99999999.99
tax_percentage_rate
decimal
The tax rate percentage for the Income.
tax_code
integer
The ID of the Tax Rate for this transaction.
source_id
integer
The ID of the Income Type.
destination_id
payment_method_id
integer
The ID of the Income Method.
invoice_date
string
The date of the invoice associated with the Income if applicable. In the format dd/mm/yyyy.
reference
string
The reference of the Income.
contact_id
is_tax_included
boolean
Set to 1 if the amount includes tax.
$ curl -X PUT https://api.sageone.com/accounts/v2/incomes/527 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "income[date]=01/08/2014" \ -d "income[amount]=200.0" \ -d "income[tax_amount]=40.0" \ -d "income[tax_percentage_rate]=20.0" \ -d "income[tax_code_id]=1" \ -d "income[source_id]=434" \ -d "income[destination_id]=415" \ -d "income[payment_method_id]=2"
{ "id": 527, "date": "01/08/2014", "invoice_date": "01/08/2014", "amount": "200.0", "tax_amount": "40.0", "gross_amount": "240.0", "tax_percentage_rate": "20.0", "tax_code": { "id": 1, "$key": 1 }, "tax_scheme_period_id": 11, "reference": null, "contact": { "$key": null }, "source": { "id": 434, "$key": 434 }, "destination": { "id": 415, "$key": 415 }, "payment_method": { "id": 2, "$key": 2 }, "voided": false, "lock_version": 0, "$key": 527 }
Deletes an existing Income transaction.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/incomes/522 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 522, "date": "15/10/2012", "invoice_date": "", "amount": "44.0", "tax_amount": "0.0", "gross_amount": "44.0", "tax_percentage_rate": "0.0", "tax_code": { "id": 5, "$key": 5 }, "tax_scheme_period_id": 11, "reference": "", "contact": { "id": 375, "$key": 375 }, "source": { "id": 454, "$key": 454 }, "destination": { "id": 416, "$key": 416 }, "payment_method": { "id": 1, "$key": 1 }, "voided": true, "lock_version": 1, "$key": 522 }
This resource allows you to read and update invoice settings.
sales_invoice_prefix
string
Current Prefix for Sales Invoices selected by the user
sales_invoice_next_number
integer
Current next Number for Sales Invoices for current Sales Invoice Prefix
quote_prefix
string
Current Prefix for Sales Quotes selected by the user
quote_next_number
integer
Current next Number for Sales Quotes for current Sales Quotes Prefix
sales_credit_note_prefix
string
Current Prefix for Sales Credit Notes selected by the user (next number will be sales_invoice_next_number)
terms_and_conditions
string
Terms and conditions for Sales Invoices and Sales Quotes
customer_credit_days
integer
Days between Sales Invoice date and due date.
supplier_credit_days
integer
Days between Purchase Invoice date and due date.
quote_delay_days
integer
Days between Sales Quote date and due date.
default_email_message_for_sales_invoice
string
Default Email text for Sales Invoices.
default_email_message_for_sales_quote
string
Default Email for Sales Quotes.
default_email_message_for_sales_credit_note
string
Default Email for Sales Credit Notes.
$key
integer
This is the SData key.
{ "$key": 1, "sales_invoice_prefix": "SI-", "sales_invoice_next_number": 1, "quote_prefix": "SQ-", "quote_next_number": 2, "sales_credit_note_prefix": "SCN-", "terms_and_conditions": "Terms and conditions", "customer_credit_days": 30, "supplier_credit_days": 30, "quote_delay_days": 30, "default_email_message_for_sales_invoice": "Email for Sales Invoices", "default_email_message_for_sales_quote": "Email for Sales Quotes", "default_email_message_for_sales_credit_note": "Email for Sales Credit Notes" }
Responds with the invoice settings for the business.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/invoice_settings \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$key": 1, "sales_invoice_prefix": "SI-", "sales_invoice_next_number": 1, "quote_prefix": "SQ-", "quote_next_number": 2, "sales_credit_note_prefix": "SCN-", "terms_and_conditions": "Terms and conditions", "customer_credit_days": 30, "supplier_credit_days": 30, "quote_delay_days": 30, "default_email_message_for_sales_invoice": "Email for Sales Invoices", "default_email_message_for_sales_quote": "Email for Sales Quotes", "default_email_message_for_sales_credit_note": "Email for Sales Credit Notes" }
Updates the invoice settings.
sales_invoice_prefix
string
Current Prefix for Sales Invoices selected by the user (maximum 255 characters)
sales_invoice_next_number
integer
Current next Number for Sales Invoices for current Sales Invoice Prefix
quote_prefix
string
Current Prefix for Sales Quotes selected by the user (maximum 255 characters)
quote_next_number
integer
Current next Number for Sales Quotes for current Sales Quotes Prefix
sales_credit_note_prefix
string
Current Prefix for Sales Credit Notes selected by the user (next number will be sales_invoice_next_number) (maximum 255 characters)
terms_and_conditions
string
Terms and conditions for Sales Invoices and Sales Quotes
customer_credit_days
integer
Days between Sales Invoice date and due date.
supplier_credit_days
integer
Days between Purchase Invoice date and due date.
quote_delay_days
integer
Days between Sales Quote date and due date.
default_email_message_for_sales_invoice
string
Default Email text for Sales Invoices. (no limit)
default_email_message_for_sales_quote
string
Default Email for Sales Quotes. (no limit)
default_email_message_for_sales_credit_note
string
Default Email for Sales Credit Notes. (no limit)
$ curl -X PUT https://api.sageone.com/accounts/v2/invoice_settings \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "invoice_settings[sales_invoice_prefix]=SI2-" \ -d "invoice_settings[sales_invoice_next_number]=2" \ -d "invoice_settings[quote_prefix]=SQ2-" \ -d "invoice_settings[quote_next_number]=3" \ -d "invoice_settings[sales_credit_note_prefix]=SCN2-" \ -d "invoice_settings[terms_and_conditions]=Another Terms and Conditions" \ -d "invoice_settings[customer_credit_days]=60" \ -d "invoice_settings[supplier_credit_days]=60" \ -d "invoice_settings[quote_delay_days]=60" \ -d "invoice_settings[default_email_message_for_sales_invoice]=Another Email for Sales Invoices" \ -d "invoice_settings[default_email_message_for_sales_quote]=Another Email for Sales Quotes" \ -d "invoice_settings[default_email_message_for_sales_credit_note]=Another Email for Sales Credit Notes"
{ "$key": 1, "sales_invoice_prefix": "SI2-", "sales_invoice_next_number": 2, "quote_prefix": "SQ2-", "quote_next_number": 3, "sales_credit_note_prefix": "SCN2-", "terms_and_conditions": "Another Terms and conditions", "customer_credit_days": 60, "supplier_credit_days": 60, "quote_delay_days": 60, "default_email_message_for_sales_invoice": "Another Email for Sales Invoices", "default_email_message_for_sales_quote": "Another Email for Sales Quotes", "default_email_message_for_sales_credit_note": "Another Email for Sales Credit Notes" }
This refers to the ledger account Types in Sage One.
This resource provides a look up of the ledger account types in Sage One.
id
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger Account Type.
$key
integer
This is the SData key.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
{ "id": 8, "name": "Ativos Correntes", "$symbol": "CURRENT_ASSETS", "$key": 8 }
Responds with all ledger account types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/ledger_account_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 14, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 8, "name": "Ativos Correntes", "$symbol": "CURRENT_ASSETS", "$key": 8 }, { "id": 6, "name": "Ativos fixos", "$symbol": "FIXED_ASSETS", "$key": 6 }, { "id": 7, "name": "Ativos não correntes", "$symbol": "FUTURE_ASSETS", "$key": 7 }, { "id": 9, "name": "Banco", "$symbol": "BANK", "$key": 9 }, { "id": 10, "name": "Capital", "$symbol": "EQUITY", "$key": 10 }, { "id": 5, "name": "Gastos de depreciação e de amortização", "$symbol": "DEPRECIATION", "$key": 5 }, { "id": 3, "name": "Gastos diretos", "$symbol": "DIRECT_EXPENSES", "$key": 3 }, { "id": 4, "name": "Gastos indiretos", "$symbol": "OVERHEADS", "$key": 4 }, { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, { "id": 11, "name": "Passivos correntes", "$symbol": "CURRENT_LIABILITY", "$key": 11 }, { "id": 12, "name": "Passivos não correntes", "$symbol": "FUTURE_LIABILITY", "$key": 12 }, { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, { "id": 14, "name": "Subsídios à exploração", "$symbol": "SUBSIDY", "$key": 14 }, { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 } ] }
This resource provides a look up of the ledger accounts in Sage One.
id
integer
The ID of the ledger account
display_name
string
The ledger account display name
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
integer
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
ledger_account_type
ledger_account_type
$url
string
$key
integer
This is the SData key.
{ "id": 1, "display_name": "Caixa", "nominal_code": 111, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 8, "name": "Ativos Correntes", "$symbol": "CURRENT_ASSETS", "$key": 8 }, "$url": "/accounts/v2/ledger_accounts/1", "$key": 1 }
Responds with all Ledger Accounts.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/ledger_accounts \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 88, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "display_name": "Caixa", "nominal_code": 111, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 8, "name": "Ativos Correntes", "$symbol": "CURRENT_ASSETS", "$key": 8 }, "$url": "/accounts/v2/ledger_accounts/1", "$key": 1 }, { "#...": "#..." } ] }
Responds with the Ledger Account for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/ledger_accounts/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "display_name": "Caixa", "nominal_code": 111, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 8, "name": "Ativos Correntes", "$symbol": "CURRENT_ASSETS", "$key": 8 }, "$url": "/accounts/v2/ledger_accounts/1", "$key": 1 }
This refers to the payment methods in Sage One.
This resource provides a look up of the payment methods in Sage One.
id
integer
The ID of the Payment Method.
name
string
The Payment Method name
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
{ "id": 1, "name": "Recibo Banco", "$symbol": "BANK_RECEIPT", "$key": 1 }
Responds with all Payment Methods.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/payment_methods \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 6, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Recibo Banco", "$symbol": "BANK_RECEIPT", "$key": 1 }, { "id": 2, "name": "Recibo Dinheiro", "$symbol": "CASH_RECEIPT", "$key": 2 }, { "id": 3, "name": "Cheque", "$symbol": "CHEQUE_IN_HAND", "$key": 3 }, { "id": 4, "name": "Pagamento ao Banco", "$symbol": "BANK_PAYMENT", "$key": 4 }, { "id": 5, "name": "Pagamento a Dinheiro", "$symbol": "CASH_PAYMENT", "$key": 5 }, { "id": 6, "name": "Pagamento a Cartão de Crédito", "$symbol": "CREDIT_CARD_PAYMENT", "$key": 6 } ] }
This is called rate frequency in Sage One and refers to the chargeable period of a service. For example, you may charge by the hour or by the day.
This resource provides a look up of the period types in Sage One.
id
integer
The ID of the Period Type.
name
string
The name of the Period Type.
$key
integer
This is the SData key.
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
{ "id": 1, "name": "Annually", "$symbol": "ANNUALLY", "$key": 1 }
Responds with all Period Types.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/period_types \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 7, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Annually", "$symbol": "ANNUALLY", "$key": 1 }, { "id": 2, "name": "Daily", "$symbol": "DAILY", "$key": 2 }, { "id": 3, "name": "Hourly", "$symbol": "HOURLY", "$key": 3 }, { "id": 4, "name": "Monthly", "$symbol": "MONTHLY", "$key": 4 }, { "id": 5, "name": "Quarterly", "$symbol": "QUARTERLY", "$key": 5 }, { "id": 6, "name": "Weekly", "$symbol": "WEEKLY", "$key": 6 }, { "id": 7, "name": "Fixed Rate", "$symbol": "FIXED_RATE", "$key": 7 } ] }
Responds with the Period Type for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/period_types/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "name": "Annually", "$symbol": "ANNUALLY", "$key": 1 }
This resource allows you to read, add, update and delete products in Sage One.
id
integer
The ID of the product.
product_code
string
Product code (maximum of 255 characters).
description
string
Product description
ledger_account
ledger_account
The ledger account type
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
nominal_code
string
tax_code
tax_code
The Tax code of the ledger account
Toggle Child Attributes$key
integer
This is the SData key.
ledger_account_type
ledger_account_type
The ledger account type
Toggle Child Attributesid
integer
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
tax_rate
tax_rate
The tax rate
Toggle Child Attributesid
integer
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
cost_price
decimal
The cost price of the product
sales_price
decimal
The sales price of the product
notes
string
Any notes associated with the product
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "id": 13, "product_code": "PR3", "description": "Produto 3", "ledger_account": { "id": 107, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "$key": null }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/107", "$key": 107 }, "cost_price": "6.0", "sales_price": "34.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notas5", "$url": "/accounts/v2/products/13", "$key": 13 }
Responds with all Products.
If required, you can include the optional parameters below in your request URL to filter the response by product description.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/products \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 2, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "product_code": "product 2", "description": "test product 2", "ledger_account": { "id": 29, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/29", "$key": 29 }, "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "", "$url": "/accounts/v2/products/1", "$key": 1 }, { "#...": "#..." } ] }
Responds with the Product for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/products/4 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 4, "product_code": "product 5", "description": "test product 5", "ledger_account": { "id": 29, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/29", "$key": 29 }, "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notes for product", "$url": "/accounts/v2/products/4", "$key": 4 }
Creates a new Product.
product_code
string
The product code, maximum 30 characters.
description
string
The product description; has a maximum of 255 characters.
ledger_account_id
integer
The type of product. Only accepts categories of type Revenue
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
cost_price
decimal
The cost of the product (maximum value of 99,999,999)
sales_price
decimal
The sale price of the product (maximum value of 99,999,999)
notes
string
Any notes associated with the product (maximum of 500 characters).
$ curl -X POST https://api.sageone.com/accounts/v2/products \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "product[item_code]=product 5" \ -d "product[description]=test product 5" \ -d "product[cost_price]=230.00" \ -d "product[ledger_account_id]=29" \ -d "product[sales_price]=230.00" \ -d "product[unit_type_id]=1" \ -d "product[tax_rate_id]=1" \ -d "product[notes]=notes for product"
{ "id": 4, "product_code": "product 5", "description": "test product 5", "ledger_account": { "id": 29, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/29", "$key": 29 }, "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notes for product", "$url": "/accounts/v2/products/4", "$key": 4 }
Updates an existing Product.
description
string
The product description, maximum 100 characters.
product_code
string
Product code, maximum of 30 characters.
ledger_account_id
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
cost_price
decimal
The cost price of the product
sales_price
decimal
The sales price of the product
notes
string
Any notes associated with the product
$ curl -X PUT https://api.sageone.com/accounts/v2/products/4 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "product[description]=nice product" \ -d "product[notes]=a variant of product 1"
{ "id": 4, "product_code": "product 5", "description": "nice product", "ledger_account": { "id": 29, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/29", "$key": 29 }, "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "a variant of product 1", "$url": "/accounts/v2/products/4", "$key": 4 }
Deletes an existing Product.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/products/4 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 4, "product_code": "product 5", "description": "portugise product", "ledger_account": { "id": 29, "display_name": "Vendas de Mercadorias", "nominal_code": 711, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 1, "name": "Vendas", "$symbol": "SALES", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/29", "$key": 29 }, "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "a variant of product 1", "$url": "/accounts/v2/products/4", "$key": 4 }
This resource allows you to read, add, update and delete purchase credit notes in Sage One.
id
integer
The ID of the Purchase Credit Note.
{ "id":1042, "status": { "id":3, "$key":3 }, "due_date":"", "date":"19/06/2014", "void_reason":null, "outstanding_amount":"0.0", "total_net_amount":"20.0", "total_tax_amount":"0.0", "tax_scheme_period_id":11, "contact": { "id":371, "$key":371 }, "contact_name":"Bob", "main_address":null, "delivery_address":null, "delivery_address_same_as_main":false, "reference":"", "notes":"", "terms_and_conditions":null, "lock_version":1, "line_items": [ { "id":165, "description":"car", "quantity":"2.0", "unit_price":"10.0", "net_amount":"20.0", "tax_amount":"0.0", "tax_code": { "id":5, "$key":5 }, "tax_rate_percentage":"0.0", "unit_price_includes_tax":false, "ledger_account": { "id":3361, "$key":3361 }, "product_code":null, "product": { "$key":null }, "service": { "$key":null }, "lock_version":0, "$key":165 } ], "$key":1042 }
Responds with all Purchase Credit Notes.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_credit_notes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults":1, "$startIndex":0, "$itemsPerPage":20, "$resources": [ { "id":1042, "status": { "id":3, "$key":3 }, "due_date":"", "date":"19/06/2014", "void_reason":null, "outstanding_amount":"0.0", "total_net_amount":"20.0", "total_tax_amount":"0.0", "tax_scheme_period_id":11, "contact": { "id":371, "$key":371 }, "contact_name":"Bob", "main_address":null, "delivery_address":null, "delivery_address_same_as_main":false, "reference":"", "notes":"", "terms_and_conditions":null, "lock_version":1, "line_items": [ { "id":165, "description":"car", "quantity":"2.0", "unit_price":"10.0", "net_amount":"20.0", "tax_amount":"0.0", "tax_code": { "id":5, "$key":5 }, "tax_rate_percentage":"0.0", "unit_price_includes_tax":false, "ledger_account": { "id":3361, "$key":3361 }, "product_code":null, "product": { "$key":null }, "service": { "$key":null }, "lock_version":0, "$key":165 } ], "$key":1042 } ] }
Responds with the Purchase Credit Note for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_credit_notes/65 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id":1042, "status": { "id":3, "$key":3 }, "due_date":"", "date":"19/06/2014", "void_reason":null, "outstanding_amount":"0.0", "total_net_amount":"20.0", "total_tax_amount":"0.0", "tax_scheme_period_id":11, "contact": { "id":371, "$key":371 }, "contact_name":"Bob", "main_address":null, "delivery_address":null, "delivery_address_same_as_main":false, "reference":"", "notes":"", "terms_and_conditions":null, "lock_version":1, "line_items": [ { "id":165, "description":"car", "quantity":"2.0", "unit_price":"10.0", "net_amount":"20.0", "tax_amount":"0.0", "tax_code": { "id":5, "$key":5 }, "tax_rate_percentage":"0.0", "unit_price_includes_tax":false, "ledger_account": { "id":3361, "$key":3361 }, "product_code":null, "product": { "$key":null }, "service": { "$key":null }, "lock_version":0, "$key":165 } ], "$key":1042 }
Creates a new Purchase Credit Note.
contact_id
integer
The ID of the Contact.
This should be the supplier (contact_type 2) associated with the credit note.
contact_name
string
The name of the contact associated with the credit note. This should be the contact[name_and_company_name] from the specified contact.
date
string
The credit note date in the format dd/mm/yyyy.
line_items_attributes[0..*][]
Line Items
The line items on the credit note.
Toggle Child Parametersdescription
string
The description of the line item, maximum 60 characters.
quantity
decimal
The number of units on the line item.
unit_price
decimal
The unit cost of the line item.
tax_code_id
integer
The ID of the Tax Rate for this transaction.
ledger_account_id
integer
The ID of the Ledger Account.
tax_amount
decimal
The tax amount of the line item.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
reference
string
The credit note reference.
notes
string
Any additional information, maximum 1000 characters.
$ curl -X POST https://api.sageone.com/accounts/v2/purchase_credit_notes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "purchase_invoice_credit_note[invoice_id]=1018" \ -d "purchase_invoice_credit_note[contact_id]=371" \ -d "purchase_invoice_credit_note[contact_name]=Bob" \ -d "purchase_invoice_credit_note[date]=01/01/2012" \ -d "purchase_invoice_credit_note[line_items_attributes][0][description]=Whiteboard%20Eraser" \ -d "purchase_invoice_credit_note[line_items_attributes][0][quantity]=5.0" \ -d "purchase_invoice_credit_note[line_items_attributes][0][unit_price]=4.59" \ -d "purchase_invoice_credit_note[line_items_attributes][0][tax_code_id]=1" \ -d "purchase_invoice_credit_note[line_items_attributes][0][ledger_account_id]=3361"
{ "id": 1018, "status": { "id": 1, "$key": 1 }, "due_date": "", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "22.95", "total_net_amount": "22.95", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "Whiteboard Eraser", "quantity": "5.0", "unit_price": "4.59", "net_amount": "22.95", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 0, "$key": 137 } ], "$key": 1018 }
Delete the specified Purchase Credit Note.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_credit_notes/1039 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id":1042, "status": { "id":4, "$key":4 }, "due_date":"", "date":"19/06/2014", "void_reason":"no void reason supplied", "outstanding_amount":"0.0", "total_net_amount":"20.0", "total_tax_amount":"0.0", "tax_scheme_period_id":11, "contact": { "id":371, "$key":371 }, "contact_name":"Bob", "main_address":null, "delivery_address":null, "delivery_address_same_as_main":false, "reference":"", "notes":"", "terms_and_conditions":null, "lock_version":2, "line_items": [ { "id":165, "description":"car", "quantity":"2.0", "unit_price":"10.0", "net_amount":"20.0", "tax_amount":"0.0", "tax_code": { "id":5, "$key":5 }, "tax_rate_percentage":"0.0", "unit_price_includes_tax":false, "ledger_account": { "id":3361, "$key":3361 }, "product_code":null, "product": { "$key":null }, "service": { "$key":null }, "lock_version":0, "$key":165 } ], "$key":1042 }
This resource allows you to read, add, update and delete purchase invoices and payments in Sage One.
id
integer
The ID of the Purchase Invoice.
status[]
Payment Status
The payment status of the Purchase Invoice.
Toggle Child Attributesid
integer
The ID of the Payment Status.
$key
integer
This is the SData key.
due_date
string
The payment due date of the invoice, in the format dd/mm/yyyy.
date
string
The invoice date in the format dd/mm/yyyy.
void_reason
string
The void reason of the Purchase Invoice.
outstanding_amount
decimal
The amount outstanding for the Purchase Invoice.
total_net_amount
decimal
The net amount of the Purchase Invoice.
total_tax_amount
decimal
The tax amount of the Purchase Invoice.
tax_scheme_period_id
integer
The ID of the tax period for the Purchase Invoice.
contact[]
integer
The ID of the contact to be associated with the purchase invoice. This must be a supplier (contact_type 2).
Toggle Child Attributesid
integer
The ID of the Contact.
$key
integer
This is the SData key.
contact_name
string
The name of the contact associated with the invoice. This should be the contact[name_and_company_name] from the ID of the specified contact.
main_address
string
The main address of the contact to be associated with the Purchase Invoice.
delivery_address
string
The delivery address of the contact to be associated with the Purchase Invoice.
delivery_address_same_as_main
boolean
True if the delivery address is the same as the main address.
reference
string
The Purchase Invoice reference.
notes
string
Any additional information, maximum 1000 characters.
terms_and_conditions
string
Terms and conditions associated with the Purchase Invoice.
line_items[]
Contact
Toggle Child Attributesid
integer
The ID of the line item to update/delete. When updating, if this is not specified a new line item is created.
description
string
The description of the line item, maximum 60 characters.
quantity
decimal
The number of units on the line item.
unit_price
decimal
The unit cost of the line item.
net_amount
decimal
The net amount of the line item.
tax_amount
decimal
The tax amount of the line item.
tax_code[]
Tax Code
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
$key
integer
This is the SData key.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
unit_price_includes_tax
boolean
True if the line item price includes tax.
ledger_account[]
Ledger Account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
$key
integer
This is the SData key.
product_code
string
The product code for the line item.
product[]
Product
Toggle Child Attributesid
integer
The ID of the Product.
$key
integer
This is the SData key.
service[]
Service
Toggle Child Attributesid
integer
The ID of the Service.
$key
integer
This is the SData key.
{ "id": 1017, "status": { "id": 1, "$key": 1 }, "due_date": "01/02/2012", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "50.0", "total_net_amount": "50.0", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "car", "quantity": "5.0", "unit_price": "10.0", "net_amount": "50.0", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 0, "$key": 137 } ], "$key": 1017 }
Responds with all purchase invoices, including the ones that are voided already.
If required, you can include the optional parameters below in your request URL to filter the response by date range, contact ID or payment status ID.
contact
string
Use this to filter by contact_id. For example, /accounts/v2/purchase_invoices?contact=34
status
string
Use this to filter by the invoice payment status. You must supply the ID of the status. For example, to get all part paid invoices, use /accounts/v2/purchase_invoices?status=2
search
string
Use this to filter by contact_name or reference (not case sensitive). For example, accounts/v2/purchase_invoices?search=fred or /accounts/v2/purchase_invoices?search=PI-34
from_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
You can limit the response to instances created in a date range. You must supply both the from_date and the to_date. For example, /accounts/v2/purchase_invoices?from_date=01/01/2012&to_date=31/12/2012
to_date
$ curl https://api.sageone.com/accounts/v2/purchase_invoices?from_date=01/01/2012&to_date=01/01/2012 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1017, "status": { "id": 1, "$key": 1 }, "due_date": "01/02/2012", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "50.0", "total_net_amount": "50.0", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "deductible_percentage": "100.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "car", "quantity": "5.0", "unit_price": "10.0", "net_amount": "50.0", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 0, "$key": 137 } ], "$key": 1017 } ] }
Responds with the Purchase Invoice for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/1017 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1017, "status": { "id": 1, "$key": 1 }, "due_date": "01/02/2012", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "50.0", "total_net_amount": "50.0", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "deductible_percentage": "100.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "car", "quantity": "5.0", "unit_price": "10.0", "net_amount": "50.0", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 0, "$key": 137 } ], "$key": 1017 }
Creates a new Purchase Invoice.
contact_id
integer
The ID of the Contact.
This should be the supplier (contact_type 2) associated with the invoice.
contact_name
string
The name of the contact associated with the invoice. This should be the contact[name_and_company_name] from the specified contact.
due_date
string
The payment due date of the invoice, in the format dd/mm/yyyy.
date
string
The invoice date in the format dd/mm/yyyy.
line_items_attributes[0..*][]
Line Items
The line items on the invoice.
Toggle Child Parametersdescription
string
The description of the line item, maximum 60 characters.
quantity
decimal
The number of units on the line item.
unit_price
decimal
The unit cost of the line item.
tax_code_id
integer
The ID of the Tax Rate for this transaction.
ledger_account_id
integer
The ID of the Ledger Account.
tax_amount
decimal
The tax amount of the line item.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
reference
string
The Purchase Invoice reference.
notes
string
Any additional information, maximum 1000 characters.
$ curl -X POST https://api.sageone.com/accounts/v2/purchase_invoices \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "purchase_invoice[contact_id]=371" \ -d "purchase_invoice[contact_name]=Bob" \ -d "purchase_invoice[due_date]=01/02/2012" \ -d "purchase_invoice[date]=01/01/2012" \ -d "purchase_invoice[line_items_attributes][0][description]=Whiteboard%20Eraser" \ -d "purchase_invoice[line_items_attributes][0][quantity]=5.0" \ -d "purchase_invoice[line_items_attributes][0][unit_price]=4.59" \ -d "purchase_invoice[line_items_attributes][0][tax_code_id]=1" \ -d "purchase_invoice[line_items_attributes][0][ledger_account_id]=3361"
{ "id": 1018, "status": { "id": 1, "$key": 1 }, "due_date": "01/02/2012", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "22.95", "total_net_amount": "22.95", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "deductible_percentage": "100.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "Whiteboard Eraser", "quantity": "5.0", "unit_price": "4.59", "net_amount": "22.95", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 0, "$key": 137 } ], "$key": 1018 }
Updates an existing Purchase Invoice.
contact_id
integer
The ID of the Contact.
The ID of the contact to be associated with the Purchase Invoice. This must be a supplier (contact_type 2).
contact_name
string
The name of the contact associated with the invoice. This should be the contact[name_and_company_name] from the ID of the specified contact.
due_date
string
The payment due date of the invoice, in the format dd/mm/yyyy.
date
string
The invoice date in the format dd/mm/yyyy.
line_items_attributes[0..*][]
Line Items
The line items on the invoice.
Toggle Child Parametersid
integer
The ID of the item line that you want to update. If this is not provided here, a new line will be created.
description
string
The description of the line item, maximum 60 characters.
quantity
decimal
The number of units on the line item.
unit_price
decimal
The unit cost of the line item.
tax_code_id
integer
The ID of the Tax Rate for this transaction.
ledger_account_id
integer
The ID of the Ledger Account.
tax_amount
decimal
The tax amount of the line item.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
_destroy
boolean
Set to 1 if you want to delete the line item.
reference
string
The Purchase Invoice reference.
notes
string
Any additional information, maximum 1000 characters.
$ curl -X PUT https://api.sageone.com/accounts/v2/purchase_invoices/1018 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "purchase_invoice[contact_id]=371" \ -d "purchase_invoice[contact_name]=Bob" \ -d "purchase_invoice[due_date]=01/02/2012" \ -d "purchase_invoice[date]=01/01/2012" \ -d "purchase_invoice[line_items_attributes][0][id]=137 -d "purchase_invoice[line_items_attributes][0][description]=Whiteboard%20Eraser" \ -d "purchase_invoice[line_items_attributes][0][quantity]=10.0" \ -d "purchase_invoice[line_items_attributes][0][unit_price]=4.59" \ -d "purchase_invoice[line_items_attributes][0][tax_code_id]=1" \ -d "purchase_invoice[line_items_attributes][0][ledger_account_id]=3361"
{ "id": 1018, "status": { "id": 1, "$key": 1 }, "due_date": "01/02/2012", "date": "01/01/2012", "void_reason": null, "outstanding_amount": "45.9", "total_net_amount": "45.9", "total_tax_amount": "0.0", "tax_scheme_period_id": 11, "contact": { "id": 371, "$key": 371 }, "contact_name": "Bob", "deductible_percentage": "100.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "reference": null, "notes": null, "terms_and_conditions": null, "lock_version": 0, "line_items": [ { "id": 137, "description": "Whiteboard Eraser", "quantity": "10.0", "unit_price": "4.59", "net_amount": "45.9", "tax_amount": "0.0", "tax_code": { "id": 1, "$key": 1 }, "tax_rate_percentage": "0.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3361, "$key": 3361 }, "product_code": null, "product": { "$key": null }, "service": { "$key": null }, "lock_version": 1, "$key": 137 } ], "$key": 1018 }
Delete the specified purchase invoice.
If required, the optional parameter void_reason can be included to specify the reason for deletion.
void_reason
string
The reason the invoice is being voided. If not supplied, this defaults to ‘no void reason supplied’.
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_invoices/1039 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "purchase_invoice":{ "artefact_number":null, "artefact_number_prefix":null, "business_id":11, "carriage":"0.0", "carriage_tax_code_id":null, "carriage_tax_rate_percentage":"0.0", "contact_id":625, "contact_name":"My Super New Updated Name", "created_at":"2014-06-19T08:39:40+01:00", "date":"2014-06-01", "delivery_address":null, "delivery_address_same_as_main":false, "due_date":"2014-07-01", "email_to":null,"id":1039, "is_opening_balance":false, "lock_version":3, "deductible_percentage": "100.0", "main_address":null, "notes":"", "outstanding_amount":"0.0", "pdf_file_id":null, "reference":"123", "status_id":4, "tax_scheme_period_id":11, "terms_and_conditions":null, "total_net_amount":"79.0", "total_tax_amount":"15.8", "updated_at":"2014-06-19T08:58:39+01:00", "void_reason":"no void reason supplied", "$key":1039 }, "$key":1039 }
Responds with all Payments associated with the specified Purchase Invoice.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/1017/payments \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults":1, "$startIndex":0, "$itemsPerPage":20, "$resources": [ { "id":2483, "date":"31/07/2014", "reference":"", "voided":false, "amount":"20.0", "source": { "id":415, "$key":415 }, "destination": { "id":417, "$key":417 }, "lock_version":0, "$key":2483 } ] }
Responds with the Purchase Invoice Payment for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/1017/payments/2483 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id":2483, "date":"31/07/2014", "reference":"", "voided":false, "amount":"20.0", "source": { "id":415, "$key":415 }, "destination": { "id":417, "$key":417 }, "lock_version":0, "$key":2483 }
Creates a Payment associated with the specified Purchase Invoice.
amount
decimal
The amount of the payment.
date
string
The payment date in the format dd/mm/yyyy.
reference
string
The payment reference.
source_id
$ curl -X POST https://api.sageone.com/accounts/v2/purchase_invoices/1018/payments \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "purchase_invoice_payment[amount]=25.0" \ -d "purchase_invoice_payment[date]=01/08/2014" \ -d "purchase_invoice_payment[reference]=10023" \ -d "purchase_invoice_payment[source_id]=415"
{ "id":2489, "date":"01/08/2014", "reference":"10023", "voided":false, "amount":"25.0", "source":{ "id":415, "$key":415 }, "destination":{ "id":417, "$key":417 }, "lock_version":0, "$key":2489 }
Deletes an existing Purchase Invoice Payment.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_invoices/1017/payments/2483 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id":2483, "date":"31/07/2014", "reference":"", "voided":true, "amount":"20.0", "source": { "id":415, "$key":415 }, "destination": { "id":417, "$key":417 }, "lock_version":1, "$key":2483 }
This resource allows you to read, add and delete sales credit notes in Sage One.
id
integer
The ID of the Sales Credit Note.
contact
integer
The ID of the contact to be associated with the sales credit note. This must be a customer (contact_type 1).
contact_name
string
The name of the contact associated with the credit note. This should be the contact[name_and_company_name] from the ID of the specified contact.
invoice_id
integer
The ID of the associated invoice.
artefact_number
string
The actual document number.
status
Payment Status
The payment status of the Sales Credit Note.
Toggle Child Attributesid
integer
The ID of the Payment Status.
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
date
string
The invoice date in the format dd/mm/yyyy.
reference
string
The Sales Credit Note reference.
void_reason
string
The void reason of the Sales Credit Note.
total_net_amount
decimal
The net amount of the Sales Credit Note.
total_tax_amount
decimal
The tax amount of the Sales Credit Note.
main_address
string
Would be taken from associated invoice.
delivery_address
string
Would be taken from associated invoice.
delivery_address_same_as_main
boolean
Would be taken from associated invoice.
notes
string
Any additional information, maximum 1000 characters.
line_items[]
Line Item
Toggle Child Attributesid
integer
The ID of the line item to update/delete. When updating, if this is not specified a new line item is created.
quantity
decimal
The number of units on the line item.
description
string
The description of the line item, maximum 60 characters.
product_code
string
The product code for the line item.
unit_price
decimal
The unit price of the line item.
unit_price_includes_tax
boolean
True if the line item price includes tax.
ledger_account
ledger_account
Ledger Account of Line Item
Toggle Child Attributesid
integer
The ID of the ledger account
display_name
string
The ledger account display name
nominal_code
string
The ledger account nominal code
tax_code
tax_code
The tax code
ledger_account_type
ledger_account_type
The Ledger account type
$key
integer
This is the SData key.
tax_rate[]
Tax Rate
Toggle Child Attributesid
integer
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
net_amount
decimal
The net amount of the line item.
item
Product/Service
The Product/Service of the Line Item
Toggle Child Attributesid
item_id
product_id or service_id
description
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
{ "id": 9, "contact_id": 2, "contact_name": "Sage Stars PT", "invoice_id": 8, "artefact_number": 9, "status": { "id": 3, "name": "Pago", "$symbol": "PAID", "$key": 3 }, "date": "2015-09-30", "due_date": null, "reference": "reference", "void_reason": null, "outstanding": "0.0", "total_net_amount": "4.85", "total_tax_amount": "1.12", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "notes": null, "line_items": [ { "id": 9, "quantity": "1.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 36, "display_name": "Outros rendimentos similares", "nominal_code": 798, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/36", "$key": 36 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "4.85", "$url": "/accounts/v2/sales_credit_notes/9/line_items/9", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "sales_invoice_line_item_id": 1, "$key": 9 } ], "$url": "/accounts/v2/sales_credit_notes/9", "$key": 9 }
Responds with all sales credit notes, including voided ones.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_credit_notes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 9, "contact_id": 2, "contact_name": "Sage Stars PT", "invoice_id": 8, "artefact_number": 9, "status": { "id": 3, "name": "Pago", "$symbol": "PAID", "$key": 3 }, "date": "2015-09-30", "due_date": null, "reference": "reference", "void_reason": null, "outstanding": "0.0", "total_net_amount": "4.85", "total_tax_amount": "1.12", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "notes": null, "line_items": [ { "id": 9, "quantity": "1.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 36, "display_name": "Outros rendimentos similares", "nominal_code": 798, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/36", "$key": 36 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "4.85", "$url": "/accounts/v2/sales_credit_notes/9/line_items/9", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "$key": 9 } ], "$url": "/accounts/v2/sales_credit_notes/9", "$key": 9 } ] }
Responds with the Sales Credit Note for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_credit_notes/9 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 9, "contact_id": 2, "contact_name": "Sage Stars PT", "invoice_id": 8, "artefact_number": 9, "status": { "id": 3, "name": "Pago", "$symbol": "PAID", "$key": 3 }, "date": "2015-09-30", "due_date": null, "reference": "reference", "void_reason": null, "outstanding": "0.0", "total_net_amount": "4.85", "total_tax_amount": "1.12", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "notes": null, "line_items": [ { "id": 9, "quantity": "1.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 36, "display_name": "Outros rendimentos similares", "nominal_code": 798, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/36", "$key": 36 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "4.85", "$url": "/accounts/v2/sales_credit_notes/9/line_items/9", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "sales_invoice_line_item_id": 1, "$key": 9 } ], "$url": "/accounts/v2/sales_credit_notes/9", "$key": 9 }
Creates a new Sales Credit Note.
invoice_id
integer
The ID of the associated invoice.
date
string
The Sales Credit Note date in the format dd/mm/yyyy.
reference
string
The Sales Credit Note reference.
notes
string
Any additional information, maximum 1000 characters.
carriage_net_amount
decimal
The carriage amount for the credit note.
carriage_tax_rate_id
decimal
The tax rate id for the carriage.
line_items[1..*]
Line Item
$ curl -X POST https://api.sageone.com/accounts/v2/sales_credit_notes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "sales_credit_note[invoice_id]=8" \ -d "sales_credit_note[date]=2015-09-30" \ -d "sales_credit_note[reference]=credit note test" \ -d "sales_credit_note[notes]=notes" \ -d "sales_credit_note[carriage_net_amount]=0.00" \ -d "sales_credit_note[carriage_tax_rate_id]=1" \ -d "sales_credit_note[line_items_attributes][0][unit_price_includes_tax]=1" \ -d "sales_credit_note[line_items_attributes][0][quantity]=1.0" \ -d "sales_credit_note[line_items_attributes][0][unit_price]=5.00"
{ "id": 9, "contact_id": 2, "contact_name": "Sage Stars PT", "invoice_id": 8, "artefact_number": 9, "status": { "id": 3, "name": "Pago", "$symbol": "PAID", "$key": 3 }, "date": "2015-09-30", "due_date": null, "reference": "reference", "void_reason": null, "outstanding": "0.0", "total_net_amount": "4.85", "total_tax_amount": "1.12", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "notes": null, "line_items": [ { "id": 9, "quantity": "1.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 36, "display_name": "Outros rendimentos similares", "nominal_code": 798, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/36", "$key": 36 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "4.85", "$url": "/accounts/v2/sales_credit_notes/9/line_items/9", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "sales_invoice_line_item_id": 1, "$key": 9 } ], "$url": "/accounts/v2/sales_credit_notes/9", "$key": 9 }
Void the specified sales credit note.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/sales_credit_notes/9 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 9, "contact_id": 2, "contact_name": "Sage Stars PT", "invoice_id": 8, "artefact_number": 9, "status": { "id": 4, "name": "Cancelado", "$symbol": "VOID", "$key": 4 }, "date": "2015-09-30", "due_date": null, "reference": "reference", "void_reason": "Temporary Reason", "outstanding": "0.0", "total_net_amount": "4.85", "total_tax_amount": "1.12", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "notes": null, "line_items": [ { "id": 9, "quantity": "1.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 36, "display_name": "Outros rendimentos similares", "nominal_code": 798, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 2, "name": "Outros rendimentos e ganhos", "$symbol": "OTHER_INCOME", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/36", "$key": 36 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "4.85", "$url": "/accounts/v2/sales_credit_notes/9/line_items/9", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "$key": 9 } ], "$url": "/accounts/v2/sales_credit_notes/9", "$key": 9 }
This resource allows you to read, add, update and delete sales invoices in Sage One.
id
integer
The ID of the Sales Invoice.
contact
integer
The ID of the contact to be associated with the sales invoice. This must be a customer (contact_type 1).
contact_name
string
The name of the contact associated with the invoice. This should be the contact[name_and_company_name] from the ID of the specified contact.
status
Payment Status
The payment status of the Sales Invoice.
Toggle Child Attributesid
integer
The ID of the Payment Status.
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
date
string
The invoice date in the format dd/mm/yyyy.
due_date
string
The payment due date of the invoice, in the format dd/mm/yyyy.
reference
string
The Sales Invoice reference.
void_reason
string
The void reason of the Sales Invoice.
outstanding
decimal
The outstanding amount for the Sales Invoice.
total_net_amount
decimal
The net amount of the Sales Invoice.
total_tax_amount
decimal
The tax amount of the Sales Invoice.
main_address
string
The main address of the contact to be associated with the Sales Invoice.
delivery_address
string
The delivery address of the contact to be associated with the Sales Invoice.
delivery_address_same_as_main
boolean
True if the delivery address is the same as the main address.
terms_and_conditions
string
Terms and conditions associated with the Sales Invoice.
notes
string
Any additional information, maximum 1000 characters.
line_items[]
Line Item
Toggle Child Attributesid
integer
The ID of the line item to update/delete. When updating, if this is not specified a new line item is created.
quantity
decimal
The number of units on the line item.
description
string
The description of the line item, maximum 60 characters.
product_code
string
The product code for the line item.
unit_price
decimal
The unit selling price of the line item.
unit_price_includes_tax
boolean
True if the line item price includes tax.
ledger_account
ledger_account
Ledger Account of Line Item
Toggle Child Attributesid
integer
The ID of the ledger account
display_name
string
The ledger account display name
nominal_code
string
The ledger account nominal code
tax_code
tax_code
The tax code
ledger_account_type
ledger_account_type
The Ledger account type
$key
integer
This is the SData key.
tax_rate[]
Tax Rate
Toggle Child Attributesid
integer
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
net_amount
decimal
The net amount of the line item.
item
Product/Service
The Product/Service of the Line Item
Toggle Child Attributesid
item_id
product_id od service_id
description
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
payments[]
sales_invoice_payment
The payments made for the Sales Invoice.
Toggle Child Attributesid
integer
The ID of the Sales Invoice Payment.
amount
decimal
Payment amount. Payment amount must be greater than 0 and less than or equal to the outstanding amount.
reference
string
Payment reference(maximum of 255 characters).
bank_account
integer
The bank account to which the payment is made.
Toggle Child Attributesid
integer
account_name
string
Name of the Bank Account (maximum of 255 characters).
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
The date when the payment is made, in the format yyyy-mm-dd.
contact_id
integer
contact_name
string
invoice_id
integer
$key
integer
This is the SData key.
cheque
boolean
The mark to indicate that it is a cheque.
$url
string
The URL for the API call for this resource.
credit_notes[]
credit_notes
Credit Notes of Sales Invoice
carriage_net_amount
decimal
The carriage amount for the invoice.
carriage_tax_rate_percentage
decimal
The tax rate percentage for the carriage.
artefact_number
string
Artefact Number of Sales Invoice
customer_company
string
The company name.
customer_tax_number
integer
The tax number of the customer
includes_tax
boolean
Indicates if the items unit prices include tax.
withholding_tax
decimal
withholding tax rate.
{ "id": 1, "contact_id": 2, "status": { "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }, "date": "2015-09-29", "due_date": "2015-10-28", "reference": "reference", "void_reason": null, "outstanding": "7364.94", "total_net_amount": "5987.76", "total_tax_amount": "1377.18", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "terms_and_conditions": null, "notes": null, "line_items": [ { "id": 1, "quantity": "5.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "1234.59", "unit_price_includes_tax": false, "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "5987.76", "$url": "/accounts/v2/sales_invoices/1/line_items/1", "item": { "id": 1, "description": "test product 2", "$url": "/accounts/v2/products/1", "$key": 1 }, "$key": 1 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/sales_invoices/1", "carriage_net_amount": "0.0", "carriage_tax_rate_percentage": "23.0", "artefact_number": "FT 2015/1", "customer_company": "Telefónica-Mobile PT", "customer_tax_number": "123456789", "includes_tax": false, "withholding_tax": { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, "withholding_tax_amount": "688.59", "$key": 1 }
Responds with all sales invoices, including voided ones.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_invoices \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "contact_id": 2, "status": { "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }, "date": "2015-09-29", "due_date": "2015-10-28", "reference": "reference", "void_reason": null, "outstanding": "7364.94", "total_net_amount": "5987.76", "total_tax_amount": "1377.18", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "terms_and_conditions": null, "notes": null, "line_items": [ { "id": 1, "quantity": "5.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "1234.59", "unit_price_includes_tax": false, "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "5987.76", "$url": "/accounts/v2/sales_invoices/1/line_items/1", "item": { "$key": null }, "$key": 1 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/sales_invoices/1", "carriage_net_amount": "0.0", "carriage_tax_rate_percentage": "23.0", "artefact_number": "FT 2015/1", "customer_company": "Sage Stars PT", "customer_tax_number": "123456789", "includes_tax": false, "withholding_tax": { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, "withholding_tax_amount": "688.59", "$key": 1 } ] }
Responds with the Sales Invoice for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_invoices/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "contact_id": 2, "status": { "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }, "date": "2015-09-29", "due_date": "2015-10-28", "reference": "reference", "void_reason": null, "outstanding": "7364.94", "total_net_amount": "5987.76", "total_tax_amount": "1377.18", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "terms_and_conditions": null, "notes": null, "line_items": [ { "id": 1, "quantity": "5.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "1234.59", "unit_price_includes_tax": false, "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "5987.76", "$url": "/accounts/v2/sales_invoices/1/line_items/1", "item": { "$key": null }, "$key": 1 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/sales_invoices/1", "carriage_net_amount": "0.0", "carriage_tax_rate_percentage": "23.0", "artefact_number": "FT 2015/1", "customer_company": "Sage Stars PT", "customer_tax_number": "123456789", "includes_tax": false, "withholding_tax": { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, "withholding_tax_amount": "688.59", "$key": 1 }
Creates a new Sales Invoice.
contact_id
integer
The ID of the Contact.
The ID of the contact to be associated with the Sales Invoice. This must be a customer (contact_type 1).
customer_name
string
The name of the customer associated with the invoice. This should be the contact[company_name] from the ID of the specified customer.
date
string
The invoice date in the format dd/mm/yyyy.
due_date
string
The payment due date of the invoice, in the format dd/mm/yyyy.
reference
string
The reference of the invoice.
main_address_street_one
string
The main address line one of the customer.
main_address_street_two
string
The main address line two of the customer.
main_address_postcode
string
The main address postcode of the customer.
main_address_locality
string
The main address city of the customer.
main_address_country
string
The main address country of the customer.
delivery_address_street_one
string
The delivery address line one of the customer.
delivery_address_street_two
string
The delivery address line two of the customer.
delivery_address_postcode
string
The delivery address postcode of the customer.
delivery_address_locality
string
The delivery address city of the customer.
delivery_address_country
string
The delivery address country of the customer.
delivery_address_same_as_main
boolean
Set to true or 1 if the main address is the same as the delivery address.
carriage_tax_rate_id
carriage_net_amount
decimal
The carriage amount.
withholding_tax_id
integer
Id of the withholding tax rate.
line_items_attributes[0..*][]
Line Items
The line items on the invoice.
Toggle Child Parametersdescription
string
The description of the line item, maximum 60 characters.
item_id
integer
The ID of the Product.
If the line item relates to a product or a service, you should provide the id here. This does not automatically provide the quantity and unit price. You must provide these as separate parameters.
quantity
decimal
The number of units on the line item.
unit_price
decimal
The unit selling price of the line item.
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
discount_percentage
decimal
The discount percentage for the line item.
$ curl -X POST https://api.sageone.com/accounts/v2/sales_invoices \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "sales_invoice[contact_id]=2" \ -d "sales_invoice[customer_company]=company" \ -d "sales_invoice[date]=2015-09-29" \ -d "sales_invoice[due_date]=2015-10-28" \ -d "sales_invoice[reference]=reference" \ -d "sales_invoice[withholding_tax_id]=2" \ -d "sales_invoice[main_address_street_1]=Rua da Murgueira, 9/9A,Ap. 5785" \ -d "sales_invoice[main_address_street_2]=Zambujal" \ -d "sales_invoice[main_address_postcode]=2611-865" \ -d "sales_invoice[main_address_locality]=Braga" \ -d "sales_invoice[main_address_country_id]=175" \ -d "sales_invoice[delivery_address_street_1]=Rua da Murgueira, 10,Ap. 578" \ -d "sales_invoice[delivery_address_street_2]=Zambujal" \ -d "sales_invoice[delivery_address_postcode]=2611-866" \ -d "sales_invoice[delivery_address_locality]=Braga" \ -d "sales_invoice[delivery_address_country_id]=175" \ -d "sales_invoice[line_items_attributes][0][description]=Whiteboard Eraser" \ -d "sales_invoice[line_items_attributes][0][quantity]=5.0" \ -d "sales_invoice[line_items_attributes][0][unit_price]=1234.59" \ -d "sales_invoice[line_items_attributes][0][tax_rate_id]=1" \ -d "sales_invoice[line_items_attributes][0][discount_percentage]=3.0" \ -d "sales_invoice[line_items_attributes][0][unit_price_includes_tax]=0" \ -d "sales_invoice[line_items_attributes][0][item_id]=1" \ -d "sales_invoice[delivery_address_same_as_main]=0" \ -d "sales_invoice[carriage_net_amount]=0.00" \ -d "sales_invoice[carriage_tax_rate_id]=1"
{ "id": 1, "contact_id": 2, "status": { "id": 1, "name": "Por pagar", "$symbol": "UNPAID", "$key": 1 }, "date": "2015-09-29", "due_date": "2015-10-28", "reference": "reference", "void_reason": null, "outstanding": "7364.94", "total_net_amount": "5987.76", "total_tax_amount": "1377.18", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "terms_and_conditions": null, "notes": null, "line_items": [ { "id": 1, "quantity": "5.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "1234.59", "unit_price_includes_tax": false, "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "5987.76", "$url": "/accounts/v2/sales_invoices/1/line_items/1", "item": { "$key": null }, "$key": 1 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/sales_invoices/1", "carriage_net_amount": "0.0", "carriage_tax_rate_percentage": "23.0", "artefact_number": "FT 2015/1", "customer_company": "Sage Stars PT", "customer_tax_number": "123456789", "includes_tax": false, "withholding_tax": { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, "withholding_tax_amount": "688.59", "$key": 1 }
Void the specified sales invoice.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/sales_invoices/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "contact_id": 2, "status": { "id": 4, "name": "Cancelado", "$symbol": "VOID", "$key": 4 }, "date": "2015-09-29", "due_date": "2015-10-28", "reference": "reference", "void_reason": "Temporary Reason", "outstanding": "0.0", "total_net_amount": "5987.76", "total_tax_amount": "1377.18", "main_address": "Rua da Murgueira, 9/9A,Ap. 5785\nZambujal\n2611-865 Braga\nPortugal", "delivery_address": "Rua da Murgueira, 10,Ap. 578\nZambujal\n2611-866 Braga\nPortugal", "delivery_address_same_as_main": false, "terms_and_conditions": null, "notes": null, "line_items": [ { "id": 1, "quantity": "5.0", "description": "Whiteboard Eraser", "product_code": null, "unit_price": "1234.59", "unit_price_includes_tax": false, "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "23.0", "net_amount": "5987.76", "$url": "/accounts/v2/sales_invoices/1/line_items/1", "item": { "$key": null }, "$key": 1 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/sales_invoices/1", "carriage_net_amount": "0.0", "carriage_tax_rate_percentage": "23.0", "artefact_number": "FT 2015/1", "customer_company": "Sage Stars PT", "customer_tax_number": "123456789", "includes_tax": false, "withholding_tax": { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, "withholding_tax_amount": "688.59", "$key": 1 }
This refers to the sales quotes in Sage One.
This resource allows you to read, add, update and delete sales quotes in Sage One.
Not available.
Not available.
Responds with all Sales Quotes.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_quotes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \
Not available.
Responds with the Sales Quote for the ID requested.
No parameters required.
Not available.
Not available.
This resource allows you to read, add, update and delete services in Sage One.
id
integer
The ID of the service.
description
string
The service description
ledger_account
ledger_account
The ledger account type
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
nominal_code
string
tax_code
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account.
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
tax_rate
tax_rate
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
$symbol
string
This is a universal semantic identifier for the item.
As this value is always the same regardless of region, you should rely on this value rather than name.
$key
integer
This is the SData key.
notes
string
The notes of the service
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "id": 6, "description": "test service 3", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notes for product", "$url": "/accounts/v2/services/6", "service_code": "service 3", "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "$key": 6 }
Responds with all Services.
If required, you can include the optional parameters below in your request URL to filter the response by service description.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/services \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 2, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 5, "description": "test service 2", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "", "$url": "/accounts/v2/services/5", "service_code": "service 2", "cost_price": "120.0", "sales_price": "120.0", "unit_type": { "$key": null }, "$key": 5 }, { "#...": "#..." } ] }
Responds with the Service for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/services/6 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 6, "description": "test service 3", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notes for product", "$url": "/accounts/v2/services/6", "service_code": "service 3", "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "$key": 6 }
Creates a new Service.
item_code
string
The service code. Must be unique among products and services.
description
string
The service description (maximum of 100 characters).
cost_price
integer
The service cost price
sales_price
decimal
The service unit sales price.
tax_rate_id
integer
The tax rate
notes
string
Any notes for the service (maximum of 500 characters).
$ curl -X POST https://api.sageone.com/accounts/v2/services \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "service[item_code]=service 3" \ -d "service[description]=test service 3" \ -d "service[cost_price]=230.00" \ -d "service[sales_price]=230.00" \ -d "service[unit_type_id]=1" \ -d "service[tax_rate_id]=1" \ -d "service[notes]=notes for product"
{ "id": 6, "description": "test service 3", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "notes for service", "$url": "/accounts/v2/services/6", "service_code": "service 3", "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "$key": 6 }
Updates an existing Service.
item_code
string
The service code. Must be unique among products and services.
description
string
The service description (maximum of 100 characters).
cost_price
integer
The service cost price
sales_price
decimal
The service unit sales price.
tax_rate_id
integer
The service tax rate
notes
string
Any notes for the service (maximum of 500 characters).
$ curl -X PUT https://api.sageone.com/accounts/v2/services/6 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx" \ -d "service[description]=nice service" \ -d "service[notes]=a variant of service 3"
{ "id": 6, "description": "nice service", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "a variant of service 3", "$url": "/accounts/v2/services/6", "service_code": "service 3", "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "$key": 6 }
Deletes an existing Service.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/services/6 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 6, "description": "nice service", "ledger_account": { "id": 33, "display_name": "Prestações de Serviços", "nominal_code": 721, "tax_code": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 13, "name": "Prestação de serviços", "$symbol": "SERVICES", "$key": 13 }, "$url": "/accounts/v2/ledger_accounts/33", "$key": 33 }, "tax_rate": { "id": 1, "name": "Normal", "$symbol": "STANDARD", "$key": 1 }, "notes": "a variant of service 3", "$url": "/accounts/v2/services/6", "service_code": "service 3", "cost_price": "230.0", "sales_price": "230.0", "unit_type": { "id": 1, "name": "Serviço", "$symbol": "Serviço", "$key": 1 }, "$key": 6 }
This refers to the different tax rates in Sage One. For example, standard and zero rated.
This resource provides a look up of the tax rates in Sage One.
id
integer
The ID of the Tax Rate.
name
string
The name of the Tax Rate.
percentage
decimal
The percentage rate of the Tax Rate.
current
boolean
True if the Tax Rate is currently active.
$key
integer
This is the SData key.
{ "id": 1, "name": "Standard", "percentage": "20.0", "current": true, "$key": 1 }
Responds with all Tax Rates.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/tax_rates \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 4, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Normal", "$symbol": "STANDARD", "percentage": "23.0", "$key": 1 }, { "id": 2, "name": "Intermédia", "$symbol": "LOWER", "percentage": "13.0", "$key": 2 }, { "id": 3, "name": "Reduzida", "$symbol": "EXTRALOWER", "percentage": "6.0", "$key": 3 }, { "id": 4, "name": "Isento", "$symbol": "EXEMPT", "percentage": "0.0", "$key": 4 } ] }
Responds with the Tax Rate for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/tax_rates/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "name": "Normal", "$symbol": "STANDARD", "percentage": "23.0", "$key": 1 }
This refers to the different withholding taxes in Sage One. For example, standard and zero rated.
This resource provides a look up of the withholding rates in Sage One.
id
integer
The ID of the Withholding Tax.
name
string
The name of the Withholding Tax.
percentage
decimal
The percentage rate of the Withholding Tax.
$key
integer
This is the SData key.
{ "id": 1, "name": "Name of the Withholding Tax", "percentage": "Percentage of the Withholding Tax", "$key": 1 }
Responds with all Withholding Tax Rates.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/withholding_taxes \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "$totalResults": 6, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }, { "id": 2, "name": "11,5%", "percentage": "0.115", "$key": 2 }, { "id": 3, "name": "16,5%", "percentage": "0.165", "$key": 3 }, { "id": 4, "name": "20%", "percentage": "0.2", "$key": 4 }, { "id": 5, "name": "25%", "percentage": "0.25", "$key": 5 }, { "id": 6, "name": "28%", "percentage": "0.28", "$key": 6 } ] }
Responds with the Withholding Tax Rate for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/withholding_taxes/1 \ -H "Authorization: Bearer xxxxxxxxxx" \ -H "X-Signature: xxxxxxxxxx" \ -H "X-Nonce: xxxxxxxxxx" \ -H "Accept: */*" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: xxxxxxxxxx"
{ "id": 1, "name": "Sem retenção – art. 101º-B, nº1, CIRS", "percentage": "0.0", "$key": 1 }