# Voyages

## **Voyages**

### **Prerequisites**

No prerequisites.

### **Integration Set-Up**

Accounting systems often require voyage related data before transferring accounting related transactions. Set up a scheduled task and use the request under [Data Transaction](https://dataloy-cloud.atlassian.net/wiki/pages/resumedraft.action?draftId=923414837#AccountingIntegrationAPI-AccIntAPI1) to gather all voyages that has been modified since the last time a scheduled task was run.

### **Test Data**

Modify some existing voyages in the Booking and Operations module for testing, for example, changing a date in the schedule (***note**: changing dates will also affect the schedule for other voyages*).

### **Data Transaction**

To get new voyages in [Webhooks](https://api.dataloy.com/api-release-8.11/dataloy-rest-api/webhooks) the following subscription can be created:

```
{
"eventType": "U",
"user":
"objectType": "VoyageHeader",
"expression": "(oldDlpObject.getVoyageStatus() != null && oldDlpObject.getVoyageStatus().getStatusTypeCode().equals(\"EST\") && dlpObject.getVoyageStatus() != null && dlpObject.getVoyageStatus().getStatusTypeCode().equals(\"NOM\")) || (oldDlpObject.getReferenceNo() == null && dlpObject.getReferenceNo() != null && dlpObject.getVoyageStatus() != null && dlpObject.getVoyageStatus().getStatusTypeCode().equals(\"NOM\"))",
"url":
}
```

To get updated for all changes on a voyage the following webhook subscription can be created:

```
{
"eventType": "U",
"user":
"objectType": "VoyageHeader",
"url":
}
```

To extract all fixed voyages from Dataloy VMS that has been modified since a given date, use request below in conjunction with the base URL:

**Get all fixed voyages modified since given date**

```
GET /VoyageHeader?filter=modifiedDate(GTE)2014-01-01T12:30:00
```

### **Post Transaction**&#x20;

No post transaction is required.

##
