Register Account
Create a new User account (not yet registered in the Ahamove system) associated with the Partner's API Key and return the User's token
- cURL
- JavaScript
curl --location 'https://partner-apistg.ahamove.com/v3/accounts' \
--header 'Content-Type: application/json' \
--data '{
"mobile": "849xxxxxxxx",
"api_key": "<API_KEY_STG>",
"name": "Nguyễn Văn A",
"address": "7/28A Thành Thái, Phường 14, Quận 10"
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
const raw = JSON.stringify({
mobile: '849xxxxxxxx',
api_key: '<API_KEY_STG>',
name: 'Nguyễn Văn A',
address: '7/28A Thành Thái, Phường 14, Quận 10',
});
const requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('https://partner-apistg.ahamove.com/v3/accounts', 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
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
api_key | String | Yes | The API_KEY received after Partner registered for integration |
mobile | String | Yes | Phone number used to register the account ID |
name | String | Yes | Name of the Partner's account |
address | String | Yes | Partner's address |
Response
JSON response example:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhaGEiLCJ0eXAiOiJ1c2VyIiwiY2lkIjoiODQ5MDI5MzMwMjUiLCJzdGF0dXMiOiJPTkxJTkUiLCJlb2MiOiJob2RkQGFoYW1vdmUuY29tIiwibm9jIjoiRG9hbiBEYWkgSG8iLCJjdHkiOiJTR04iLCJhY2NvdW50X3N0YXR1cyI6IkFDVElWQVRFRCIsImV4cCI6MTY5NTI3NjM2OCwicGFydG5lciI6Im9kb28iLCJ0eXBlIjoiYXBpIn0.celDzdkTiNuIjEf_8LDCJHTyK74BuceXB5IYhfHo08I",
"refresh_token": "0c42af2105249b126b80862e96b3b055"
}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
400 | INVALID_DATA | Invalid data or missing required fields |
404 | PARTNER_NOT_FOUND | API key not found, Partner not found |
406 | INVALID_PHONE_NUMBER | Invalid phone number |
409 | ACCOUNT_EXISTED | Account already exists |
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 |