-
Notifications
You must be signed in to change notification settings - Fork 1
Single journey move
Thomas Leese edited this page Feb 8, 2022
·
2 revisions
- Move from
A
toB
- Journey from
A
toB
(billable
,proposed -> started -> completed
)
-
Create a billable journey for the move (in a proposed state)
curl --request POST \ --url /api/moves/{MOVE_ID}/journeys \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"journeys", "attributes":{ "timestamp":"2021-05-07T11:08:39.276Z", "billable":true, "date": "2021-05-07", "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"dc76e71d-413b-48c8-b1cf-85c702c5f465" } }, "to_location":{ "data":{ "type":"locations", "id":"8fa68589-8ded-435c-b0c1-ffcade5f1bef" } } } } }'
-
Start the journey, changing its state from
proposed
toin_progress
curl --request POST \ --url /api/events \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"events", "attributes":{ "occurred_at":"2021-05-07T11:13:44.088Z", "recorded_at":"2021-05-07T11:13:44.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyStart" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"e73f6005-afec-41e2-bcaa-a9747b5af8e3" } } } } }'
-
Complete the journey, changing its state from
in_progress
tocompleted
curl --request POST \ --url /api/events \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"events", "attributes":{ "occurred_at":"2021-05-07T11:19:34.624Z", "recorded_at":"2021-05-07T11:19:34.624Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyComplete" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"e73f6005-afec-41e2-bcaa-a9747b5af8e3" } } } } }'
- API Guide
- Version 2
- Asked Questions
- Webhook & Email notifications
- Walkthroughs
- Deployment
- Useful Queries
- Data quality improvements
-
Journeys and Payment Related Calls
- Single journey move
- Redirection before move commences
- Redirection after move commences
- Lockouts and Lodgings
- Assessments
- Event Documentation
- GPS Track a move