Remove Child Account
Remove a child account from the parent account, which is already linked with a partner Conditions for successfully removing a child account:
- The child account does not have any ongoing orders.
- The child account must settle any outstanding balance (if applicable)
- cURL
- JavaScript
curl --location --request DELETE 'https://partner-apistg.ahamove.com/v3/accounts/childs/<child_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow',
};
fetch(
'https://partner-apistg.ahamove.com/v3/accounts/childs/<child_id>',
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
HTTP Request
DELETE https://partner-apistg.ahamove.com/v3/accounts/childs/849xxxxxxxx
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": "success"
}
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 |
402 | NOT_ALLOWED | - Child account has ongoing orders - Child account has unsettled balance |
404 | NOT_FOUND | - Token not found - child_id not found |
406 | INVALID_PHONE_NUMBER | Invalid phone number |
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 |