Skip to main content

Update provider

Use this api to update provider

Flow: Validate input then update data.

URL : /api/shipping-manage/provider/{id}

Method : PATCH

Authorization : Use OAuth token

Validate Rule

'id' => ['required', 'exists:provider,id'],
'status' => ['nullable', 'int'],
'view_status' => ['nullable', 'int'],
'updated_at' => ['required', 'date'], // current updated_at value of entity

Example

{
"view_status": 0,
"updated_at" : "2023-04-13T09:53:54.000000Z"
}

Success Response

Code : 200 OK

Content example

{
"success": true,
"errors": null,
"errorCode": null,
"data": {
"id": 1,
"name": "Ahamove",
"code": "ahamove",
"status": 1,
"view_status": 0,
"created_at": "2023-04-13T09:53:54.000000Z",
"updated_at": "2023-11-20T17:52:26.000000Z"
}
}

Error Response

Code : 400 BAD REQUEST

Content :

{
"success": false,
"errors": "Invalid Request!",
"errorCode": 400,
"data": {
"errors": {
"updated_at": [
"Resource not found or has been updated."
]
}
}
}

cURL

curl --location --request PATCH 'https://api-gateway.develop.pharmacity.io/pmc-ecm-delivery-api/api/shipping-manage/provider/1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer XXXX' \
--data '{
"view_status": 0,
"updated_at" : "2023-04-13T09:53:54.000000Z"
}'