DocumentCategories work in conjunction with Categories to categorize income and expenses. A DocumentCategory can be added to an invoice, either for the full invoice amount or just a part of it.
This feature helps you to better organize and classify your transactions, allowing for improved financial tracking and reporting within your Organization.
Endpoints:
- POST /v1/Documents/:id/documentCategories
- GET /v1/Organizations/:id/documentCategories
- GET /v1/Organizations/:id/documentCategories/count
- PUT /v1/DocumentCategories/:id
- PATCH /v1/DocumentCategories/:id
- DELETE /v1/DocumentCategories/:id
The DocumentCategory object
Parameters
-
id string readonly
-
amount number
-
date date
-
categoryId string
-
amountConverted number readonly
-
organizationId string readonly
-
documentId string readonly
-
createdAt date readonly
-
updatedAt date readonly
-
deletedAt date readonly
-
_isDeleted boolean readonly
-
deletedId string readonly
-
Custom field for freeform data input
Additional propertiesExpand all
{
"amount": 42,
"amountConverted": 42,
"date": "2022-04-20T10:10:30+00:00Z",
"id": "string",
"organizationId": "string",
"documentId": "string",
"categoryId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"deletedAt": "2022-04-20T10:10:30+00:00Z",
"_isDeleted": false,
"deletedId": "string",
"custom": {}
}
Create DocumentCategory
POST /v1/Documents/:id/documentCategories
Parameters
Path
-
id string required
Document id
Properties
-
amount number required
-
categoryId string required
-
date date optional
-
Default is: {}
Custom field for freeform data input
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/Documents/{id}/documentCategories', {
method: 'POST',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
amount: 42,
date: '2022-04-20T10:10:30+00:00Z',
categoryId: 'string',
custom: {}
})
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X POST https://api.spaceinvoices.com/v1/Documents/{id}/documentCategories \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"amount": 42, \
"date": "2022-04-20T10:10:30+00:00Z", \
"categoryId": "string", \
"custom": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Documents/{id}/documentCategories'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'amount': 42,
'date': '2022-04-20T10:10:30+00:00Z',
'categoryId': 'string',
'custom': {}
}
response = requests.post(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"amount": 42,
"amountConverted": 42,
"date": "2022-04-20T10:10:30+00:00Z",
"id": "string",
"organizationId": "string",
"documentId": "string",
"categoryId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"deletedAt": "2022-04-20T10:10:30+00:00Z",
"_isDeleted": false,
"deletedId": "string",
"custom": {}
}
Find DocumentCategories
GET /v1/Organizations/:id/documentCategories
Parameters
Path
-
id string required
Organization id
Query
-
filter string optional
const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories', {
method: 'GET',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
}
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X GET https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
[
{
"amount": 42,
"amountConverted": 42,
"date": "2022-04-20T10:10:30+00:00Z",
"id": "string",
"organizationId": "string",
"documentId": "string",
"categoryId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"deletedAt": "2022-04-20T10:10:30+00:00Z",
"_isDeleted": false,
"deletedId": "string",
"custom": {}
}
]
Count DocumentCategories
GET /v1/Organizations/:id/documentCategories/count
Parameters
Path
-
id string required
Organization id
Query
-
where string optional
Criteria to match model instances
const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories/count', {
method: 'GET',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
}
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X GET https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories/count \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/documentCategories/count'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"count": 42
}
Replace DocumentCategory
PUT /v1/DocumentCategories/:id
Parameters
Path
-
id string required
Model id
Properties
-
amount number required
-
categoryId string required
-
date date optional
-
Default is: {}
Custom field for freeform data input
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/DocumentCategories/{id}', {
method: 'PUT',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
amount: 42,
date: '2022-04-20T10:10:30+00:00Z',
categoryId: 'string',
custom: {}
})
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X PUT https://api.spaceinvoices.com/v1/DocumentCategories/{id} \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"amount": 42, \
"date": "2022-04-20T10:10:30+00:00Z", \
"categoryId": "string", \
"custom": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/DocumentCategories/{id}'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'amount': 42,
'date': '2022-04-20T10:10:30+00:00Z',
'categoryId': 'string',
'custom': {}
}
response = requests.put(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"amount": 42,
"amountConverted": 42,
"date": "2022-04-20T10:10:30+00:00Z",
"id": "string",
"organizationId": "string",
"documentId": "string",
"categoryId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"deletedAt": "2022-04-20T10:10:30+00:00Z",
"_isDeleted": false,
"deletedId": "string",
"custom": {}
}
Patch DocumentCategory
PATCH /v1/DocumentCategories/:id
Parameters
Path
-
id string required
DocumentCategory id
Properties
-
amount number optional
-
date date optional
-
categoryId string optional
-
Default is: {}
Custom field for freeform data input
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/DocumentCategories/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
amount: 42,
date: '2022-04-20T10:10:30+00:00Z',
categoryId: 'string',
custom: {}
})
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X PATCH https://api.spaceinvoices.com/v1/DocumentCategories/{id} \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"amount": 42, \
"date": "2022-04-20T10:10:30+00:00Z", \
"categoryId": "string", \
"custom": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/DocumentCategories/{id}'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'amount': 42,
'date': '2022-04-20T10:10:30+00:00Z',
'categoryId': 'string',
'custom': {}
}
response = requests.patch(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"amount": 42,
"amountConverted": 42,
"date": "2022-04-20T10:10:30+00:00Z",
"id": "string",
"organizationId": "string",
"documentId": "string",
"categoryId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"deletedAt": "2022-04-20T10:10:30+00:00Z",
"_isDeleted": false,
"deletedId": "string",
"custom": {}
}
Delete DocumentCategory
DELETE /v1/DocumentCategories/:id
Parameters
Path
-
id string required
Model id
const response = await fetch('https://api.spaceinvoices.com/v1/DocumentCategories/{id}', {
method: 'DELETE',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
}
});
Login to auto-populate your access token.
Your access token is displayed in examples.
Prerequisite: npm install node-fetch
curl -X DELETE https://api.spaceinvoices.com/v1/DocumentCategories/{id} \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/DocumentCategories/{id}'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
response = requests.delete(url, params={}, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"count": 1
}