Defaults in Space Invoices serve as a combination of system-defined and user-defined settings for an Organization. These settings help tailor the platform to meet your specific requirements and preferences. Alongside the predefined system values, you can add any additional value to this model as custom settings.
For ease of use, the defaults are included within the organization model when it is retrieved. This integration streamlines the process of configuring and maintaining your organization's settings, allowing you to focus on managing your invoices and clients more effectively.
Endpoints:
- POST /v1/Organizations/:id/defaults
- GET /v1/Defaults/:id
- GET /v1/Organizations/:id/defaults
- GET /v1/Organizations/:id/defaults/count
- PUT /v1/Organizations/:id/defaults/:fk
- PATCH /v1/Defaults/:id
- DELETE /v1/Defaults/:id
The Default object
Parameters
-
id string readonly
-
name string
-
value object
-
description string
-
organizationId string readonly
-
createdAt date readonly
-
updatedAt date readonly
-
Object for storing localized values of strings
Additional propertiesExpand all
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
Create Default
POST /v1/Organizations/:id/defaults
Parameters
Path
-
id string required
Organization id
Properties
-
name string required
-
value object optional
-
description string optional
-
Object for storing localized values of strings
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/defaults', {
method: 'POST',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
name: 'string',
value: {},
description: 'string',
l10n: {}
})
});
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/Organizations/{id}/defaults \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "string", \
"value": {}, \
"description": "string", \
"l10n": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/defaults'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'name': 'string',
'value': {},
'description': 'string',
'l10n': {}
}
response = requests.post(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
Get Default
GET /v1/Defaults/:id
Parameters
Path
-
id string required
Model id
Query
-
filter string optional
Filter defining fields and include - must be a JSON-encoded string ({"something":"value"})
const response = await fetch('https://api.spaceinvoices.com/v1/Defaults/{id}', {
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/Defaults/{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/Defaults/{id}'
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:
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
Find Defaults
GET /v1/Organizations/:id/defaults
Parameters
Path
-
id string required
Organization id
Query
-
filter string optional
const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/defaults', {
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}/defaults \
-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}/defaults'
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:
[
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
]
Count Defaults
GET /v1/Organizations/:id/defaults/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}/defaults/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}/defaults/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}/defaults/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 Default
PUT /v1/Organizations/:id/defaults/:fk
Parameters
Path
-
id string required
Organization id
-
fk string required
Foreign key for _defaults
Properties
-
name string required
-
value object optional
-
description string optional
-
Object for storing localized values of strings
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/defaults/{fk}', {
method: 'PUT',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
name: 'string',
value: {},
description: 'string',
l10n: {}
})
});
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/Organizations/{id}/defaults/{fk} \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "string", \
"value": {}, \
"description": "string", \
"l10n": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/defaults/{fk}'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'name': 'string',
'value': {},
'description': 'string',
'l10n': {}
}
response = requests.put(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
Patch Default
PATCH /v1/Defaults/:id
Parameters
Path
-
id string required
Default id
Properties
-
name string required
-
value object optional
-
description string optional
-
Object for storing localized values of strings
Additional propertiesExpand all
const response = await fetch('https://api.spaceinvoices.com/v1/Defaults/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json'
},
body: JSON.stringify({
name: 'string',
value: {},
description: 'string',
l10n: {}
})
});
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/Defaults/{id} \
-H 'Authorization: ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "string", \
"value": {}, \
"description": "string", \
"l10n": {}
}'
Login to auto-insert your own access token.
Your access token displayed in examples.
import requests
url = 'https://api.spaceinvoices.com/v1/Defaults/{id}'
headers = {
'Authorization': 'ACCESS_TOKEN',
'content-type': 'application/json',
}
params = {
'name': 'string',
'value': {},
'description': 'string',
'l10n': {}
}
response = requests.patch(url, json=params, headers=headers)
Login to auto-insert your own access token.
Your access token displayed in examples.
Response:
{
"name": "string",
"value": {},
"description": "string",
"id": "string",
"organizationId": "string",
"createdAt": "2022-04-20T10:10:30+00:00Z",
"updatedAt": "2022-04-20T10:10:30+00:00Z",
"l10n": {}
}
const response = await fetch('https://api.spaceinvoices.com/v1/Defaults/{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/Defaults/{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/Defaults/{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
}