Activate Child Account
Activate a child account and confirm its link with the parent account
- cURL
- JavaScript
curl --location 'https://partner-apistg.ahamove.com/v3/accounts/childs/<child_id>/activate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"activation_code": "1234"
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const raw = JSON.stringify({
activation_code: '2114',
});
const requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch(
'https://partner-apistg.ahamove.com/v3/accounts/childs/<child_id>/activate',
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
HTTP Request
POST https://partner-apistg.ahamove.com/v3/accounts/childs/849xxxxxxxx/activate
Headers
Parameter | Value | Required | Description |
---|---|---|---|
Content-Type | application/json | Yes | |
Authorization | Bearer <token> | Yes | Token of the parent account |
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
child_id | String | Yes | Phone number of the child account |
activation_code | String | Yes | Activation code sent to the child account for verification |
Response
JSON response example:
{
"_id": "849xxxxxxxx",
"name": "Nguyễn Văn A",
"partner": "ahamove",
"parent_id": "84912345678",
...
}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
404 | NOT_FOUND | - Token not found - child_id not found |
401 | NOT_AUTHORIZED | - The parent account is not linked with a partner - The parent account is already a child account of another parent |
406 | INVALID_ACTIVATION_CODE | Invalid activation code |
409 | PARENT_ACCOUNT_EXISTED | The child account already has a parent account |
500 | INTERNAL_SERVER_ERROR | We had a problem with our server. Try again later |
503 | SERVICE_UNAVAILABLE | We're temporarily offline for maintenance. Please try again later |