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": 1, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "product_code": "B0000190", "description": "USB-Ladekabel Marke X (rot)", "ledger_account": { "id": 93, "display_name": "Erlöse 19 % USt", "ledger_account_type": { "id": 7, "name": "Einnahmen", "$key": 7 }, "$key": 93 }, "cost_price": "0.0", "sales_price": "13.37", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$key": 1 }, "sales_price_includes_tax": false, "notes": null, "$key": 1 } ] }
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": "Example Business Ltd", "website": "http://www.example.com", "telephone": "123 555 789", "mobile": "07000 000 000", "street_1": "1007 Mountain Drive", "street_2": null, "city": "Gotham", "county": null, "postcode": null, "country": { "name": "United States", "code": "US" } }
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": "Example Business Ltd", "website": "http://www.example.com", "telephone": "0123 555 678", "mobile": "07000 000 000", "street_1": "1007 Mountain Drive", "street_2": null, "city": "Gotham", "county": null, "postcode": null, "country": { "name": "United States", "code": "US" } }
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]=Updated Business" \ -d "business[website]=http://www.example.com/updated" \ -d "business[telephone]=0111 555 999" \ -d "business[mobile]=07222 555 222" \ -d "business[street_1]=Updated Line 1" \ -d "business[street_2]=Updated Line 2" \ -d "business[city]=Updated City" \ -d "business[county]=Updated County" \ -d "business[postcode]=UPDATE"
{ "name": "Updated Business", "website": "http://www.example.com/updated", "telephone": "0111 555 999", "mobile": "07222 555 222", "street_1": "Updated Line 1", "street_2": "Updated Line 2", "city": "Updated City", "county": "Updated County", "postcode": "UPDATE", "country": { "name": "United Kingdom", "code": "GB" } }
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": "", "sageone_guid": "1abcdefghi23456j7890k1234567l8m9", "services": [ { "uid": "accounts_extra", "name": "Accounts Extra" } ] } ] } }
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": "Joe", "last_name": "Bloggs", "email": "joe.bloggs@example.com" }
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": "Joe", "last_name": "Bloggs", "email": "joe.bloggs@example.com" }
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]=Updated" \ -d "business[last_name]=Name"
{ "first_name": "Updated", "last_name": "Name", "email": "joe.bloggs@example.com" }
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.
$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": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }
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": 6, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }, { "id": 3, "name": "Sparkonto", "$symbol": "SAVINGS", "$key": 3 }, { "id": 2, "name": "Kasse", "$symbol": "CASH_IN_HAND", "$key": 2 }, { "id": 4, "name": "Kreditkarte", "$symbol": "CREDIT_CARD", "$key": 4 }, { "id": 5, "name": "Kreditkonto", "$symbol": "LOAN", "$key": 5 }, { "id": 6, "name": "Sonstige", "$symbol": "OTHER", "$key": 6 } ] }
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": "Bankkonto", "$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": 2, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 2 }
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": 5, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "name": "Entwurf", "$symbol": "DRAFT", "$key": 1 }, { "id": 2, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 2 }, { "id": 3, "name": "Teilzahlung", "$symbol": "PART_PAID", "$key": 3 }, { "id": 4, "name": "Bezahlt", "$symbol": "PAID", "$key": 4 }, { "id": 5, "name": "Storniert", "$symbol": "VOID", "$key": 5 } ] }
This resource allows you to look up your Bank Accounts in Sage One.
account_name
string
The name of the Bank Account.
account_number
string
The Bank Account number.
account_type
account_type
Toggle Child Attributesid
integer
The ID of the Account Type.
name
string
The name of the Bank 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.
balance
decimal
The current balance for the Bank Account.
bic
string
The BIC of the Bank Account.
iban
string
The IBAN of the Bank Account.
id
integer
The ID of the Bank Account.
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
$url
string
The URL for the API call for this resource.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
{ "id": 63, "account_name": "Geschäftskonto", "account_number": "123456600", "account_type": { "id": 1, "name": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }, "ledger_account": { "id": 2294, "display_name": "Geschäftskonto", "nominal_code": 1200, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/2294", "vat_changeable": false, "$key": 2294 }, "balance": "13.37", "iban": "DE61500700240123456600", "bic": "DEUTDEDBFRA", "$url": "/accounts/v2/bank_accounts/63", "$key": 63 }
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": 98, "account_name": "Kasse", "account_number": null, "account_type": { "id": 2, "name": "Kasse", "$symbol": "CASH_IN_HAND", "$key": 2 }, "ledger_account": { "id": 9745, "display_name": "Kasse", "nominal_code": 1000, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/9745", "vat_changeable": false, "$key": 9745 }, "balance": "0.0", "iban": "", "bic": null, "$url": "/accounts/v2/bank_accounts/98", "reconciliation_strategy": "CASH", "$key": 98 }, { "#...": "#..." } ] }
Responds with the Bank Account for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/bank_accounts/99 \ -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": 99, "account_name": "Geschäftskonto Spk. Heidelberg", "account_number": "9876111", "account_type": { "id": 1, "name": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }, "ledger_account": { "id": 9856, "display_name": "Geschäftskonto Spk. Heidelberg", "nominal_code": 1200, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/9856", "vat_changeable": false, "$key": 9856 }, "balance": "0.0", "iban": "DE89672500200009876111", "bic": "SOLADES1HDB", "$url": "/accounts/v2/bank_accounts/99", "reconciliation_strategy": "CASH", "$key": 99 }
Creates a new Bank Account.
account_name
string
The name of the Bank Account (maximum of 255 characters).
account_type_id
integer
The ID of the Account Type. Available Account Type IDs are: 1= Bank Account, 2= Cash Register, 3= Savings Account, 4= Credit Card, 5= Credit Account, 6= Others
balance_date
string
The starting date from balance
iban
string
The account IBAN number, pay attention that this should be a valid IBAN number
account_number
string
The account number of the Bank Account.
$ 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]=Geschäftskonto Spk. Heidelberg" \ -d "bank_account[account_number]=9876111" \ -d "bank_account[account_type_id]=1" \ -d "bank_account[iban]=DE89672500200009876111" \ -d "bank_account[balance_date]=2016-01-01"
{ "id": 99, "account_name": "Geschäftskonto Spk. Heidelberg", "account_number": "9876111", "account_type": { "id": 1, "name": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }, "ledger_account": { "id": 9856, "display_name": "Geschäftskonto Spk. Heidelberg", "nominal_code": 1200, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/9856", "vat_changeable": false, "$key": 9856 }, "balance": "0.0", "iban": "DE89672500200009876111", "bic": "SOLADES1HDB", "$url": "/accounts/v2/bank_accounts/99", "reconciliation_strategy": "CASH", "$key": 99 }
Update the specified Bank Account.
account_name
string
The name of the Bank Account (maximum of 255 characters).
account_number
string
The account number of the Bank Account.
account_type_id
integer
The ID of the Account Type. Available Account Type IDs are: 1= Bank Account, 2= Cash Register
$ curl -X PUT https://api.sageone.com/accounts/v2/bank_accounts/99 \ -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]=Neuer Bankkontoname"
{ "id": 99, "account_name": "Neuer Bankkontoname", "account_number": "9876111", "account_type": { "id": 1, "name": "Bankkonto", "$symbol": "CURRENT", "$key": 1 }, "ledger_account": { "id": 9856, "display_name": "Neuer Bankkontoname", "nominal_code": 1200, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/9856", "vat_changeable": false, "$key": 9856 }, "balance": "0.0", "iban": "DE89672500200009876111", "bic": "SOLADES1HDB", "$url": "/accounts/v2/bank_accounts/99", "reconciliation_strategy": "CASH", "$key": 99 }
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": "Kunde", "$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": "Kunde", "$symbol": "CUSTOMER", "$key": 1 }, { "id": 2, "name": "Lieferant", "$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": "Kunde", "$symbol": "CUSTOMER", "$key": 1 }
This resource allows you to read, add, update and delete Contacts in Sage One.
account_number
integer
The account number of the contact (Debitorennummer, Kreditorennummer).
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.
editable
boolean
Whether this contact may be updated.
id
integer
The ID of the Contact.
mobile
string
The Contact mobile number.
name
string
The name of the Contact.
notes
string
Notes relevant to the Contact.
tax_authentication_number
string
The VAT number for the contact (USt-IdNr.).
tax_eligible
boolean
Whether the contact is tax eligible (Steuerberechtigt).
tax_number
string
The Contact tax reference.
telephone
string
The Contact telephone number.
main_address
address
The Contact main address.
Toggle Child Attributesid
integer
street_one
string
street_two
string
town
string
postcode
string
country
country
Toggle Child Attributesid
integer
The ID of the Country.
code
string
name
string
$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
street_two
string
town
string
postcode
string
country
country
Toggle Child Attributesid
integer
The ID of the Country.
code
string
name
string
$key
integer
This is the SData key.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
{ "id": 341, "company": "Musterfirma GmbH", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "mustermann@example.com", "mobile": "", "name": "Max Mustermann", "notes": null, "tax_number": "", "telephone": "+49173 3333333", "main_address": { "$key": null }, "delivery_address": { "$key": null }, "$url": "/accounts/v2/contacts/341", "account_number": 10033, "tax_authentication_number": "DE111111119", "tax_eligible": true, "editable": true, "$key": 341 }
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='mustermann@example.com'
telephone
string
Use this to find a contact by their telephone. For example, /accounts/v2/contacts?telephone='08654/5554444'
mobile
string
Use this to find a contact by their email address. For example, /accounts/v2/contacts?mobile='0176/4445555'
notes
string
Use this to find a contact by their notes. For example, /accounts/v2/contacts?notes='Das'
tax_number
string
Use this to find a contact by their tax authentication number. For example, /accounts/v2/contacts?tax_authentication_number='202/123/12348'
$ curl https://api.sageone.com/accounts/v2/contacts/?search=Mayringer \ -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": 292, "company": null, "contact_types": [ { "id": 2, "name": "Lieferant", "$symbol": "SUPPLIER", "$key": 2 } ], "email": null, "mobile": null, "name": "kein Kontakt", "notes": null, "tax_number": null, "telephone": null, "main_address": { "$key": null }, "delivery_address": { "$key": null }, "$url": "/accounts/v2/contacts/292", "account_number": null, "tax_authentication_number": null, "tax_eligible": null, "editable": false, "$key": 292 }, { "#...": "#..." } ] }
Responds with the Contact for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/contacts/301 \ -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": 301, "company": "Mayringer Biobäcker", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "biobaecker-mayringer@t-online.de", "mobile": "0176/4445555", "name": "Werner E. Mayringer", "notes": "Das Steinbrot schmeckt sehr gut", "tax_number": "DE111111119", "telephone": "08654/5554444", "main_address": { "id": 229, "street_one": "Mozartplatz 9", "street_two": "2er Rechts", "town": "Freilassing", "postcode": "83395", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 229 }, "delivery_address": { "id": 230, "street_one": "Sonnenwinkel 12", "street_two": "3er Mittel", "town": "Bergheim", "postcode": "54321", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 230 }, "$url": "/accounts/v2/contacts/301", "account_number": null, "tax_authentication_number": "202/123/12348", "tax_eligible": null, "editable": true, "$key": 301 }
Creates a new Contact record.
contact_type_id
integer
The type of the contact. 1 = Kunde, 2 = Lieferant.
company
string
The name of the company, maximum 50 characters. You must supply contact[name], contact[company_name] or both.
name
string
The name of the contact, maximum 50 characters. You must supply contact[company_name], contact[name] or both.
account_number
integer
The account number of the contact (Debitorennummer, Kreditorennummer).
string
The email address of the contact, maximum 100 characters. Email must be valid.
mobile
string
The mobile number of the contact, maximum 50 characters.
telephone
string
The telephone number of the contact, maximum 50 characters.
notes
string
Any notes for the contact record, maximum 500 characters.
tax_authentication_number
string
The tax number to identify the contact at the tax office (Steuernummer).
tax_eligible
boolean
Whether the contact is tax eligible (Steuerberechtigt).
tax_number
string
The VAT number for the contact, maximum 14 characters (USt-IdNr.).
main_address[]
address
The Contact main address.
Toggle Child Parametersline_1
string
First line of the main address, maximum 50 characters.
line_2
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, maximum 10 characters.
country_id
integer
The ID of the Country.
delivery_address[]
address
The Contact delivery address.
Toggle Child Parametersline_1
string
First line of the delivery address, maximum 50 characters.
line_2
string
Second line of the delivery address, maximum 50 characters.
town
string
Town for the main address, maximum 50 characters.
postcode
string
Post code for the delivery address, maximum 10 characters.
country_id
integer
The ID of the Country.
$ 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[contact_type_id]=1" \ -d "contact[company]=Mayringer Biobäcker" \ -d "contact[name]=Werner E. Mayringer" \ -d "contact[email]=biobaecker-mayringer@t-online.de" \ -d "contact[telephone]=08654/5554444" \ -d "contact[mobile]=0176/4445555" \ -d "contact[notes]=Das Steinbrot schmeckt sehr gut" \ -d "contact[tax_rate_id]=1" \ -d "contact[tax_number]=DE111111119" \ -d "contact[tax_authentication_number]=202/123/12348" \ -d "contact[main_address][line_1]=Mozartplatz 9" \ -d "contact[main_address][line_2]=2er Rechts" \ -d "contact[main_address][line_3]=Freilassing" \ -d "contact[main_address][postcode]=83395" \ -d "contact[main_address][country_id]=68" \ -d "contact[delivery_address][line_1]=Sonnenwinkel 12" \ -d "contact[delivery_address][line_2]=3er Mittel" \ -d "contact[delivery_address][line_3]=Bergheim" \ -d "contact[delivery_address][postcode]=54321" \ -d "contact[delivery_address][country_id]=68"
{ "id": 301, "company": "Mayringer Biobäcker", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "biobaecker-mayringer@t-online.de", "mobile": "0176/4445555", "name": "Werner E. Mayringer", "notes": "Das Steinbrot schmeckt sehr gut", "tax_number": "DE111111119", "telephone": "08654/5554444", "main_address": { "id": 229, "street_one": "Mozartplatz 9", "street_two": "2er Rechts", "town": "Freilassing", "postcode": "83395", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 229 }, "delivery_address": { "id": 230, "street_one": "Sonnenwinkel 12", "street_two": "3er Mittel", "town": "Bergheim", "postcode": "54321", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 230 }, "$url": "/accounts/v2/contacts/301", "account_number": null, "tax_authentication_number": "202/123/12348", "tax_eligible": null, "editable": true, "$key": 301 }
Updates an existing Contact record. Only contact where the editable
field is true may be updated.
company[]
company
The Contact Company
Toggle Child Parametersname
string
The name of the company, maximum 50 characters. You must supply contact[name], contact[company_name] or both.
contact_type_id
integer
The type of the contact. 1 = Kunde, 2 = Lieferant.
string
The email address of the contact, maximum 100 characters. Email must be valid.
name
string
The name of the contact, maximum 50 characters. You must supply contact[name], contact[company_name] or both.
mobile
string
The mobile number of the contact, maximum 50 characters.
telephone
string
The telephone number of the contact, maximum 50 characters.
notes
string
Any notes for the contact record, maximum 500 characters.
tax_number
string
The VAT number for the contact, maximum 14 characters.
main_address[]
address
The Contact main address.
Toggle Child Parametersline_1
string
First line of the main address, maximum 50 characters.
line_2
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, maximum 10 characters.
country_id
integer
The ID of the Country.
delivery_address[]
address
The Contact delivery address.
Toggle Child Parametersline_1
string
First line of the delivery address, maximum 50 characters.
line_2
string
Second line of the delivery address, maximum 50 characters.
postcode
string
Post code for the delivery address, maximum 10 characters.
country_id
integer
The ID of the Country.
$ curl -X PUT https://api.sageone.com/accounts/v2/contacts/301 \ -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[name]=Maria S. Mayringer"
{ "id": 301, "company": "Mayringer Biobäcker", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "biobaecker-mayringer@t-online.de", "mobile": "0176/4445555", "name": "Maria S. Mayringer", "notes": "Das Steinbrot schmeckt sehr gut", "tax_number": "DE111111119", "telephone": "08654/5554444", "main_address": { "id": 229, "street_one": "Mozartplatz 9", "street_two": "2er Rechts", "town": "Freilassing", "postcode": "83395", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 229 }, "delivery_address": { "id": 230, "street_one": "Sonnenwinkel 12", "street_two": "3er Mittel", "town": "Bergheim", "postcode": "54321", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 230 }, "$url": "/accounts/v2/contacts/301", "account_number": null, "tax_authentication_number": "202/123/12348", "tax_eligible": null, "editable": true, "$key": 301 }
Deletes an existing Contact record.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/contacts/301 \ -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": 301, "company": "Mayringer Biobäcker", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "biobaecker-mayringer@t-online.de", "mobile": "0176/4445555", "name": "Maria S. Mayringer", "notes": "Das Steinbrot schmeckt sehr gut", "tax_number": "DE111111119", "telephone": "08654/5554444", "main_address": { "id": 229, "street_one": "Mozartplatz 9", "street_two": "2er Rechts", "town": "Freilassing", "postcode": "83395", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 229 }, "delivery_address": { "id": 230, "street_one": "Sonnenwinkel 12", "street_two": "3er Mittel", "town": "Bergheim", "postcode": "54321", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 230 }, "$url": "/accounts/v2/contacts/301", "account_number": null, "tax_authentication_number": "202/123/12348", "tax_eligible": null, "editable": true, "$key": 301 }
Responds with the Contact for the search string requested.
company
string
/accounts/v2/contacts/?search=Max
name
string
/accounts/v2/contacts/?search=Mayringer
$ curl https://api.sageone.com/accounts/v2/contacts?search=Werner \ -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": 295, "company": "Mayringer Biobäcker", "contact_types": [ { "id": 1, "name": "Kunde", "$symbol": "CUSTOMER", "$key": 1 } ], "email": "biobaecker-mayringer@t-online.de", "mobile": "0176/4445555", "name": "Werner E. Mayringer", "notes": "Das Steinbrot schmeckt sehr gut", "tax_number": "DE111111119", "telephone": "08654/5554444", "main_address": { "id": 217, "street_one": "Mozartplatz 9", "street_two": "2er Rechts", "town": "Freilassing", "postcode": "83395", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 217 }, "delivery_address": { "id": 218, "street_one": "Sonnenwinkel 12", "street_two": "3er Mittel", "town": "Bergheim", "postcode": "54321", "country": { "id": 68, "code": "DE", "name": "Deutschland", "$key": 68 }, "$key": 218 }, "$url": "/accounts/v2/contacts/295", "account_number": null, "tax_authentication_number": "202/123/12348", "tax_eligible": null, "editable": true, "$key": 295 }, { "#...": "#..." } ] }
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": 195, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 1, "code": "AF", "name": "Afghanistan", "$key": 1 }, { "#...": "#..." } ] }
Responds with the Country for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/countries/68 \ -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": 68, "code": "DE", "name": "Deutschland", "$key": 68 }
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. An Expense Type is in fact a Ledger Account.
id
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "id": 2204, "display_name": "Büroeinrichtung", "nominal_code": 420, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 6, "name": "Langfristiges Anlagevermögen", "$symbol": "FIXED_ASSETS", "$key": 6 }, "$url": "/accounts/v2/ledger_accounts/2204", "vat_changeable": true, "$key": 2204 }
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": 21, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 3642, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3642", "vat_changeable": true, "$key": 3642 }, { "id": 3639, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3639", "vat_changeable": true, "$key": 3639 }, { "#...": "#..." } ] }
This refers to 'Other Expense' transactions in Sage One.
This resource allows you to read, add, update and delete Expense transactions from Sage One.
id
integer
The ID of the Expense transaction.
contact_id
integer
The ID of the supplier associated with the Expense.
contact_name
string
The name of the supplier associated with the Expense.
bank_account
bank_account
Toggle Child Attributesid
integer
The ID of the Bank Account.
account_name
string
The name of the Bank Account.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
date
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
ledger_account_type[]
ledger_account_type
Toggle Child Attributesid
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.
$url
string
The URL for the API call for this resource.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$key
integer
This is the SData key.
multiple_line_items
boolean
Whether or not the Expense contains multiple line items. At the current version, only expenses with one line item can be created or updated. VAT and total values will be the sum over all line items. Other values will match those of the first line item.
payment_method
payment_method
Not available in Sage One Germany.
Toggle Child Attributes$key
integer
This is the SData key.
Always null in Sage One Germany.
reference
string
The reference of the Expense.
tax_rate
tax_rate
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The name of the Tax Rate.
$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.
vat_value
integer
The VAT value of the Expense.
total
integer
The total of the Expense.
gross_total
integer
The gross total of the Expense.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
{ "id": 40, "payment_method": { "$key": null }, "ledger_account": { "id": 2271, "display_name": "Fahrzeugkosten", "nominal_code": 4500, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/2271", "vat_changeable": true, "$key": 2271 }, "date": "2015-04-30", "contact_id": 338, "contact_name": "kein Kontakt", "reference": "Parkticket", "bank_account": { "id": 62, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/62", "$key": 62 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "0.56", "total": "3.5", "gross_total": "3.5", "$url": "/accounts/v2/expenses/40", "multiple_line_items": false, "$key": 40 }
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 \ -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": 17, "payment_method": { "$key": null }, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "date": "2016-12-31", "contact_id": 43, "contact_name": "kein Kontakt", "reference": "Briefmarken", "bank_account": { "id": 20, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/20", "$key": 20 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "119.0", "gross_total": "119.0", "$url": "/accounts/v2/expenses/17", "multiple_line_items": false, "$key": 17 } ] }
Responds with the Expense transaction for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/expenses/13 \ -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": 17, "payment_method": { "$key": null }, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "date": "2016-12-31", "contact_id": 43, "contact_name": "kein Kontakt", "reference": "Briefmarken", "bank_account": { "id": 20, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/20", "$key": 20 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "119.0", "gross_total": "119.0", "$url": "/accounts/v2/expenses/17", "multiple_line_items": false, "$key": 17 }
Creates a new Expense transaction.
bank_account_id
ledger_account_id
integer
The ID of the Ledger Account.
reference
string
The reference of the Expense.
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
vat_value
decimal
The vat amount of the Expense, maximum value 99999999.99
total
decimal
The net amount of the Expense, maximum value 99999999.99
contact_id
contact_name
string
The contact name associated with the Expense.
date
string
The date of the Expense in the format yyy-mm-dd.
description
string
The description of the Expense.
$ 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 "expense[date]=2016-12-31" \ -d "expense[total]=119.0" \ -d "expense[vat_value]=19.0" \ -d "expense[ledger_account_id]=9966" \ -d "expense[bank_account_id]=104" \ -d "expense[contact_id]=292" \ -d "expense[contact_name]=" \ -d "expense[tax_rate_id]=1" \ -d "expense[reference]=Briefmarken" \ -d "expense[description]=früher amtlich Postwertzeichen"
{ "id": 17, "payment_method": { "$key": null }, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "date": "2016-12-31", "contact_id": 43, "contact_name": "kein Kontakt", "reference": "Briefmarken", "bank_account": { "id": 20, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/20", "$key": 20 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "119.0", "gross_total": "119.0", "$url": "/accounts/v2/expenses/17", "multiple_line_items": false, "$key": 17 }
Update the specified Expense transaction.
bank_account_id
ledger_account_id
integer
The ID of the Ledger Account.
contact_id
contact_name
string
(The contact name associated with the Expense.)
date
string
The date of the Expense in the format YYYY-MM-DD.
description
string
The description of the Expense
reference
string
The reference of the Expense.
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
vat_value
decimal
The vat amount of the Expense, maximum value 99999999.99
total
decimal
The net amount of the Expense, maximum value 99999999.99
$ curl -X PUT https://api.sageone.com/accounts/v2/expenses/13 \ -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 "expense[reference]=Briefumschlag mit Briefmarken"
{ "id": 17, "payment_method": { "$key": null }, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "date": "2016-12-31", "contact_id": 43, "contact_name": "kein Kontakt", "reference": "Briefumschlag mit Briefmarken", "bank_account": { "id": 20, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/20", "$key": 20 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "119.0", "gross_total": "119.0", "$url": "/accounts/v2/expenses/17", "multiple_line_items": false, "$key": 17 }
Delete the specified Expense transaction.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/expenses/13 \ -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": 13, "payment_method": { "$key": null }, "ledger_account": { "id": 9966, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/9966", "vat_changeable": true, "$key": 9966 }, "date": "2016-12-31", "contact_id": 292, "contact_name": "kein Kontakt", "reference": "Briefumschlag mit Briefmarken", "bank_account": { "id": 104, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/104", "$key": 104 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "119.0", "gross_total": "119.0", "$url": "/accounts/v2/expenses/13", "multiple_line_items": false, "$key": 13 }
This resource allows you to read and update financial settings.
coa_template
string
The chart of accounts (COA) that is used by the business.
financial_year_end_date
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.
$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.
tax_scheme
Tax Scheme
The current tax scheme.
Toggle Child Attributesid
integer
The tax scheme ID.
name
string
The tax scheme name.
$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.
tax_number
string
The VAT ID of the business (USt-ID).
tax_authentication_number
string
The tax number to identify the business at the tax office (Steuernummer).
tax_office
Tax Office
The tax office for the business.
Toggle Child Attributesid
integer
The tax office ID.
url
string
The URL for the API call for this resource.
office_number
integer
The official number of the tax office.
name
string
The tax office name.
$key
integer
This is the SData key.
$key
integer
This is the SData key.
{ "financial_year_end_date": "2015-12-31", "coa_template": "SKR03", "tax_submission_frequency_type": { "id": 2, "name": "Monatlich", "$symbol": "MONTHLY", "$key": 2 }, "tax_scheme": { "id": 1, "name": "Ist-Versteuerung", "$symbol": "CASH_BASED", "$key": 1 }, "tax_number": "DE111111119", "tax_authentication_number": "202/123/12348", "tax_office": { "id": 567, "url": "/accounts/v2/tax_offices/567", "office_number": 3202, "name": "Dresden-Nord", "$key": 567 }, "$key": 34 }
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": "2015-12-31", "coa_template": "SKR03", "tax_submission_frequency_type": { "id": 2, "name": "Monatlich", "$symbol": "MONTHLY", "$key": 2 }, "tax_scheme": { "id": 1, "name": "Ist-Versteuerung", "$symbol": "CASH_BASED", "$key": 1 }, "tax_number": "DE111111119", "tax_authentication_number": "202/123/12348", "tax_office": { "id": 567, "url": "/accounts/v2/tax_offices/567", "office_number": 3202, "name": "Dresden-Nord", "$key": 567 }, "$key": 34 }
Updates the financial settings.
tax_authentication_number
string
The tax number to identify the business at the tax office (Steuernummer). This can only be updated together with `tax_office_id`
tax_office_id
integer
The ID of the tax office for the business. This can only be updated together with `tax_authentication_number`
tax_number
string
The VAT ID of the business (USt-ID).
$ curl -X PUT 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" \ -d "financial_settings[tax_number]=DE136695976"
{ "financial_year_end_date": "2016-12-31", "coa_template": "SKR03", "tax_submission_frequency_type": { "$key": null }, "tax_scheme": { "id": 1, "name": "Ist-Versteuerung", "$symbol": "CASH_BASED", "$key": 1 }, "tax_number": "DE136695976", "tax_authentication_number": "202/123/12348", "tax_office": { "id": 567, "url": "/accounts/v2/tax_offices/567", "office_number": 3202, "name": "Dresden-Nord", "$key": 567 }, "$key": 14 }
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. An Income Type is in fact a Ledger Account.
id
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "id": 2291, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/2291", "vat_changeable": false, "$key": 2291 }
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": 8, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 3463, "display_name": "Durchlaufende Posten", "nominal_code": 1590, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 2, "name": "Kurzfristige Forderungen", "$symbol": "CURRENT_ASSETS", "$key": 2 }, "$url": "/accounts/v2/ledger_accounts/3463", "vat_changeable": true, "$key": 3463 }, { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, { "#...": "#..." } ] }
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.
bank_account
bank_account
Toggle Child Attributesid
integer
The ID of the Bank Account.
account_name
string
The name of the Bank Account.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
contact_id
integer
This is the SData key.
The ID of the supplier associated with the Income.
contact_name
string
The name of the supplier associated with the Income.
date
reference
string
The reference of the Income.
multiple_line_items
boolean
Whether or not the Income contains multiple line items. At the current version, only incomes with one line item can be created or updated. VAT and total values will be the sum over all line items. Other values will match those of the first line item.
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
$url
string
The URL for the API call for this resource.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$key
integer
This is the SData key.
payment_method
payment_method
Not available in Sage One Germany.
Toggle Child Attributes$key
integer
This is the SData key.
Always null in Sage One Germany.
tax_rate
tax_rate
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The name of the Tax Rate.
$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.
vat_value
string
The VAT value of the Income.
total
string
The total of the Income.
gross_total
string
The gross total of the Income.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
{ "id": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q1/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 }
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 \ -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": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q1/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 } ] }
Responds with the Income for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/incomes/22 \ -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": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q1/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 }
Creates a new Income transaction.
bank_account_id
ledger_account_id
integer
The ID of the Ledger Account.
reference
string
The reference of the Income.
total
decimal
The net amount of the Income, maximum value 99999999.99
vat_value
decimal
The vat amount of the Income, maximum value 99999999.99
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
contact_id
date
string
The date of the Income in the format yyyy-mm-dd.
$ 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]=2016-12-31" \ -d "income[total]=100.0" \ -d "income[vat_value]=19.0" \ -d "income[ledger_account_id]=3646" \ -d "income[bank_account_id]=32" \ -d "income[contact_id]=37" \ -d "income[tax_rate_id]=1" \ -d "income[reference]=Steuerrückzahlung Q1/2015"
{ "id": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q1/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 }
Updates an existing Income transaction.
bank_account_id
ledger_account_id
integer
The ID of the Ledger Account.
contact_id
date
string
The date of the Income in the format yyyy-mm-dd.
reference
string
The reference of the Income.
total
decimal
The net amount of the Income, maximum value 99999999.99
vat_value
decimal
The vat amount of the Income, maximum value 99999999.99
$ curl -X PUT https://api.sageone.com/accounts/v2/incomes/22 \ -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[reference]=Steuerrückzahlung Q4/2015"
{ "id": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q4/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 }
Deletes an existing Income transaction.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/incomes/22 \ -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": 22, "payment_method": { "$key": null }, "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "date": "2016-12-31", "contact_id": 37, "contact_name": "Empire State University (Peter Parker)", "reference": "Steuerrückzahlung Q4/2015", "bank_account": { "id": 32, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/32", "$key": 32 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "vat_value": "19.0", "total": "100.0", "gross_total": "119.0", "$url": "/accounts/v2/incomes/22", "multiple_line_items": false, "$key": 22 }
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": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }
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": 9, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 4, "name": "Abschreibungen", "$symbol": "DEPRECIATION", "$key": 4 }, { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, { "id": 2, "name": "Kurzfristige Forderungen", "$symbol": "CURRENT_ASSETS", "$key": 2 }, { "id": 3, "name": "Kurzfristige Verbindlichkeiten", "$symbol": "CURRENT_LIABILITY", "$key": 3 }, { "id": 6, "name": "Langfristiges Anlagevermögen", "$symbol": "FIXED_ASSETS", "$key": 6 }, { "id": 8, "name": "Privat", "$symbol": "PRIVATE", "$key": 8 }, { "id": 9, "name": "Sonstige", "$symbol": "STATISTIC", "$key": 9 } ] }
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 name of the Ledger Account.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "id": 2291, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/2291", "vat_changeable": false, "$key": 2291 }
Responds with all Ledger Accounts.
ledger_account_type
integer
Use this to find ledger accounts with ID of the given ledger account type. For example, /accounts/v2/ledger_accounts?ledger_account_type=1
$ 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": 111, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 3538, "display_name": "Kasse", "nominal_code": 1000, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO", "$key": 3 }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK", "$key": 1 }, "$url": "/accounts/v2/ledger_accounts/3538", "vat_changeable": false, "$key": 3538 }, { "#...": "#..." } ] }
Responds with the Ledger Account for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/ledger_accounts/3642 \ -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": 3642, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3642", "vat_changeable": true, "$key": 3642 }
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": 5, "name": "Quartal", "$symbol": "QUARTERLY", "$key": 5 }
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": "Jahr", "$symbol": "ANNUALLY", "$key": 1 }, { "id": 2, "name": "Tag", "$symbol": "DAILY", "$key": 2 }, { "id": 3, "name": "Stunde", "$symbol": "HOURLY", "$key": 3 }, { "id": 4, "name": "Monat", "$symbol": "MONTHLY", "$key": 4 }, { "id": 5, "name": "Quartal", "$symbol": "QUARTERLY", "$key": 5 }, { "id": 6, "name": "Woche", "$symbol": "WEEKLY", "$key": 6 }, { "id": 7, "name": "Festpreis", "$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": "Jahr", "$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.
cost_price
decimal
The cost price, maximum value of 99999999.99.
description
string
The Product description, maximum 50 characters.
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
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.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
notes
string
Any extra information about the Product, maximum 50 characters.
product_code
string
The Product code, maximum 10 characters.
sales_price
decimal
The sales price, maximum value of 99999999.99.
sales_price_includes_tax
boolean
Set to 1 if the Product sales_price includes tax.
tax_rate
tax_rate
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The name of the Tax Rate.
$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": 51, "product_code": "1A", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 }
Responds with all Products.
If required, you can include the optional parameters below in your request URL to filter the response by product description.
search
string
Use this to filter by the product description (not case sensitive). For example, accounts/v2/products?search=widget
$ curl https://api.sageone.com/accounts/v2/products/?search=Kaffeetasse \ -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": 51, "product_code": "XYZ123", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 } ] }
Responds with the Product for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/products/51 \ -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": 51, "product_code": "1A", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 }
Creates a new Product.
description
string
The product description, maximum 50 characters.
ledger_account_id
integer
The ID of the Ledger Account.
notes
string
Any extra information about the Product, maximum 50 characters.
product_code
string
The product code, maximum 10 characters.
cost_price
decimal
The cost price, maximum value of 99999999.99.
sales_price
decimal
The sales price, maximum value of 99999999.99.
sales_price_includes_tax
boolean
Set to true or 1 if the product sales_price includes tax.
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
$ 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[description]=Kaffeetasse mit Aufdruck" \ -d "product[sales_price_includes_tax]=true" \ -d "product[ledger_account_id]=3646" \ -d "product[tax_rate_id]=1" \ -d "product[product_code]=1A" \ -d "product[cost_price]=1.00" \ -d "product[sales_price]=5.00" \ -d "product[notes]=Das perfekte Geschenk für Ihre Mitarbeiter"
{ "id": 51, "product_code": "1A", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 }
Updates an existing Product.
description
string
The product description, maximum 50 characters.
notes
string
Any extra information about the product, maximum 50 characters.
ledger_account_id
cost_price
decimal
The cost price, maximum value of 99999999.99.
sales_price
decimal
The sales price, maximum value of 99999999.99.
product_code
string
The product code, maximum 10 characters.
sales_price_includes_tax
boolean
Set to true or 1 if the product sales_price includes tax.
$ curl -X PUT https://api.sageone.com/accounts/v2/products/51 \ -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[product_code]=XYZ123"
{ "id": 51, "product_code": "XYZ123", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 }
Deletes an existing Product.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/products/51 \ -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": 51, "product_code": "XYZ123", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/51", "$key": 51 }
Responds with the Product for the search string requested.
code
string
/accounts/v2/products/?search=1A
description
string
/accounts/v2/products/?search=Kaffeetasse
$ curl https://api.sageone.com/accounts/v2/products?search=Kaffeetasse \ -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": 44, "product_code": "1A", "description": "Kaffeetasse mit Aufdruck", "ledger_account": { "id": 3646, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3646", "vat_changeable": false, "$key": 3646 }, "cost_price": "1.0", "sales_price": "5.0", "unit_type": { "$key": null }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "sales_price_includes_tax": true, "notes": "Das perfekte Geschenk für Ihre Mitarbeiter", "$url": "/accounts/v2/products/44", "$key": 44 } ] }
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.
contact_id
integer
The ID of the supplier associated with the Purchase Credit Note.
contact_name
string
The name of the supplier associated with the Purchase Credit Note.
date
invoice_id
integer
The ID of the invoice associated with the Purchase Credit Note.
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.
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_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.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
tax_rate
tax_rate
Toggle Child Attributesid
integer
The ID of the Tax Rate for this transaction.
name
string
The name of the Tax Rate.
$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.
$url
string
The URL for the API call for this resource.
notes
string
Any additional information, maximum 1000 characters.
status
Artefact Status
The payment status of the Purchase Credit Note.
Toggle Child Attributesid
integer
Artefact Status ID.
name
string
The name of the Artefact Status.
$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.
total_net_amount
decimal
The net amount of the Purchase Credit Note.
total_tax_amount
decimal
The tax amount of the Purchase Credit Note.
reference
string
The Purchase Credit Note reference.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
{ "id": 65, "contact_id": 346, "contact_name": " Birgit Mustermann", "invoice_id": 61, "status": { "id": 4, "name": "Bezahlt", "$symbol": "PAID", "$key": 4 }, "date": "2015-05-06", "reference": "Bürokram", "total_net_amount": "2.0", "total_tax_amount": "0.38", "notes": null, "line_items": [ { "id": 69, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 2285, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/2285", "vat_changeable": true, "$key": 2285 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.38", "$url": "/accounts/v2/purchase_credit_notes/65/line_items/69", "$key": 69 } ], "$url": "/accounts/v2/purchase_credit_notes/65", "$key": 65 }
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": 187, "contact_id": 43, "contact_name": "kein Kontakt", "invoice_id": 186, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-27", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "notes": "Bürozeug", "line_items": [ { "id": 200, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.0", "$url": "/accounts/v2/purchase_credit_notes/187/line_items/200", "$key": 200 } ], "$url": "/accounts/v2/purchase_credit_notes/187", "$key": 187 } ] }
Responds with the Purchase Credit Note for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_credit_notes/92 \ -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": 187, "contact_id": 43, "contact_name": "kein Kontakt", "invoice_id": 186, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-27", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "notes": "Bürozeug", "line_items": [ { "id": 200, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.0", "$url": "/accounts/v2/purchase_credit_notes/187/line_items/200", "$key": 200 } ], "$url": "/accounts/v2/purchase_credit_notes/187", "$key": 187 }
Creates a new Purchase Credit Note.
contact_id
integer
The ID of the Contact.
The supplier (contact_type 2) associated with the Purchase Credit Note.
line_items_attributes[0..*][]
Line Items
The line items on the Purchase Credit Note.
Toggle Child Parametersdescription
string
The description of the line item, maximum 60 characters.
ledger_account_id
integer
The ID of the Ledger Account.
quantity
decimal
The number of units on the line item.
tax_code_id
integer
The ID of the Tax Rate for this transaction.
unit_price
decimal
The unit cost of the line item.
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
notes
string
Any additional information, maximum 1000 characters.
reference
string
The Purchase Credit Note reference.
invoice_id
integer
The ID of the purchase credit invoice associated with the Purchase Credit Note.
$ 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_credit_note[contact_id]=43" \ -d "purchase_credit_note[date]=2016-01-27" \ -d "purchase_credit_note[reference]=Gutschrift Bürozeug" \ -d "purchase_credit_note[notes]=Bürozeug" \ -d "purchase_credit_note[line_items_attributes][0][description]=Filzstifte" \ -d "purchase_credit_note[line_items_attributes][0][quantity]=1.0" \ -d "purchase_credit_note[line_items_attributes][0][unit_price]=2.0" \ -d "purchase_credit_note[line_items_attributes][0][ledger_account_id]=3528" \ -d "purchase_credit_note[line_items_attributes][0][tax_rate_id]=1" \ -d "purchase_credit_note[invoice_id]=186"
{ "id": 187, "contact_id": 43, "contact_name": "kein Kontakt", "invoice_id": 186, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-27", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "notes": "Bürozeug", "line_items": [ { "id": 200, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.0", "$url": "/accounts/v2/purchase_credit_notes/187/line_items/200", "$key": 200 } ], "$url": "/accounts/v2/purchase_credit_notes/187", "$key": 187 }
Update an existing Purchase Credit Note.
contact_id
integer
The ID of the Contact.
The supplier (contact_type 2) associated with the Purchase Credit Note.
invoice_id
integer
The ID of the purchase credit invoice associated with the Purchase Credit Note.
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
notes
string
Any additional information, maximum 1000 characters.
reference
string
The Purchase Credit Note reference.
$ curl -X PUT https://api.sageone.com/accounts/v2/purchase_credit_notes/92 \ -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_credit_note[date]=2016-01-19"
{ "id": 92, "contact_id": 94, "contact_name": "kein Kontakt", "invoice_id": 79, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-19", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "notes": "Bürozeug", "line_items": [ { "id": 95, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 4795, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/4795", "vat_changeable": true, "$key": 4795 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.0", "$url": "/accounts/v2/purchase_credit_notes/92/line_items/95", "$key": 95 } ], "$url": "/accounts/v2/purchase_credit_notes/92", "$key": 92 }
Delete the specified Purchase Credit Note.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_credit_notes/92 \ -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": 92, "contact_id": 94, "contact_name": "kein Kontakt", "invoice_id": 79, "status": { "id": 4, "name": "Storniert", "$symbol": "VOID", "$key": 4 }, "date": "2016-01-19", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "notes": "Bürozeug", "line_items": [ { "id": 95, "quantity": "1.0", "description": "Filzstifte", "unit_price": "2.0", "unit_price_includes_tax": false, "ledger_account": { "id": 4795, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/4795", "vat_changeable": true, "$key": 4795 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "2.0", "tax_amount": "0.0", "$url": "/accounts/v2/purchase_credit_notes/92/line_items/95", "$key": 95 } ], "$url": "/accounts/v2/purchase_credit_notes/92", "$key": 92 }
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.
contact_id
integer
The ID of the supplier associated with the purchase invoice.
contact_name
string
The name of the supplier associated with the purchase invoice.
date
due_date
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.
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.
unit_price_includes_tax
boolean
True if the line item price includes tax.
net_amount
decimal
The net amount of the line item.
tax_amount
decimal
The tax amount of the line item.
tax_rate_percentage
decimal
The tax rate percentage for the line item.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
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.
$url
string
The URL for the API call for this resource.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
$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
The name of the Tax Rate.
$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.
notes
string
Any additional information, maximum 1000 characters.
credit_notes[]
outstanding
decimal
The amount outstanding for the Purchase Invoice.
payments[]
reference
string
The Purchase Invoice reference.
status
Artefact Status
The payment status of the Purchase Invoice.
Toggle Child Attributesid
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.
total_net_amount
decimal
The net amount of the Purchase Invoice.
total_tax_amount
decimal
The tax amount of the Purchase Invoice.
void_reason
string
Small description for the cancelation of the the Purchase Invoice.
$key
integer
This is the SData key.
$url
string
The URL for the API call for this resource.
{ "id": 413, "contact_id": 292, "contact_name": "kein Kontakt", "status": { "id": 1, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 1 }, "date": "2016-01-25", "due_date": "2016-02-25", "reference": "Bürokram", "void_reason": "Als Test Eingestellt", "outstanding": "200.0", "total_net_amount": "168.07", "total_tax_amount": "31.93", "notes": "Bürokram Notes", "line_items": [ { "id": 459, "quantity": "2.0", "description": "Filzstifte", "unit_price": "84.03", "unit_price_includes_tax": true, "ledger_account": { "id": 9966, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/9966", "vat_changeable": true, "$key": 9966 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "168.07", "tax_amount": "31.93", "$url": "/accounts/v2/purchase_invoices/413/line_items/459", "$key": 459 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/purchase_invoices/413", "$key": 413 }
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 \ -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": 381, "contact_id": 292, "contact_name": "kein Kontakt", "status": { "id": 1, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 1 }, "date": "2016-01-25", "due_date": "2016-02-25", "reference": "Bürokram", "void_reason": null, "outstanding": "5.95", "total_net_amount": "5.0", "total_tax_amount": "0.95", "notes": null, "line_items": [ { "id": 427, "quantity": "1.0", "description": "Filzstifte", "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 9966, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/9966", "vat_changeable": true, "$key": 9966 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.95", "$url": "/accounts/v2/purchase_invoices/381/line_items/427", "$key": 427 } ], "payments": [ ], "credit_notes": [ { "id": 382, "contact_id": 292, "contact_name": "kein Kontakt", "date": "2016-01-26", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "$key": 382 } ], "$url": "/accounts/v2/purchase_invoices/381", "$key": 381 }, { "#...": "#..." } ] }
Responds with the Purchase Invoice for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/413 \ -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": 413, "contact_id": 292, "contact_name": "kein Kontakt", "status": { "id": 1, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 1 }, "date": "2016-01-25", "due_date": "2016-02-25", "reference": "Bürokram", "void_reason": "Als Test Eingestellt", "outstanding": "200.0", "total_net_amount": "168.07", "total_tax_amount": "31.93", "notes": "Bürokram Notes", "line_items": [ { "id": 459, "quantity": "2.0", "description": "Filzstifte", "unit_price": "84.03", "unit_price_includes_tax": true, "ledger_account": { "id": 9966, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/9966", "vat_changeable": true, "$key": 9966 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "168.07", "tax_amount": "31.93", "$url": "/accounts/v2/purchase_invoices/413/line_items/459", "$key": 459 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/purchase_invoices/413", "$key": 413 }
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.
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.
unit_price_includes_tax
boolean
Set to true if the price is with taxes
tax_rate_id
integer
The ID of the Tax Rate for this transaction.
ledger_account_id
integer
The ID of the Ledger Account.
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 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]=43" \ -d "purchase_invoice[line_items_attributes][0][quantity]=2.0" \ -d "purchase_invoice[line_items_attributes][0][description]=Filzstifte" \ -d "purchase_invoice[line_items_attributes][0][unit_price]=100.0" \ -d "purchase_invoice[line_items_attributes][0][unit_price_includes_tax]=true" \ -d "purchase_invoice[line_items_attributes][0][ledger_account_id]=3531" \ -d "purchase_invoice[line_items_attributes][0][tax_rate_id]=1" \ -d "purchase_invoice[date]=2016-01-27" \ -d "purchase_invoice[due_date]=2016-02-27" \ -d "purchase_invoice[notes]=Textilstifte 10er Set" \ -d "purchase_invoice[reference]=Bürokram"
{ "id": 188, "contact_id": 43, "contact_name": "kein Kontakt", "status": { "id": 1, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 1 }, "date": "2016-01-27", "due_date": "2016-02-27", "reference": "Bürokram", "void_reason": null, "outstanding": "200.0", "total_net_amount": "168.06", "total_tax_amount": "31.93", "notes": "Textilstifte 10er Set", "line_items": [ { "id": 201, "quantity": "2.0", "description": "Filzstifte", "unit_price": "84.03", "unit_price_includes_tax": true, "ledger_account": { "id": 3531, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3531", "vat_changeable": true, "$key": 3531 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "168.06", "tax_amount": "31.93", "$url": "/accounts/v2/purchase_invoices/188/line_items/201", "$key": 201 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/purchase_invoices/188", "$key": 188 }
Updates an existing Purchase Invoice.
date
string
The invoice date in the format yyyy-mm-dd.
due_date
string
The payment due date of the invoice in the format yyyy-mm-dd.
reference
string
The Purchase Invoice reference.
notes
string
Any additional information, maximum 1000 characters.
void_reason
string
Small description for the cancelation of the the Purchase Invoice.
$ curl -X PUT https://api.sageone.com/accounts/v2/purchase_invoices/413 \ -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[reference]=Papierkram"
{ "id": 413, "contact_id": 292, "contact_name": "kein Kontakt", "status": { "id": 1, "name": "Unbezahlt", "$symbol": "UNPAID", "$key": 1 }, "date": "2016-01-25", "due_date": "2016-02-25", "reference": "Papierkram", "void_reason": "Als Test Eingestellt", "outstanding": "200.0", "total_net_amount": "168.07", "total_tax_amount": "31.93", "notes": "Bürokram Notes", "line_items": [ { "id": 459, "quantity": "2.0", "description": "Filzstifte", "unit_price": "84.03", "unit_price_includes_tax": true, "ledger_account": { "id": 9966, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/9966", "vat_changeable": true, "$key": 9966 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "168.07", "tax_amount": "31.93", "$url": "/accounts/v2/purchase_invoices/413/line_items/459", "$key": 459 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/purchase_invoices/413", "$key": 413 }
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 ‘Temporary Reason’. For example, accounts/v2/purchase_invoices/ID/?void_reason=Void Reason Text
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_invoices/413/?void_reason=Falsch+eingestellt \ -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": 188, "contact_id": 43, "contact_name": "kein Kontakt", "status": { "id": 4, "name": "Storniert", "$symbol": "VOID", "$key": 4 }, "date": "2016-01-27", "due_date": "2016-02-27", "reference": "Papierkram", "void_reason": "Falsch eingestellt", "outstanding": "0.0", "total_net_amount": "168.07", "total_tax_amount": "31.93", "notes": "Textilstifte 10er Set", "line_items": [ { "id": 201, "quantity": "2.0", "description": "Filzstifte", "unit_price": "84.03", "unit_price_includes_tax": true, "ledger_account": { "id": 3531, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3531", "vat_changeable": true, "$key": 3531 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "168.07", "tax_amount": "31.93", "$url": "/accounts/v2/purchase_invoices/188/line_items/201", "$key": 201 } ], "payments": [ ], "credit_notes": [ ], "$url": "/accounts/v2/purchase_invoices/188", "$key": 188 }
Responds with the Purchase Invoices for the search string requested.
contact_name
string
/accounts/v2/purchase_invoices/?search=Contact_name
$ curl https://api.sageone.com/accounts/v2/purchase_invoices?search=kein \ -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": 3, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 186, "contact_id": 43, "contact_name": "kein Kontakt", "status": { "id": 4, "name": "Storniert", "$symbol": "VOID", "$key": 4 }, "date": "2016-01-27", "due_date": "2016-02-27", "reference": "Bürokram", "void_reason": "Temporary Reason", "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.95", "notes": null, "line_items": [ { "id": 199, "quantity": "1.0", "description": "Filzstifte", "unit_price": "5.0", "unit_price_includes_tax": false, "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE", "$key": 5 }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true, "$key": 3528 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.95", "$url": "/accounts/v2/purchase_invoices/186/line_items/199", "$key": 199 } ], "payments": [ ], "credit_notes": [ { "id": 187, "contact_id": 43, "contact_name": "kein Kontakt", "date": "2016-01-28", "reference": "Gutschrift Bürozeug", "total_net_amount": "2.0", "total_tax_amount": "0.0", "$key": 187 } ], "$url": "/accounts/v2/purchase_invoices/186", "$key": 186 }, { "#...": "#..." } ] }
Responds with all Payments associated with the specified Purchase Invoice.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/415/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": 56, "amount": "1.0", "reference": "10023", "bank_account": { "id": 104, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/104", "$key": 104 }, "date": "2016-01-25", "contact_id": 292, "contact_name": "kein Kontakt", "invoice_id": 415, "$url": "/accounts/v2/purchase_invoices/415/payments/56", "$key": 56 } ] }
Responds with the Purchase Invoice Payment for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/415/payments/56 \ -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": 56, "amount": "1.0", "reference": "10023", "bank_account": { "id": 104, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/104", "$key": 104 }, "date": "2016-01-25", "contact_id": 292, "contact_name": "kein Kontakt", "invoice_id": 415, "$url": "/accounts/v2/purchase_invoices/415/payments/56", "$key": 56 }
Creates a Payment associated with the specified Purchase Invoice.
bank_account_id
integer
The ID of the Bank Account.
amount
decimal
The amount of the payment. When is not used it will be the total amount of the invoice
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
The date of the payment. When is not used it will be the invoice date
reference
string
The payment reference (Buchungstext).
$ curl -X POST https://api.sageone.com/accounts/v2/purchase_invoices/415/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[bank_account_id]=104" \ -d "purchase_invoice_payment[amount]=1" \ -d "purchase_invoice_payment[reference]=10023" \ -d "purchase_invoice_payment[date]=2016-01-25"
{ "id": 56, "amount": "1.0", "reference": "10023", "bank_account": { "id": 104, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/104", "$key": 104 }, "date": "2016-01-25", "contact_id": 292, "contact_name": "kein Kontakt", "invoice_id": 415, "$url": "/accounts/v2/purchase_invoices/415/payments/56", "$key": 56 }
Deletes an existing Purchase Invoice Payment.
No parameters required.
$ curl -X DELETE https://api.sageone.com/accounts/v2/purchase_invoices/415/payments/56 \ -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": 56, "amount": "1.0", "reference": "10023", "bank_account": { "id": 104, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/104", "$key": 104 }, "date": "2016-01-25", "contact_id": 292, "contact_name": "kein Kontakt", "invoice_id": 415, "$url": "/accounts/v2/purchase_invoices/415/payments/56", "$key": 56 }
Responds with all Payments associated with the specified Purchase Invoice.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/62/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": 4, "amount": "5.95", "reference": "Barzahlung", "bank_account": { "id": 62, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/62", "$key": 62 }, "date": "2015-05-06", "contact_id": 346, "contact_name": " Birgit Mustermann", "invoice_id": 62, "$url": "/accounts/v2/purchase_invoices/62/payments/4", "$key": 4 } ] }
Responds with the Purchase Invoice Payment for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/purchase_invoices/62/payments/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, "amount": "5.95", "reference": "Barzahlung", "bank_account": { "id": 62, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/62", "$key": 62 }, "date": "2015-05-06", "contact_id": 346, "contact_name": " Birgit Mustermann", "invoice_id": 62, "$url": "/accounts/v2/purchase_invoices/62/payments/4", "$key": 4 }
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/62/payments/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": 5, "amount": "2.5", "reference": "10023", "bank_account": { "id": 62, "account_name": "Kasse", "$url": "/accounts/v2/bank_accounts/62", "$key": 62 }, "date": "2015-05-06", "contact_id": 346, "contact_name": " Birgit Mustermann", "invoice_id": 62, "$url": "/accounts/v2/purchase_invoices/62/payments/5", "$key": 5 }
A report from transactions occurred between a period of time
ledger_account
ledger_account
Toggle Child Attributesid
integer
The ID of the Ledger Account.
display_name
string
The name of the Ledger Account.
nominal_code
integer
The nominal code of the Ledger Account.
tax_code
tax_code
Toggle Child Attributesid
tax_code_id
name
string
The name of the Tax Code.
$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.
ledger_account_type
ledger_account_type
Toggle Child Attributesid
integer
The ID of the Ledger Account Type.
name
string
The name of the Ledger 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.
$url
string
The URL for the API call for this resource.
vat_changeable
boolean
Indicates whether or not the actual tax rate may deviate from the defined Tax Code.
opening_balance
Opening Balance
Toggle Child Attributesdr
integer
The Opening Balance Debit
cr
integer
The Opening Balance Credit
transactions
Transactions
Toggle Child Attributesdr
Transactions
The Transactions Debit
cr
integer
The Transactions Credit
balance
{ "ledger_account": { "id": 2620, "display_name": "Kasse", "nominal_code": 1000, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO" }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK" }, "$url": "/accounts/v2/ledger_accounts/2620", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "431.0", "cr": "632.0" }, "balance": { "dr": "0.0", "cr": "201.0" } }
Responds with the report from a Trial Balance requested.
start_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
The initial date of the Trial Balance. When not given it will be the actual date.
end_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
The date of the Trial Balance ended. When not given it will be the current business year end date.
$ curl https://api.sageone.com/accounts/v2/reports/trial_balance \ -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"
{ "result": [ { "ledger_account": { "id": 3427, "display_name": "Kasse", "nominal_code": 1000, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO" }, "ledger_account_type": { "id": 1, "name": "Kasse/Bank", "$symbol": "BANK" }, "$url": "/accounts/v2/ledger_accounts/3427", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "477.0", "cr": "477.0" }, "balance": { "dr": "0.0", "cr": "0.0" } }, { "ledger_account": { "id": 3456, "display_name": "Abziehbare Vorsteuer 19 %", "nominal_code": 1576, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO" }, "ledger_account_type": { "id": 2, "name": "Kurzfristige Forderungen", "$symbol": "CURRENT_ASSETS" }, "$url": "/accounts/v2/ledger_accounts/3456", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "166.67", "cr": "134.74" }, "balance": { "dr": "31.93", "cr": "0.0" } }, { "ledger_account": { "id": 3464, "display_name": "Verbindlichkeiten aus Lieferungen und Leistungen", "nominal_code": 1600, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO" }, "ledger_account_type": { "id": 3, "name": "Kurzfristige Verbindlichkeiten", "$symbol": "CURRENT_LIABILITY" }, "$url": "/accounts/v2/ledger_accounts/3464", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "610.95", "cr": "810.95" }, "balance": { "dr": "0.0", "cr": "200.0" } }, { "ledger_account": { "id": 3479, "display_name": "Umsatzsteuer 19 %", "nominal_code": 1776, "tax_code": { "id": 3, "name": "0%", "$symbol": "ZERO" }, "ledger_account_type": { "id": 3, "name": "Kurzfristige Verbindlichkeiten", "$symbol": "CURRENT_LIABILITY" }, "$url": "/accounts/v2/ledger_accounts/3479", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "38.0", "cr": "38.0" }, "balance": { "dr": "0.0", "cr": "0.0" } }, { "ledger_account": { "id": 3528, "display_name": "Bürobedarf", "nominal_code": 4930, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD" }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE" }, "$url": "/accounts/v2/ledger_accounts/3528", "vat_changeable": true }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "209.0", "cr": "209.0" }, "balance": { "dr": "0.0", "cr": "0.0" } }, { "ledger_account": { "id": 3531, "display_name": "Buchführungskosten", "nominal_code": 4955, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD" }, "ledger_account_type": { "id": 5, "name": "Ausgaben", "$symbol": "EXPENSE" }, "$url": "/accounts/v2/ledger_accounts/3531", "vat_changeable": true }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "672.28", "cr": "504.21" }, "balance": { "dr": "168.07", "cr": "0.0" } }, { "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD" }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME" }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false }, "opening_balance": { "dr": "0.0", "cr": "0.0" }, "transactions": { "dr": "200.0", "cr": "200.0" }, "balance": { "dr": "0.0", "cr": "0.0" } } ] }
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 reference number for the credit invoice.
artefact_number_prefix
string
The reference number prefix for the credit invoice.
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
Date string represented as YYYY-MM-DD. See ISO 8601.
due_date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
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.
$url
string
The URL for the API call for this resource.
$key
integer
This is the SData key.
{ "$totalResults": 9, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 192, "contact_id": 44, "contact_name": "Empire State University (Peter Parker)", "invoice_id": 191, "artefact_number": "8264", "artefact_number_prefix": null, "status": { "id": 4, "name": "Storniert", "$symbol": "VOID", "$key": 4 }, "date": "2016-01-29", "due_date": null, "reference": "updated reference", "void_reason": "Temporary Reason", "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "notes": "Angebot ausdrucken", "line_items": [ { "id": 205, "quantity": "1.0", "description": null, "product": { "$key": null }, "service": { "id": 29, "description": "Anfahrtspauschale", "$url": "/accounts/v2/services/29", "$key": 29 }, "product_code": null, "unit_price": "4.2", "unit_price_includes_tax": true, "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.0", "$url": "/accounts/v2/sales_credit_notes/192/line_items/205", "$key": 205 } ], "$url": "/accounts/v2/sales_credit_notes/192", "$key": 192 }, { "#...": "#..." } ] }
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": 32, "$startIndex": 0, "$itemsPerPage": 20, "$resources": [ { "id": 192, "contact_id": 44, "contact_name": "Empire State University (Peter Parker)", "invoice_id": 191, "artefact_number": "8264", "artefact_number_prefix": null, "status": { "id": 4, "name": "Storniert", "$symbol": "VOID", "$key": 4 }, "date": "2016-01-29", "due_date": null, "reference": "updated reference", "void_reason": "Temporary Reason", "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.0", "main_address": null, "delivery_address": null, "delivery_address_same_as_main": false, "notes": "Angebot ausdrucken", "line_items": [ { "id": 205, "quantity": "1.0", "description": null, "product": { "$key": null }, "service": { "id": 29, "description": "Anfahrtspauschale", "$url": "/accounts/v2/services/29", "$key": 29 }, "product_code": null, "unit_price": "4.2", "unit_price_includes_tax": true, "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.0", "$url": "/accounts/v2/sales_credit_notes/192/line_items/205", "$key": 205 } ], "$url": "/accounts/v2/sales_credit_notes/192", "$key": 192 }, { "#...": "#..." } ] }
Responds with the Sales Credit Note for the ID requested.
No parameters required.
$ curl https://api.sageone.com/accounts/v2/sales_credit_notes/264 \ -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": 264, "contact_id": 44, "contact_name": "Empire State University (Peter Parker)", "invoice_id": 263, "artefact_number": "3928", "artefact_number_prefix": null, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-30", "due_date": null, "reference": "credit note test", "void_reason": null, "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.0", "main_address": "Hofanderecke 3", "delivery_address": "Daweitweg 5", "delivery_address_same_as_main": false, "notes": "Angebot ausdrucken", "line_items": [ { "id": 277, "quantity": "1.0", "description": "Service von Lieferant", "product": { "$key": null }, "service": { "id": 29, "description": "Anfahrtspauschale", "$url": "/accounts/v2/services/29", "$key": 29 }, "product_code": null, "unit_price": "4.2", "unit_price_includes_tax": true, "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.0", "$url": "/accounts/v2/sales_credit_notes/264/line_items/277", "$key": 277 } ], "$url": "/accounts/v2/sales_credit_notes/264", "$key": 264 }
Creates a new Sales Credit Note.
invoice_id
integer
The ID of the associated sales invoice.
contact_id
a
b
credit_note_number
integer
a
line_items[1..*][]
Line Item
Toggle Child Parametersquantity
decimal
The number of units on the line item.
unit_price
decimal
The unit cost of the line item.
unit_price_includes_tax
boolean
True if the line item price includes tax.
service_id
integer
The ID from the Service of the credit invoice.
product_id
integer
The ID from the Product of the credit invoice.
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
reference
string
The Sales Credit Note reference.
notes
string
Any additional information, maximum 1000 characters.
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.
$ 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[contact_id]=44" \ -d "sales_credit_note[credit_note_number]=3928" \ -d "sales_credit_note[line_items_attributes][0][ledger_account_id]=3535" \ -d "sales_credit_note[line_items_attributes][0][quantity]=1.0" \ -d "sales_credit_note[line_items_attributes][0][unit_price]=5.00" \ -d "sales_credit_note[line_items_attributes][0][description]=Service von Lieferant" \ -d "sales_credit_note[line_items_attributes][0][unit_price_includes_tax]=true" \ -d "sales_credit_note[line_items_attributes][0][service_id]=29" \ -d "sales_credit_note[date]=2016-01-30" \ -d "sales_credit_note[reference]=credit note test" \ -d "sales_credit_note[notes]=Angebot ausdrucken" \ -d "sales_credit_note[main_address]=Hofanderecke 3" \ -d "sales_credit_note[delivery_address]=Daweitweg 5" \ -d "sales_credit_note[delivery_address_same_as_main]=false" \ -d "sales_credit_note[invoice_id]=263"
{ "id": 264, "contact_id": 44, "contact_name": "Empire State University (Peter Parker)", "invoice_id": 263, "artefact_number": "3928", "artefact_number_prefix": null, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-30", "due_date": null, "reference": "credit note test", "void_reason": null, "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.0", "main_address": "Hofanderecke 3", "delivery_address": "Daweitweg 5", "delivery_address_same_as_main": false, "notes": "Angebot ausdrucken", "line_items": [ { "id": 277, "quantity": "1.0", "description": "Service von Lieferant", "product": { "$key": null }, "service": { "id": 29, "description": "Anfahrtspauschale", "$url": "/accounts/v2/services/29", "$key": 29 }, "product_code": null, "unit_price": "4.2", "unit_price_includes_tax": true, "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "tax_rate_percentage": "19.0", "net_amount": "5.0", "tax_amount": "0.0", "$url": "/accounts/v2/sales_credit_notes/264/line_items/277", "$key": 277 } ], "$url": "/accounts/v2/sales_credit_notes/264", "$key": 264 }
Update a Sales Credit Note.
date
string
Date string represented as YYYY-MM-DD. See ISO 8601.
reference
string
The Sales Credit Note reference.
notes
string
Any additional information, maximum 1000 characters.
void_reason
string
The void reason 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.
credit_note_number
integer
The artefact_number from the associated invoice.
$ curl -X PUT https://api.sageone.com/accounts/v2/sales_credit_notes/264 \ -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[reference]=updated reference"
{ "id": 264, "contact_id": 44, "contact_name": "Empire State University (Peter Parker)", "invoice_id": 263, "artefact_number": "3928", "artefact_number_prefix": null, "status": { "id": 3, "name": "Bezahlt", "$symbol": "PAID", "$key": 3 }, "date": "2016-01-30", "due_date": null, "reference": "updated reference", "void_reason": null, "outstanding": "0.0", "total_net_amount": "5.0", "total_tax_amount": "0.0", "main_address": "Hofanderecke 3", "delivery_address": "Daweitweg 5", "delivery_address_same_as_main": false, "notes": "Angebot ausdrucken", "line_items": [ { "id": 277, "quantity": "1.0", "description": "Service von Lieferant", "product": { "$key": null }, "service": { "id": 29, "description": "Anfahrtspauschale", "$url": "/accounts/v2/services/29", "$key": 29 }, "product_code": null, "unit_price": "4.2", "unit_price_includes_tax": true, "ledger_account": { "id": 3535, "display_name": "Erlöse 19 % USt", "nominal_code": 8400, "tax_code": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key": 1 }, "ledger_account_type": { "id": 7, "name": "Einnahmen", "$symbol": "INCOME", "$key": 7 }, "$url": "/accounts/v2/ledger_accounts/3535", "vat_changeable": false, "$key": 3535 }, "tax_rate": { "id": 1, "name": "19%", "$symbol": "STANDARD", "$key