Authentication
In order to interact with the Order Management System (OMS) API, you need to authenticate using an access token. This token ensures that your requests are authorized and secure. To obtain the token, you must send a request with your credentials, including your username, password, and company ID. Once the token is obtained, it must be included in the authorization header of your subsequent API requests to access the OMS functionalities.
API Endpoint
URL |
https://omscoreapi.betterland.co.th/Token |
Method |
POST |
Content-Type |
application/x-www-form-urlencoded |
Request Parameters
Parameter |
Type |
Required |
Description |
grant_type |
string |
true |
Set to "password" for password authentication |
username |
string |
true |
Your username |
password |
string |
true |
Your password |
companyid |
string |
true |
Your company ID |
Request JSON Example
{
"grant_type": "password",
"username": "your_username",
"password": "your_password",
"companyid": "your_company_id"
}
Response Parameters
Parameter |
Type |
Description |
access_token |
string |
Access token for authenticating subsequent API requests |
token_type |
string |
Type of token (bearer) |
expires_in |
integer |
Expiration time of the token in seconds |
.issued |
string |
Timestamp when the token was issued |
.expires |
string |
Timestamp when the token will expire |
Response JSON Example
{
"access_token": "0M0NXj3Of44xBWBijLNcz_gbsSUEqNXnHHugxyqIpuwbpF7Qh45AwfX8gNzL9Srg...",
"token_type": "bearer",
"expires_in": 2591999,
".issued": "Tue, 14 Jan 2025 03:28:05 GMT",
".expires": "Thu, 13 Feb 2025 03:28:05 GMT"
}