This API provides an interface to update address linked to the customer account.
This API only accepts PUT
requests.
https://dev-api.aymakan.com.sa/v2/address/update
https://api.aymakan.net/v2/address/update
The following headers should be sent along with the request
Your account security code / Api Token
Below is the list of parameters which should be sent to this API to update a customer address.
{info} The request parameters should be sent in request body using JSON format.
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | Address ID |
title | string | Yes | title |
name | string | Yes | customer name |
string | Yes | customer email | |
city | string | Yes | customer city |
address | string | Yes | customer address |
postcode | string | Yes | customer postcode |
phone | string | Yes | customer phone number |
description | string | Yes | description detail |
neighbourhood | string | Yes | customer neighbourhood |
A sample PUT
request body is below:
{
"id": 1,
"title": "Aymkana",
"name": "test",
"email": "[email protected]",
"city": "Riyadh",
"address": "Saudi Arabia Makkah{Mecca} Jeddah Al Muntazahat شارع العام طريق الحرزات 03088",
"neighbourhood": "Al Wizarat",
"postcode": "75760",
"phone": "+966598998110",
"description": "Home address",
}
The following response will be returned upon success.
{
"success": true,
"data": {
"address": {
"id": 1,
"title": "Aymkana",
"name": "test",
"email": "[email protected]",
"city": "Riyadh",
"address": "Saudi Arabia Makkah{Mecca} Jeddah Al Muntazahat شارع العام طريق الحرزات 03088",
"postcode": "75760",
"neighbourhood": "Al Wizarat",
"phone": "+966598998110",
"country": "SA",
"description": "Home address",
"active": 1,
"created_at": "2019-02-07T08:53:21.000000Z",
"updated_at": "2021-08-29T08:27:50.000000Z"
}
}
}
In case the account does not have any address setup, the following error will be returned. To avoid an error like this , make sure all required data is entered correctly.
{
"error": true,
"message": "Validation Error.",
"errors": {
"id": [
"The id field is required."
],
"title": [
"The title field is required."
],
"name": [
"The name field is required."
],
"email": [
"The email field is required."
],
"city": [
"The city field is required."
],
"address": [
"The address field is required."
],
"neighbourhood": [
"The neighbourhood field is required."
],
"postcode": [
"The postcode field is required."
],
"phone": [
"The phone field is required."
],
"description": [
"The description field is required."
]
}
}
In case of invalid credentials 401 Unauthorized
, the following response will be returned.
{
"error": true,
"response": "Invalid Credentials"
}