Products
List all products of an administration
Returns a paginated list of products in the administration. Each page contains 10 products. You can use the page
parameter to fetch the next page of products.
Parameters
Parameter | Type | Description |
---|---|---|
query |
String |
Allows filtering by product name. |
page |
Integer |
The page to fetch, starting at 1. |
currency |
String |
ISO three-character currency code, e.g. EUR or USD. |
Example: returns a list of products
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products.json?
Response
Status: 200 OK
[
{
"id": "310252559777400306",
"administration_id": 123,
"description": "Apple",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:39.572Z",
"updated_at": "2021-01-08T09:58:39.572Z"
},
{
"id": "310252559749088753",
"administration_id": 123,
"description": "My product description",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:39.544Z",
"updated_at": "2021-01-08T09:58:39.544Z"
},
{
"id": "310252559802566131",
"administration_id": 123,
"description": "Pie",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:39.596Z",
"updated_at": "2021-01-08T09:58:39.596Z"
}
]
Example: allows filtering by query
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products.json?query=apple
Response
Status: 200 OK
[
{
"id": "310252564367017461",
"administration_id": 123,
"description": "Apple",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:43.944Z",
"updated_at": "2021-01-08T09:58:43.944Z"
}
]
Example: handles empty search result
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products.json?query=kjashdfjksadhfjk
Response
Status: 200 OK
[
]
Example: returns a paginated response for page 2
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products.json?page=2&per_page=1
Response
Status: 200 OK
[
{
"id": "310252571151304186",
"administration_id": 123,
"description": "My product description",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:50.406Z",
"updated_at": "2021-01-08T09:58:50.406Z"
}
]
Returns information about a product
Example: returns a single product
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products/310252571566540285.json?
Response
Status: 200 OK
{
"id": "310252571566540285",
"administration_id": 123,
"description": "My product description",
"price": "100.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:50.801Z",
"updated_at": "2021-01-08T09:58:50.801Z"
}
Example: returns 404 when product does not exist
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/products/34123123.json?
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"id": "not_found"
}
}
Creates a new product
Parameters
Parameter | Type | Description |
---|---|---|
product[description] |
String |
Required |
product[price] |
Decimal |
Required Both a decimal and a string ‘10,95’ are accepted. |
product[tax_rate_id] |
Integer |
Required Should be a valid tax rate id. |
product[ledger_account_id] |
Integer |
Required Should be a valid ledger account id. |
product[currency] |
String |
Required ISO three-character currency code, e.g. EUR or USD. |
product[frequency_type] |
String |
Can be |
product[frequency] |
Integer |
Should be an integer >= 1. |
product[frequency_preset] |
String |
Example: creates a new product
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"product":{"description":"Geldvogel","price":"50,50","tax_rate_id":310252572205123073,"ledger_account_id":310252572281669123}}' \
https://moneybird.com/api/v2/123/products.json
Response
Status: 201 Created
{
"id": "310252572448392709",
"administration_id": 123,
"description": "Geldvogel",
"price": "50.5",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252572205123073",
"ledger_account_id": "310252572281669123",
"created_at": "2021-01-08T09:58:51.641Z",
"updated_at": "2021-01-08T09:58:51.641Z"
}
Example: returns an error when information is missing
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"product":{"description":"","price":"","tax_rate_id":310252572649719304,"ledger_account_id":310252572706342410}}' \
https://moneybird.com/api/v2/123/products.json
Response
Status: 422 Unprocessable Entity
{
"error": {
"description": [
"cannot be empty"
],
"price": [
"cannot be empty"
]
}
}
Updates a product
Parameters
Parameter | Type | Description |
---|---|---|
product[description] |
String |
|
product[price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
product[tax_rate_id] |
Integer |
Should be a valid tax rate id. |
product[ledger_account_id] |
Integer |
Should be a valid ledger account id. |
product[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
product[frequency_type] |
String |
Can be |
product[frequency] |
Integer |
Should be an integer >= 1. |
product[frequency_preset] |
String |
Example: updates a contact
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"product":{"description":"Updated","price":"123"}}' \
https://moneybird.com/api/v2/123/products/310252572933883404.json
Response
Status: 200 OK
{
"id": "310252572933883404",
"administration_id": 123,
"description": "Updated",
"price": "123.0",
"currency": "EUR",
"frequency": null,
"frequency_type": null,
"tax_rate_id": "310252331908203676",
"ledger_account_id": "310252331758257288",
"created_at": "2021-01-08T09:58:52.104Z",
"updated_at": "2021-01-08T09:58:52.218Z"
}
Deletes a product
Example: deletes a product
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/products/310252573145695757.json