Country
Update Country
Update a specific country by its ID.
Authorization
default AuthorizationBearer <token>
You can retrieve your token by logging in.
In: header
Path Parameters
countryId*integer
Header Parameters
X-API-Version*string
API contract version to target. See the Changelog for what changed in each version.
Default
"2.0.0"Value in
"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"Request Body
application/json
flag?|
Country flag emoji. Must not be greater than 8 characters.
name?|
Country name.
currency?|
Country currency code. Must not be greater than 16 characters.
phone_prefix?|
Phone number prefix.
phone_start?|
Phone number start digits.
phone_max?|
Maximum phone number digits.
is_active?|
Active status of the country.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:8000/api/v2/countries/1" \ -H "X-API-Version: 2.3.0" \ -H "Content-Type: application/json" \ -d '{}'{
"meta": {
"code": 200,
"status": "success",
"message": "Update Success"
},
"data": {
"id": 1,
"flag": "πΈπ¦",
"name": "Saudi Arabia",
"currency": "SAR",
"phone_prefix": "966",
"phone_start": "6",
"phone_max": 15,
"deleted_at": null,
"is_active": true,
"code": "MA"
}
}{
"meta": {
"code": 401,
"status": "error",
"message": "Unauthenticated."
},
"data": null
}{
"meta": {
"code": 403,
"status": "error",
"message": "Unauthorized."
},
"data": null
}{
"meta": {
"code": 404,
"status": "error",
"message": "Resource not found."
},
"data": null
}{
"meta": {
"code": 422,
"status": "error",
"message": "The flag must not be greater than 8 characters. (and 3 more errors)"
},
"data": [
{
"code": 0,
"message": "The flag must not be greater than 8 characters.",
"field": "flag"
},
{
"code": 0,
"message": "The currency must not be greater than 16 characters.",
"field": "currency"
},
{
"code": 0,
"message": "The phone prefix must be a number.",
"field": "phone_prefix"
},
{
"code": 0,
"message": "The phone prefix field must not have more than 3 digits.",
"field": "phone_prefix"
}
]
}{
"meta": {
"code": 500,
"status": "error",
"message": "Internal server error."
},
"data": null
}