Appearance
Supplier
Overview
The Supplier API enables the creation, retrieval, updating, and deletion of supplier records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.
Create
Endpoint: /api/message/supplier_companies/{ Company }
This API will create a new supplier company.
- Method: POST
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"sup_company":"<supplier-company>", //integer
"sup_name": "<supplier-name>", //string
"sup_tin": "<Supplier-TIN>", //string
"sup_reg_nric": "<supplierr-NRIC>", //string
"sup_reg_brn": "<supplier-register-number>", //string
"sup_reg_passport": "<supplier-passport-number>", //string
"sup_reg_army": "<supplier-army-identification>", //string
"sup_sst": true , //boolean
"sup_sst_reg": "<supplier-SST-registration>", //string
"sup_ttx": false, //boolean
"sup_ttx_no": "<supplier-tourism-tax-number>", //string
"sup_email": "<supplier-email-address>", //string
"sup_msic": "<supplier-MSIC-code>", //string
"sup_badsca": "<supplier-business-activity>", //string
"sup_adrs": "<supplier-address-code>", //string
"sup_cont_num": "<supplier-contact-number>", //string
"sup_sign": "<supplier-signature>", //string
"sup_bank_acc": "<supplier-bank-account-number>", //string
"con_buyer_code": "<consolidation-buyer-code>", //string
"classification": "<classification-mapping>", //string
"bus_2_cus": false, //boolean
"cus_id":"<customer-id>", //integer
"tin_vald": true, //boolean
"clas": false //boolean
}Fields Details:
| Field Name | Description | Data Type | Length |
|---|---|---|---|
| sup_company | Company | Integer | 4 |
| sup_name | Supplier | String | 300 |
| sup_tin | TIN | String | 14 |
| sup_reg_nric | NRIC | String | 12 |
| sup_reg_brn | Registration Number | String | 20 |
| sup_reg_passport | Passport Number | String | 12 |
| sup_reg_army | Army Identification | String | 12 |
| sup_sst | SST Applicable? | Boolean | 1 |
| sup_sst_reg | SST Registration | String | 17 |
| sup_ttx | Tourism Applicable? | Boolean | 1 |
| sup_ttx_no | Tourism Tax Number | String | 17 |
| sup_email | E-mail Address | String | 320 |
| sup_msic | MSIC Code | String | 5 |
| sup_badsca | Business Activity | String | 300 |
| sup_adrs | Address Code | String | 9 |
| sup_cont_num | Contact Number | String | 15 |
| sup_sign | Digital Signature | String | 1 |
| sup_bank_acc | Bank Account Number | string | 150 |
| con_buyer_code | Consolidation Buyer Code | String | 9 |
| classification | Classification Mapping | String | 3 |
| bus_2_cus | B2C | Boolean | 1 |
| cus_id | Customer ID | Integer | 10 |
| tin_vald | TIN | Boolean | 1 |
| clas | Classification Done | Boolean | 1 |
Response Body: (Status: 200)
json
{
"bus_2_cus": false,
"clas": true,
"classification": "<classification-mapping>",
"con_buyer_code": "<consolidation-buyer-code>",
"created_timestamp": "<created-timestamp>",
"created_user": "<created-user>",
"cus_id": "<customer-id>",
"sup_adrs": "<supplier-address-code>",
"sup_badsca": "<supplier-business-activity>",
"sup_bank_acc": "<supplier-bank-account-number>",
"sup_company": "<supplier-company>",
"sup_cont_num": "<supplier-contact-number>",
"sup_email": "<supplier-email-address>",
"sup_msic": "<supplier-MSIC-code>",
"sup_name": "<supplier-name>",
"sup_reg_army": "<supplier-army-identification>",
"sup_reg_brn": "<supplier-register-number>",
"sup_reg_nric": "<supplierr-NRIC>",
"sup_reg_passport": "<supplier-passport-number>",
"sup_sign": "<supplier-signature>",
"sup_sst": false,
"sup_sst_reg": "<supplier-SST-registration>",
"sup_tin": "<Supplier-TIN>",
"sup_ttx": false,
"sup_ttx_no": "<supplier-tourism-tax-number>",
"supplier_companies_id": "<supplier-companies-id>",
"tin_vald": true,
"updated_timestamp": null,
"updated_user": null
}Fields Details:
| Field Name | Description | Data Type | Example |
|---|---|---|---|
| bus_2_cus | B2C | Boolean | false |
| clas | Classification Done | Boolean | true |
| classification | Classification Mapping | String | 10 |
| con_buyer_code | Consolidation Buyer Code | String | dfd332 |
| created_timestamp | Created Timestamp | String | 2024-04-23T12:14:43.642361Z |
| created_user | Created User | String | ninja |
| cus_id | Customer ID | Integer | 19 |
| sup_adrs | Address Code | String | AAPR01 |
| sup_badsca | Business Activity | String | Growing of leguminous crops |
| sup_bank_acc | Bank Account Number | string | 11776543 |
| sup_company | Company | Integer | 456 |
| sup_cont_num | Contact Number | String | 66789324 |
| sup_email | E-mail Address | String | guhelectronic@guh.com.my |
| sup_msic | MSIC Code | String | 008645 |
| sup_name | Supplier | String | Sales Industry |
| sup_reg_army | Army Identification | String | 786533 |
| sup_reg_brn | Registration Number | String | 98745678 |
| sup_reg_nric | NRIC | String | 87234 |
| sup_reg_passport | Passport Number | String | 3895476 |
| sup_sign | Digital Signature | String | d |
| sup_sst | SST Applicable? | Boolean | true |
| sup_sst_reg | SST Registration | String | 893456 |
| sup_tin | TIN | String | 78345634 |
| sup_ttx | Tourism Applicable? | Boolean | flase |
| sup_ttx_no | Tourism Tax Number | String | 345234 |
| supplier_companies_id | Supplier Companies ID | String | 345234 |
| tin_vald | TIN | Boolean | true |
| updated_timestamp | Updated Timestamp | String | null |
| updated_user | Updated User | String | null |
Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When supplier company is already present in the database:
json
{
"message": "Record already exists!"
}Response Body: (Status: 400 - Bad Request)
When there is an invalid data type is passed:
json
{
"message": "Invalid Data Type"
}Response Body: (Status: 500 - Internal Server Error)
When the supplier company field is passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'sup_company'"
}Update
Endpoint: /api/message/supplier_companies/{ Company }
This API will update a supplier company.
- Method: PUT
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"sup_company":"<supplier-company>", //integer
"sup_name": "<supplier-name>", //string
"sup_tin": "<Supplier-TIN>", //string
"sup_reg_nric": "<supplierr-NRIC>", //string
"sup_reg_brn": "<supplier-register-number>", //string
"sup_reg_passport": "<supplier-passport-number>", //string
"sup_reg_army": "<supplier-army-identification>", //string
"sup_sst": true , //boolean
"sup_sst_reg": "<supplier-SST-registration>", //string
"sup_ttx": false, //boolean
"sup_ttx_no": "<supplier-tourism-tax-number>", //string
"sup_email": "<supplier-email-address>", //string
"sup_msic": "<supplier-MSIC-code>", //string
"sup_badsca": "<supplier-business-activity>", //string
"sup_adrs": "<supplier-address-code>", //string
"sup_cont_num": "<supplier-contact-number>", //string
"sup_sign": "<supplier-signature>", //string
"sup_bank_acc": "<supplier-bank-account-number>", //string
"con_buyer_code": "<consolidation-buyer-code>", //string
"classification": "<classification-mapping>", //string
"bus_2_cus": false, //boolean
"cus_id":"<customer-id>", //integer
"tin_vald": true, //boolean
"clas": false //boolean
}Response Body: (Status: 200)
json
{
"bus_2_cus": false,
"clas": true,
"classification": "<classification-mapping>",
"con_buyer_code": "<consolidation-buyer-code>",
"created_timestamp": "<created-timestamp>",
"created_user": "<created-user>",
"cus_id": "<customer-id>",
"sup_adrs": "<supplier-address-code>",
"sup_badsca": "<supplier-business-activity>",
"sup_bank_acc": "<supplier-bank-account-number>",
"sup_company": "<supplier-company>",
"sup_cont_num": "<supplier-contact-number>",
"sup_email": "<supplier-email-address>",
"sup_msic": "<supplier-MSIC-code>",
"sup_name": "<supplier-name>",
"sup_reg_army": "<supplier-army-identification>",
"sup_reg_brn": "<supplier-register-number>",
"sup_reg_nric": "<supplierr-NRIC>",
"sup_reg_passport": "<supplier-passport-number>",
"sup_sign": "<supplier-signature>",
"sup_sst": false,
"sup_sst_reg": "<supplier-SST-registration>",
"sup_tin": "<Supplier-TIN>",
"sup_ttx": false,
"sup_ttx_no": "<supplier-tourism-tax-number>",
"supplier_companies_id": "<supplier-companies-id>",
"tin_vald": true,
"updated_timestamp": "<updated-timestamp>",
"updated_user": "<updated-user>"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When there is an invalid data type is passed:
json
{
"message": "Invalid Data Type"
}Response Body: (Status: 400 - Bad Request)
When you are trying to update the supplier company number:
json
{
"message": "Record not found!"
}Response Body: (Status: 500 - Internal Server Error)
When the supplier company field is passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'sup_company'"
}Delete
Endpoint: /api/message/supplier_companies/{ Company }/{ record_id }
This API will delete a supplier company.
- Method: DELETE
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"Message": "Message Deleted Sucessfully!"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 500 - Internal Server Error)
When invalid or wrong supplier companies id is paased:
json
{
"Message": "Unable to Delete Record - Invalid Data Type"
}Get
Endpoint: /api/message/supplier_companies/{ Company }/{ record_id }
This API will get a supplier company.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"bus_2_cus": false,
"clas": true,
"classification": "<classification-mapping>",
"con_buyer_code": "<consolidation-buyer-code>",
"created_timestamp": "<created-timestamp>",
"created_user": "<created-user>",
"cus_id": "<customer-id>",
"sup_adrs": "<supplier-address-code>",
"sup_badsca": "<supplier-business-activity>",
"sup_bank_acc": "<supplier-bank-account-number>",
"sup_company": "<supplier-company>",
"sup_cont_num": "<supplier-contact-number>",
"sup_email": "<supplier-email-address>",
"sup_msic": "<supplier-MSIC-code>",
"sup_name": "<supplier-name>",
"sup_reg_army": "<supplier-army-identification>",
"sup_reg_brn": "<supplier-register-number>",
"sup_reg_nric": "<supplierr-NRIC>",
"sup_reg_passport": "<supplier-passport-number>",
"sup_sign": "<supplier-signature>",
"sup_sst": false,
"sup_sst_reg": "<supplier-SST-registration>",
"sup_tin": "<Supplier-TIN>",
"sup_ttx": false,
"sup_ttx_no": "<supplier-tourism-tax-number>",
"supplier_companies_id": "<supplier-companies-id>",
"tin_vald": true,
"updated_timestamp": "<updated-timestamp>",
"updated_user": "<updated-user>"
}Response Body: (Status: 200)
When invalid or wrong supplier companies id is paased:
json
{
"message": "null"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Get All
Endpoint: /api/messages/supplier_companies/{ Company }/{ PageSize }/{ PageNumber }
This API will get all supplier companies.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
[
{
"bus_2_cus": false,
"clas": true,
"classification": "<classification-mapping>",
"con_buyer_code": "<consolidation-buyer-code>",
"created_timestamp": "<created-timestamp>",
"created_user": "<created-user>",
"cus_id": "<customer-id>",
"sup_adrs": "<supplier-address-code>",
"sup_badsca": "<supplier-business-activity>",
"sup_bank_acc": "<supplier-bank-account-number>",
"sup_company": "<supplier-company>",
"sup_cont_num": "<supplier-contact-number>",
"sup_email": "<supplier-email-address>",
"sup_msic": "<supplier-MSIC-code>",
"sup_name": "<supplier-name>",
"sup_reg_army": "<supplier-army-identification>",
"sup_reg_brn": "<supplier-register-number>",
"sup_reg_nric": "<supplierr-NRIC>",
"sup_reg_passport": "<supplier-passport-number>",
"sup_sign": "<supplier-signature>",
"sup_sst": false,
"sup_sst_reg": "<supplier-SST-registration>",
"sup_tin": "<Supplier-TIN>",
"sup_ttx": false,
"sup_ttx_no": "<supplier-tourism-tax-number>",
"supplier_companies_id": "<supplier-companies-id>",
"tin_vald": true,
"updated_timestamp": "<updated-timestamp>",
"updated_user": "<updated-user>"
},
.
.
.
]
### Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
```json
{
"message": "Unauthorized!"
}