Skip to main content

Re-assign orders to drivers

PUT {{base_url}}/orders/{deliveryOrderUuid}/re-assign

Description

This API endpoint facilitates the reassignment of a delivery order to a different driver within a specified country and tenant. The reassignment is triggered by providing the delivery order's unique identifier along with the desired driver's user ID. Below is the documentation outlining the request and response structure:

Request

Headers:

HeaderDescription
countryCodeA string representing the country code.
tenantIdA string identifying the tenant.

Path Parameters:

ParameterDescription
deliveryOrderUuidThe unique identifier of the delivery order.

Request Body:

<request>
<userId>string</userId>
<driverId>string</driverId>
</request>

{
"userId": "string",
"driverId": "string"
}

Responses:

  • 200 OK
<response>
<status>true</status>
<statusCode>0</statusCode>
<message>Order successfully reassigned to the specified driver.</message>
<data></data>
<errors></errors>
</response>

{
"status": true,
"statusCode": 0,
"message": "Order successfully reassigned to the specified driver.",
"data": {},
"errors": []
}

400 Bad Request:

Example

<response>
<status>false</status>
<statusCode>400</statusCode>
<message>Invalid reference supplied.</message>
<data></data>
<errors>
<error>
<message>Invalid reference supplied.</message>
<descriptiveMessage>The provided reference is not valid. Please ensure correct values are supplied.</descriptiveMessage>
</error>
</errors>
</response>

{
"status": false,
"statusCode": 400,
"message": "Invalid reference supplied.",
"data": {},
"errors": [
{
"message": "Invalid reference supplied.",
"descriptiveMessage": "The provided reference is not valid. Please ensure correct values are supplied."
}
]
}


404 Not Found Description:

Indicates that the specified delivery order could not be found or is not assignable to the provided driver.

Example

<response>
<status>false</status>
<statusCode>404</statusCode>
<message>Order not found or not assignable.</message>
<data></data>
<errors>
<error>
<message>Order not found or not assignable.</message>
<descriptiveMessage>The specified delivery order could not be found or is not assignable to the provided driver.</descriptiveMessage>
</error>
</errors>
</response>

{
"status": false,
"statusCode": 404,
"message": "Order not found or not assignable.",
"data": {},
"errors": [
{
"message": "Order not found or not assignable.",
"descriptiveMessage": "The specified delivery order could not be found or is not assignable to the provided driver."
}
]
}


LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request PUT \ 
--url /orders/{deliveryOrderUuid}/re-assign \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!