78 lines
4.0 KiB
Markdown
78 lines
4.0 KiB
Markdown
# PUT Travel reimbursement
|
|
This PUT modifies an existing reimbursement item.
|
|
|
|
#### Location
|
|
```
|
|
/api/v1/office/travel-reimburse/
|
|
```
|
|
|
|
#### Permissions required
|
|
`office-travel-reimburse` RW
|
|
|
|
>[!note]
|
|
>You can only update the travel reimbursements on your user.
|
|
|
|
#### Body parameters
|
|
| Parameter | Type | Required | Description |
|
|
| ----------------------------------- | ------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| reimburse_uuid | uuid | yes | Unique id of the reimburse to edit |
|
|
| departure_postcode | string | yes | Postcode of the departure point |
|
|
| destination_postcode | string | yes | Postcode of the destination point |
|
|
| travel_date | date | yes | The date of the travel (YYYY-MM-DD) |
|
|
| travel_distance | integer | yes | The travel distance |
|
|
| travel_description | string | no | Description of the travel |
|
|
| office_travelreimburse_company_uuid | uuid | yes, if customers module enabled | *Only when the Customers modules is enabled* The company uuid that the travel is linked to. Set the home/work travel company in system settings |
|
|
| office_travelreimburse_company_name | string | yes, if customers module disabled | *Only when the Customers module is disabled* The that the travel is linked to. Set the home/work travel company in system settings |
|
|
| homework | int | 1 or 0 | Set to 1 if the travel entry is home-work travel. |
|
|
|
|
### Example Body (json)
|
|
```json
|
|
{
|
|
"reimburse_uuid": "1c0b5323-6d79-11f1-8c62-bc2411125ba4",
|
|
"departure_postcode": "3448BT",
|
|
"destination_postcode": "3433AA",
|
|
"travel_date": "2026-06-21",
|
|
"travel_distance": "56",
|
|
"travel_description": "Example description",
|
|
"office_travelreimburse_company_uuid": "0f6a9c83-809b-4d54-8b16-a8197ac64ab4",
|
|
"homework": 1
|
|
}
|
|
```
|
|
|
|
### Example Request
|
|
```php
|
|
$curl = curl_init();
|
|
|
|
curl_setopt_array($curl, [
|
|
CURLOPT_URL => $baseUrl . '/api/v1/office/travel-reimburse/',
|
|
CURLOPT_RETURNTRANSFER => true,
|
|
CURLOPT_POST => true,
|
|
CURLOPT_POSTFIELDS => $json_payload,
|
|
CURLOPT_HTTPHEADER => [
|
|
'Authorization: Bearer ' . $token,
|
|
'Content-Type: application/json',
|
|
'X-HTTP-Method-Override: PUT'
|
|
],
|
|
]);
|
|
|
|
$response = curl_exec($curl);
|
|
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
|
|
|
if ($response === false) {
|
|
echo curl_error($curl);
|
|
}
|
|
|
|
curl_close($curl);
|
|
```
|
|
|
|
### Example Response
|
|
```json
|
|
"Module enabled successfully."
|
|
```
|
|
|
|
#### Known errors or issues.
|
|
None are known at the time
|
|
If you do encounter issues and get an http code in return, check the response codes on this page.
|
|
|
|
|