Companies¶
Companies are accessible under the https://*.recras.nl/api2/bedrijven
namespace.
Create¶
- POST /api2/bedrijven¶
Create a company
Example request
POST /api2/bedrijven HTTP/1.1 Host: demo.recras.nl Accept: application/json { "bedrijfsnaam": "Company name (internal)", "weergavenaam": "Company name (as communicated to customers)", "slogan": "Company's slogan", "email": "company@example.com", "factuur_pdf_template_id": 3, "onderwerp_mail_eindfactuur": "Final invoice email subject", "body_mail_eindfactuur": "Final invoice email body", "onderwerp_eerste_betalingsherinnering": "First payment reminder email subject", "body_eerste_betalingsherinnering": "First payment reminder email body", "onderwerp_tweede_betalingsherinnering": "Second payment reminder email subject", "body_tweede_betalingsherinnering": "Second payment reminder email body", "onderwerp_betaalbevestiging": "Payment confirmation email subject", "body_betaalbevestiging": "Payment confirmation email body", "factuur_betaaltermijn": 30 }
- Status Codes:
201 Created – Resource created
403 Forbidden – Authenticated user lacks the
editBedrijfsgegevens
permission.
- Response Headers:
Location – The URI of the newly created resource.
- JSON Parameters:
bedrijfsnaam (string) – The internal company name
weergavenaam (string) – The company name as communicated to customers. Will take the value of
bedrijfsnaam
if empty.slogan (string) – The company slogan
email (email) – Required. The envelope address for emails sent from this company
factuur_betaaltermijn (integer) – The default number of days to set the payment deadline for invoices. Must be ≥ 0, see v1.0.1 (2020-06)
factuur_pdf_template_id (integer) – Required. The ID of a PDF template with the
invoice
context.onderwerp_mail_eindfactuur (string) – Required. The default subject line for invoice emails.
body_mail_eindfactuur (string) – Required. The default body for invoice emails.
onderwerp_eerste_betalingsherinnering (string) – Required. The subject line for the first invoice reminder.
body_eerste_betalingsherinnering (string) – Required. The body for the first invoice reminder.
onderwerp_tweede_betalingsherinnering (string) – Required. The subject line for the second invoice reminder.
body_tweede_betalingsherinnering (string) – Required. The body for the second invoice reminder.
onderwerp_betaalbevestiging (string) – Required. The subject line for the payment confirmation.
body_betaalbevestiging (string) – Required. The body for the payment confirmation.
other_fields (mixed) – This documentation is incomplete, please contact the Recras development team if you have specific questions regarding this API.
Example response
HTTP/1.1 201 Created Content-Type: application/json { "id": 8, "bedrijfsnaam": "Company name (internal)", "weergavenaam": "Company name (as communicated to customers)", "slogan": "Company's slogan", "adres": null, "postcode": null, "plaats": null, "landcode": null, "iban": null, "bic": null, "bank_tnv": null, "btw_nummer": null, "kvk_nummer": null, "factuur_betaaltermijn": 30, "website": null, "telefoon": null, "soort_klanten": [], "free_relation_fields": [], "email": "company@example.com", "smtp_integration_id": null, "ondertekening_standaardmails": null, "programmarender_aantallen": false, "default_font": "Arial", "factureren_na_dagen": 0, "factuur_pdf_template_id": 3, "kassa_factuur_pdf_template_id": null, "online_boeking_factuur_pdf_template_id": null, "onderwerp_mail_eindfactuur": "Final invoice email subject", "body_mail_eindfactuur": "Final invoice email body", "onderwerp_eerste_betalingsherinnering": "First payment reminder email subject", "body_eerste_betalingsherinnering": "First payment reminder email body", "onderwerp_tweede_betalingsherinnering": "Second payment reminder email subject", "body_tweede_betalingsherinnering": "Second payment reminder email body", "onderwerp_betaalbevestiging": "Payment confirmation email subject", "body_betaalbevestiging": "Payment confirmation email body", "locale": "nl_NL", "standaard_aanhef": "Beste {contactpersoon_aanspreeknaam}", "attentietekst": "t.a.v.", "standaard_titel_man": "meneer", "standaard_titel_vrouw": "mevrouw", "latitude": null, "longitude": null, "communication_default_mail_subject": "", "mollie_api_key": "", "deleted_at": null, "logo_href": null, "is_deletable": true, "_links": { "meta": { "delete_reasons": [] } } }
Read¶
- GET /api2/bedrijven¶
Retrieve a list of companies
- Query Parameters:
is_deleted (boolean) – Default: empty. With a true value, previously deleted companies will be included in the result.
- Status Codes:
200 OK – OK
406 Not Acceptable – Error in a query parameter, expect the response to be a list of error objects.
- GET /api2/bedrijven/(int: id)¶
Retrieve a single company resource.
- Status Codes:
200 OK – OK
406 Not Acceptable – Error in a query parameter, expect the response to be a list of error objects.
- JSON Parameters:
is_deletable (boolean) – Wether this resource can be deleted. See
DELETE /api2/bedrijven/(int:id)
.
Update¶
- PUT /api2/bedrijven/(int: id)¶
The companies-endpoint supports PUT-back semantics: please retrieve a resource, update some values and send everything back. Partial updates may work but are not supported.
- Status Codes:
200 OK – OK
403 Forbidden – Authenticated user lacks the
editBedrijfsgegevens
permission406 Not Acceptable – Error in the payload, expect the response to be a list of error objects.
Delete¶
- DELETE /api2/bedrijven/(int: id)¶
This resource has soft-delete semantics: deleting it does not remove it from the database, but archives it and makes it invisible. This endpoint is only available for resources with the
is_deletable
flag set totrue
. SeeGET /api2/bedrijven/(int:id)
.- Status Codes:
200 OK – OK
500 Internal Server Error – The resource is not deletable, or another error occured.
Version history¶
v1.0.1 (2020-06)¶
Fixed factuur_betaaltermijn
, which used to accept negative values.
This would trigger errors in calculating the payment deadline of invoices, thus failing to render the invoice.
v1.0.0¶
Original version, released way in the past.