Product Groups (Productgroepen)¶
Current version: 1.0.0
Create¶
- POST /api2/productgroepen¶
Create a new product group
Example request:
POST /api2/productgroepen HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "Sport", "slug": "sport", "ledger_number": "1001" }
Example response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api2/productgroepen/5 { "id": 2, "naam": "Sport", "slug": "sport", "ledger_number": "1001" }
- JSON Parameters:
naam (string) – Required Name of the product group (naam means name)
slug (string) – Unique name for use in tag, allowed characters are: lowercase letters, numbers,
-
(hyphen) and_
(underscore) (koppelteken means hyphen, laag streepje means underscore)ledger_number (string) – Ledger number (Grootboeknummer) to use with this product group. May contain letters and numbers.
- Response Headers:
Location – The location of the new product group
- Status Codes:
201 Created – Product group created (Productgroep gemaakt)
406 Not Acceptable – Error in input (Fout in de invoer)
403 Forbidden – User does not have the
editProducten
(editProducts) permission (Gebruiker heeft het recht editProducten niet)
Read¶
These endpoints are publicly accessible and do not require authentication.
- GET /api2/productgroepen¶
The product groups in Recras
Example request:
GET /api2/productgroepen HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "naam": "Eten", // (name: "Food") "slug": "eten", // (food) "ledger_number": "1004" } ]
- Status Codes:
200 OK – no error
- GET /api2/productgroepen/(int: id)¶
A specific product group
Example request:
GET /api2/productgroepen/1 HTTP/1.1 Host: demo.recras.nl Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "naam": "Eten", // (name: "Food") "slug": "eten", // (food) "ledger_number": "1004" }
- Status Codes:
200 OK – OK
404 Not Found – No product group with this
id
(Geen productgroep met deze id)
Update¶
- PUT /api2/productgroepen/(int: id)¶
Example request:
PUT /api2/productgroepen/2 HTTP/1.1 Host: demo.recras.nl Accept: application/json { "id": 2 "naam": "Sporten", }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 2, "naam": "Sporten", "slug": "sport", "ledger_number": "1001" }
- JSON Parameters:
id (int) – ID-nummer, mag niet veranderd worden
naam (string) – Name of the product group (naam means name)
slug (string) – Unique name for use in tag, allowed characters are: lowercase letters, numbers,
-
(hyphen) and_
(underscore) (koppelteken means hyphen, laag streepje means underscore)ledger_number (string) – Ledger number (Grootboeknummer) to use with this product group. May contain letters and numbers.
- Status Codes:
200 OK – Product group updated (Productgroep aangepast)
406 Not Acceptable – Error in input (Fout in de invoer)
403 Forbidden – User does not have the
editProducten
(editProducts) permission (Gebruiker heeft het recht editProducten niet)
Delete¶
- DELETE /api2/productgroepen/(int: id)¶
Example request:
DELETE /api2/productgroepen/2 HTTP/1.1 Host: demo.recras.nl
Example response:
HTTP/1.1 200 OK
- Status Codes:
200 OK – Product group deleted (Productgroep verwijderd)
403 Forbidden – User does not have the
editProducten
(editProducts) permission (Gebruiker heeft het recht editProducten niet)