Add Child Account
- Add a child account to a parent account. The parent account is already linked with a partner
- After calling the API to add a child account, an SMS will be sent to the child account to verify the account link
- cURL
- JavaScript
curl --location 'https://partner-apistg.ahamove.com/v3/accounts/childs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"child_id": "849xxxxxxxx"
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const raw = JSON.stringify({
child_id: '849xxxxxxxx',
});
const requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('https://partner-apistg.ahamove.com/v3/accounts/childs', 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
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 |
Response
JSON response example:
{}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
401 | NOT_AUTHORIZED | - The parent account is not linked with a partner - The parent account is already a child account of another parent |
404 | NOT_FOUND | Account not found |
406 | ACCOUNT_NOT_SAME_PARTNER | The child account is not associated with the same partner as the parent account |
406 | INVALID_PHONE_NUMBER | Invalid phone number |
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 |