1C:Enterprise has a new REST web-service interface. It's based on the OData standard www.odata.org.

OData endpoint: https://apps7.accountingsuite.com/a/{tenant_id}/odata/standard.odata

The OData feature has to be enabled for production use. For testing purposes, you can use the shared demo database that can be accessed at https://apps2.accountingsuite.com/odatatesting/1100515/en_US/ (e-mail: apidemo@demo.com, password: demo).

A nice client we suggest using for testing is the apigee web console. This client makes it easy to send GET and POST requests, along with the ability to pass in Headers, and Body entries.

The OData supports all major catalog and document modules of AccountingSuite along with a few other modules. For sample purposes, we will be using Catalog_Products, Catalog_Companies, Catalog_Addresses, ChartOfAccounts_ChartOfAccounts, and Document_GeneralJournalEntry. This is the typical naming format for our metadata types. You can get support for this OData (knowledge base, tickets, and live chat) at help.accountingsuite.com

You can get support for the API (knowledge base, tickets, and live chat) at accountingsuite.com/support.

Register your application

The first step in connecting your application with AccountingSuite is registering it. To do this make a request submitting appname, redirect_uri, and apisecretkey of your developer account (Settings / Development / apisecretkey). Make sure your redirect_uri starts with "http://" or "https://" to ensure it redirects to the correct url. For example:

curl https://oauth.accountingsuite.com/register_app \
-d '{"appname": "Rapid CRM","redirect_uri": "https://dev.company_name.com/accountingsuite_oauth", "apisecretkey": "dGmlayoUnlNcitybVTMu"}'

You will receive back your client_id (application ID), for example:

{"client_id": "O4JaqvBTe2YKhh3iOX2z"}

Send your users to AccountingSuite

Add a Connect with AccountingSuite button to your application to link your users to our endpoint:

https://oauth.accountingsuite.com/authorize?response_type=code&client_id=O4JaqvBTe2YKhh3iOX2z&state=12345

The state parameter is an arbitrary string we will pass back to you, useful for CSRF protection.

If a user already has an AccountingSuite account, they'll be able to give you secure access in just a few clicks. After the user connects, we'll redirect them back to the redirect_uri you provided:

HTTP/1.1 302 Found
Location: https://redirect_uri?code=knbujs4awcvux04qmf7z&tenant_id=1100515&state=12345

Or, if the authorization was denied, we'll include an error instead:

HTTP/1.1 302 Found
Location: https://redirect_uri?error=access_denied&state=12345

After the user has connected

Using the code parameter we sent back to your redirect_uri endpoint, you should make a POST request to our oauth_token endpoint:

curl -X POST https://oauth.accountingsuite.com/oauth_token \
  -d client_secret=dGmlayoUnlNcitybVTMu \
  -d client_id=O4JaqvBTe2YKhh3iOX2z \
  -d code=knbujs4awcvux04qmf7z \
  -d grant_type=authorization_code

client_secret parameter in the request is the apisecretkey of your developer account.

AccountingSuite will generate a base64 encoding of the client's api credentials. base64(api:apisecretkey) We return this value to you as the ACCESS_TOKEN, along with the tenant_id, which you can use for all API communications. You're done!

{
  "token_type": "Basic",
  "access_token": ACCESS_TOKEN,
  "tenant_id": "1100515"
}
{
  "error": "invalid_grant",
  "error_description": "Authorization code does not exist: AUTHORIZATION_CODE"
}

Using a Client

Sometimes, you just need an apisecretkey to your own account, without going through the hassle of creating an entire OAuth flow. We hear ya. You can just grab the apisecretkey in Settings / Development, and generate your ACCESS_TOKEN.

This can be done by base64 encoding {api:apisecretkey}, or even with your regular {login_email}:{pwd}. For example, apidemo@demo.com:demo will be YXBpZGVtb0BkZW1vLmNvbTpkZW1v. The key also needs the word Basic infront of the code. So the header will look like so:

Authorization: Basic YXBpZGVtb0BkZW1vLmNvbTpkZW1v

Using a Web Browser

When sending a request with a web browser using the URL, a small window will appear asking for credentials. Your normal email and password will work just like when you login to the AccountingSuite interface.

This authorization key can also be seen using the developer tools on your web browser. If you click Network, and look under Headers, you will see the authorization section.


To get a list of all products:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Products?$format=json

Example request:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Products?$format=json

Example response:



To get a specific product, you will need to pass in the product's unique identifier. This can be found under the guid' field, or the api_code field in the AccountingSuite interface.

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Products(guid'{api_code}')?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Products(guid'799dcd06-5065-11e3-8058-e3003205b13a')?$format=json

Example response:



To create a product, you have to pass in the BODY of the request a JSON entry with desired fields.

Definition:

POST https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Products?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Products?$format=json

BODY =

Example response:



To get a list of all companies:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Companies?$format=json

Example request:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Companies?$format=json

Example response:



To get a specific company:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Companies(guid'{api_code}')?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Companies(guid'65189006-736f-11e3-8058-e3003205b13a')?$format=json

Example response:



To create a company:

Definition:

POST https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Companies?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Companies?$format=json

BODY =

Example response:



To get a list of all addresses:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Addresses?$format=json

Example request:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Addresses?$format=json

Example response:



To get a specific address:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Addresses(guid'{api_code}')?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Addresses(guid'01c386d4-515a-11e3-8058-e3003205b13a')?$format=json

Example response:



Here is how to create an address. Notice that the owner has to pass in a company api_code. This allows the addresses to be linked to a specific company.

Definition:

POST https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Catalog_Addresses?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Catalog_Addresses?$format=json

BODY =

Example response:



To get a list of all accounts:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/ChartOfAccounts_ChartOfAccounts?$format=json

Example request:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/ChartOfAccounts_ChartOfAccounts?$format=json

Example response:



To get a specific account:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/ChartOfAccounts_ChartOfAccounts(guid'{api_code}')?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/ChartOfAccounts_ChartOfAccounts(guid'45f4b4aa-2532-11e3-8b49-bab74d291c34')?$format=json

Example response:



Here is how to create a new account.

Definition:

POST https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/ChartOfAccounts_ChartOfAccounts?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/ChartOfAccounts_ChartOfAccounts?$format=json

BODY =

Example response:



To get a list of all Journal Entries:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Document_GeneralJournalEntry?$format=json

Example request:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Document_GeneralJournalEntry?$format=json

Example response:



To get a specific Journal Entry:

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Document_GeneralJournalEntry(guid'{api_code}')?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Document_GeneralJournalEntry(guid'0cce534c-250b-11e5-80d1-0cc47a07f049')?$format=json

Example response:



Here is how to create a new Journal Entry.

Definition:

POST https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Document_GeneralJournalEntry?$format=json

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Document_GeneralJournalEntry?$format=json

BODY =

Example response:



At this point, the journal entry document is created and saved, but it will not reflect in the General Ledger. To do this, the document must be posted. After any document is created, retrieve the Ref_Key from the response and make the following API call.

Definition:

GET https://apps2.accountingsuite.com/odatatesting/{tenant_id}/odata/standard.odata/Document_GeneralJournalEntry(guid'{api_code}')/Post?PostingModeOperational=false

Example requests:

https://apps2.accountingsuite.com/odatatesting/1100515/odata/standard.odata/Document_GeneralJournalEntry(guid'e2100c14-2f16-11e5-80d1-0cc47a07f049')/Post?PostingModeOperational=false