Thêm tài khoản con
- Thêm tài khoản con vào tài khoản cha, tài khoản cha đã được gắn partner.
- Sau khi gọi API Thêm tài khoản con, một tin nhắn SMS sẽ được gửi đến tài khoản con để xác thực liên kết tài khoản
- 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 | Giá trị | Yêu cầu | Mô tả |
---|---|---|---|
Content-Type | application/json | Có | |
Authorization | Bearer <token> | Có | Token của tài khoản cha |
Query Parameters
Parameter | Type | Yêu cầu | Mô tả |
---|---|---|---|
child_id | String | Có | Số điện thoại của tài khoản con |
Response
JSON response example:
{}
Status-Code: 200 OK
Các lỗi thường gặp
Mã lỗi | Nội dung | Mô tả |
---|---|---|
401 | NOT_AUTHORIZED | - Tài khoản cha chưa được gắn partner - Tài khoản cha đang là tài khoản con thuộc một tài khoản cha khác |
404 | NOT_FOUND | Tài khoản không tồn tại |
406 | ACCOUNT_NOT_SAME_PARTNER | Tài khoản con không cùng partner với Tài khoản cha |
406 | INVALID_PHONE_NUMBER | Số điện thoại không hợp lệ |
409 | PARENT_ACCOUNT_EXISTED | Tài khoản con đã tồn tại tài khoản cha |
500 | INTERNAL_SERVER_ERROR | Hệ thống của chúng tôi có lỗi xảy ra. Xin thử lại sau |
503 | SERVICE_UNAVAILABLE | Chúng tôi tạm thời đang không hoạt động để bảo trì. Xin vui lòng thử lại sau |