-
Notifications
You must be signed in to change notification settings - Fork 1
Redirection after move commences, supplier at fault
Move composed of a redirection plus a cancelled non-billable journey and a completed billable journey
Where redirection events occur due to a fault of the supplier, suppliers are not entitled to payment for the initial journey commenced (A
to B
) before the redirection event. Suppliers will be paid for the actual journey completed (A
to C
). The initial journey (A
to B
) should be marked as non-billable (when suppliers are at fault).
- Move from
A
toB
, redirected toC
after the move starts where the supplier is not at fault - Journey from
A
toB
(non-billable
,proposed -> in_transit -> cancelled
), created before the move was redirected - Journey from
A
toC
(billable
,proposed -> in_transit -> completed
), created after the move was redirected
-
Create a billable journey from
A
toB
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, "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"AAAAAAAA-413b-48c8-b1cf-85c702c5f465" } }, "to_location":{ "data":{ "type":"locations", "id":"BBBBBBBB-8ded-435c-b0c1-ffcade5f1bef" } } } } }'
-
Start the original journey, changing its state from
proposed
toin_transit
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" } } } } }'
-
Cancel the original journey, changing its state from
in_transit
tocancelled
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:18:44.088Z", "recorded_at":"2021-05-07T11:18:44.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyCancel" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"e73f6005-afec-41e2-bcaa-a9747b5af8e3" } } } } }'
-
Update the original journey changing its billable flag from
true
tofalse
curl --request PATCH \ --url /api/moves/{MOVE_ID}/journeys/e73f6005-afec-41e2-bcaa-a9747b5af8e3 \ --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":false } } }'
-
Create a new billable journey from
A
toC
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:38:39.276Z", "billable":true, "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"AAAAAAAA-413b-48c8-b1cf-85c702c5f465" } }, "to_location":{ "data":{ "type":"locations", "id":"CCCCCCCC-8ded-435c-b0c1-ffcade5f1bef" } } } } }'
-
Start the new journey, changing its state from
proposed
toin_transit
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:43:44.088Z", "recorded_at":"2021-05-07T11:43:44.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyStart" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"1a013dda-4142-487d-8e0c-9161fbdf65cc" } } } } }'
-
Complete the new 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:49:34.624Z", "recorded_at":"2021-05-07T11:49:34.624Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyComplete" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"1a013dda-4142-487d-8e0c-9161fbdf65cc" } } } } }'
- 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