# Rakmao Buyer Center Open API
## Preparing Connection
### Rakmao Environment
| Name | Endpoint |
| ---------- | --------------------------------- |
| Test | https://rakmao-api-test.builk.com |
| Production | https://api.rakmao.com |
### Rakmao Standard Object
> ทุกๆ Response จาก Rakmao Buyer Center จะประกอบด้วย สาม Parameter หลักดังนี้
| Parameter | Description | Schema |
| ----------- | ----------------- | ------ |
| data | ผลลัพท์ของการทำงานใน API ผลลัพท์ความเป็นไปได้ประกอบด้วย null, object, array, string ,number และ boolean | object |
| status | สถานะของการทำงานใน API ผลลัพท์ความเป็นไปได้ประกอบด้วย 2xx, 4xx และ 5xx | number |
| message | ข้อความอธิบายผลลัพท์ของการทำงานใน API โดยเป็นคู่บงชี้กับ parameter `status` หากเป็นหมวด 2XX จะตอบกลับเป็น `success` และ หมวดอื่นๆจะตอบเป็นคำอธิบายอย่างสั้น | string |
> หมายเหตุ ในกรณีที่ status บงชี้ในหมวดหมู่ 4XX ผู้ทำการร้องของสามารถจัดการปัญหาได้ด้วยตนเองตาม error case ที่ list ไว้ให้ (จะดำเนินการในภายหลัง) และ ในกรณีที่ status บงชี้ในหมวดหมู่ 5XX โปรดแจ้งให้ทางผู้พัฒนาให้ทราบโดยเร็วที่สุด
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": some object ..
}
```
### Rakmao MasterData (Enum)
#### PaymentMethodEnum
| Key | Value |
| ------ | ----- |
| Cash | 1 |
| Credit | 2 |
| Other | 3 |
#### RFQStatusEnum
| Key | Value |
| -------------- | ----- |
| Draft | 0 |
| Expire | 1 |
| Inprogress | 2 |
| Negotiate | 3 |
| Complete | 4 |
| CancelByBuyer | 5 |
| CancelBySeller | 6 |
| Award | 7 |
#### QuotationStatusEnum
| Key | Value |
| -------------- | ----- |
| InProgress | 1 |
| Expire | 2 |
| Negotiate | 3 |
| CancelBySeller | 4 |
| Win | 5 |
| Lose | 6 |
#### TaxTypeEnum
| Key | Value |
| ---------- | ----- |
| ExcludeVat | 1 |
| IncludeVat | 2 |
| NoVat | 3 |
#### DeliveryMethodType
| Key | Value |
| ---------- | ----- |
| Pickup | 1 |
| Delivery | 2 |
#### RfqInquiryType
| Key | Value |
| ------- | ----- |
| Item | 1 |
| Address | 2 |
| Remark | 3 |
#### CalculateType
| Key | Value |
| ---------- | ----- |
| Number | 1 |
| Percentage | 2 |
#### RFQProjectType
| RFQProjectTypeId | RFQProjectTypeName | Logo |
| ---------------- | ------------------ | --------------------------------------------- |
| 1 | PJM |  |
| 2 | Rakmao |  |
| 3 | Builk |  |
| 4 | MangoERP |  |
### Rakmao Authentication
> ทุกๆ Request ที่ทำการติดต่อกับ Rakmao Buyer Center ต้องแนบ Header ประกอบมาด้วยเสมอ ซึ่งประกอบไปด้วย
> Header Key : `Authorization` และ Header Value : `Bearer *access_token*`
> โดย *access_token* จะกล่าวถึงในหัวข้อ [Rakmao Request and Refersh Authorization](#Rakmao-Request-and-Refersh-Authorization)
Example : ` Authorization : Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 `
หรือผลลัพท์ Request ดังภาพ

### Rakmao Request Authorization
#### Rqeuest Path `/api/v1/Authentication/RequestAPIToken`
> การ Request Authorization หรือการ Login ในที่นี้จะไม่สามารถใช้ User/Password และวิธีทั่วไปในการใช้งานเว็บไซต์ www.rakmao.com ให้ทำตามวิธีดังต่อไปนี้
> 1. นำ authen_string ที่ได้รับจากการลงทะเบียน (หมายเหตุ แจ้งให้ผู้พัฒนาลงทะเบียนให้) แนบลงในส่วนของ body ของ request
> 2. ทำการร้องขอ Method POST ไปที่ `{baseUrl}/api/v1/Authentication/RequestAPIToken` (หมายเหตุ baseUrl ในที่นี้หมายถึง Endpoint ในส่วน [Rakmao Environment](#Rakmao-Environment))
>
> หมายเหตุ authen_string ได้จากการนำ user/password ไปประกอบในรูปแบบ json และทำการ encoding ด้วย method base64, Example `{"UserName":"your-username","Password":"your-password"}`
**Body Request**
| Parameter | Description | Schema |
| ------------------------- | -------------------------------------- | ------------------- |
| authenString (*required*) | authen string ที่ได้รับจากการลงทะเบียน | string (plain/text) |
**Data Response**
| Parameter | Description | Schema |
| ----------- | ----------------- | ------ |
| token | token สำหรับแนบ ใน Header | string |
| refreshToken | token สำหรับ ในการร้องขอสิทธิ์ใหม่อีกครั้งหลังจากหมดอายุ | string |
| expiration | วันที่และเวลาหมดอายุของ token ที่ร้องขอ | DateTime |
**Example Request**
```
"authString..."
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.****",
"refreshToken": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.****",
"expiration": 1613978508
}
}
```
### Rakmao Renew Authorization
#### Rqeuest Path `/api/v1/Authentication/RenewAPIToken`
> การ Renew Authorization คือการออก Token ใหม่โดยใช้สิทธ์ล่าสุดที่เคยได้รับ (หมายเหตุ ต้องเป็น refreshToken ล่าสุดเท่านั้น)
> 1. นำ refreshToken ที่ได้รับจากการ Rquest Authorization แนบลงในส่วนของ body ของ request
> 2. ทำการร้องขอ Method POST ไปที่ `{baseUrl}/api/v1/Authentication/RenewAPIToken` (หมายเหตุ baseUrl ในที่นี้หมายถึง Endpoint ในส่วน [Rakmao Environment](#Rakmao-Environment))
>
**Body Request**
| Parameter | Description | Schema |
| ------------------------- | -------------------------------------- | ------------------- |
| refreshToken (*required*) | refreshToken ที่ได้รับจากการ login ครั้งล่าสุด | string (plain/text) |
**Data Response**
| Parameter | Description | Schema |
| ----------- | ----------------- | ------ |
| token | token สำหรับแนบ ใน Header | string |
| refreshToken | token สำหรับ ในการร้องขอสิทธิ์ใหม่อีกครั้งหลังจากหมดอายุ | string |
| expiration | วันที่และเวลาหมดอายุของ token ที่ร้องขอ | DateTime |
**Example Request**
```
"refreshToken..."
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.****",
"refreshToken": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.****",
"expiration": 1613978508
}
}
```
### Rakmao Address
#### Rqeuest Path `GET /api/v1/Address/PostCode/{PostCode}`
#### Rqeuest Path `GET /api/v1/Address/Province`
#### Rqeuest Path `GET /api/v1/Address/Province/{Id}`
#### Rqeuest Path `GET /api/v1/Address/District`
#### Rqeuest Path `GET /api/v1/Address/District/{Id}`
#### Rqeuest Path `GET /api/v1/Address/District/Province/{Id}`
#### Rqeuest Path `GET /api/v1/Address/SubDistrict`
#### Rqeuest Path `GET /api/v1/Address/SubDistrict/{Id}`
#### Rqeuest Path `GET /api/v1/Address/SubDistrict/District/{Id}`
> ข้อมูลจะครบหรือไม่ครบทุกฟิลด์ขึ้นอยู่กับ API ที่ร้องขอ
**Data Response**
| Parameter | Description | Schema |
| --------------------- | ----------- | ------ |
| provinceId | | number |
| provinceName | | string |
| districtId | | number |
| districtName | | string |
| districtPostalCode | | string |
| subDistrictId | | number |
| subDistrictName | | string |
| subDistrictPostalCode | | string |
**Example Response**
```json
[
{
"provinceId": 111,
"provinceName": "กรุงเทพมหานคร",
"districtId": 7,
"districtName": "ดุสิต",
"districtPostalCode": "10300",
"subDistrictId": 32,
"subDistrictName": "ดุสิต",
"subDistrictPostalCode": "10300"
},
{
"provinceId": 111,
"provinceName": "กรุงเทพมหานคร",
"districtId": 7,
"districtName": "ดุสิต",
"districtPostalCode": "10300",
"subDistrictId": 36,
"subDistrictName": "ถนนนครไชยศรี",
"subDistrictPostalCode": "10300"
}
]
```
### Rakmao Category Product
#### Rqeuest Path `GET /api/v1/SmartSearch/GetMasterProductItem`
> รายการสินค้าที่มีในระบบ
**Data Response**
| Parameter | Description | Schema |
| --------------------- | ----------- | ------ |
| CategoryId | | number |
| CategoryCode | | string |
| OrderNumber | | number |
| CategoryName | | string |
| CategoryTranslateName | | string |
| CategoryIsActive | | boolean |
| SubCategories | | Array of Object |
**SubCategories Object**
| Parameter | Description | Schema |
| --------------------- | ----------- | ------ |
| CategoryId | | number |
| SubCatId | | number |
| SubCateCode | | string |
| SubCateName | | string |
| OrderNumber | | number |
| CategoryIsActive | | boolean |
| Products | | Array of Object |
**Products Object**
| Parameter | Description | Schema |
| --------------------- | ----------- | ------ |
| CategoryId | | number |
| SubCatId | | number |
| ProductId | | number |
| ProductCode | | string |
| ProductName | | string |
| OrderNumber | | number |
| ProductIsActive | | boolean |
**Example Response**
```json
{
"data": [
{
"categoryId": 96,
"categoryCode": "C0001",
"orderNumber": 1,
"categoryName": "โครงสร้าง-ปูนซีเมนต์",
"categoryTranslateName": "",
"categoryIsActive": true,
"subCategories": []
},
{
"categoryId": 97,
"categoryCode": "C0002",
"orderNumber": 2,
"categoryName": "โครงสร้าง-คอนกรีตผสมเสร็จ",
"categoryTranslateName": "-",
"categoryIsActive": true,
"subCategories": [
{
"categoryId": 97,
"subCatId": 87,
"subCateCode": "SC0005",
"subCateName": "คอนกรีตผสมเสร็จทั่วไป",
"orderNumber": 1,
"subCateIsActive": true,
"products": [
{
"categoryId": 97,
"subCatId": 87,
"productId": 471,
"productName": "คอนกรีตผสมเสร็จ กำลังอัด 180 KSC, กก./ตร.ซม. ลูกบาศก์ (Cube)",
"productCode": "P00176",
"orderNumber": 1,
"productIsActive": true,
"hasDiscount": true
}
]
}
]
}
],
"status": 200,
"message": "success"
}
```
## Appication Interface
### CompanyConnect
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/CompanyConnect`**
> ลงทะเบียนลูกค้าจาก Platform ของท่านเพื่อระบุข้อมูลเบื่องต้นใน Platform Rakmao Buyer Center และรับ Id สำหรับการติดต่อบน Platform เรา
> ในกรณี นิติบุคคล หรือ ตัวบริบทขององค์กรมีผู้ใช้งานมากกว่า 1 ท่าน ให้ลงทะเบียนในนาม นิติบุคคล และใช้ Id ที่ได้รับเป็นตัวแทนให้กับผู้ใช้งานในองค์กร
> ในกรณี บุคคลทั่วไป หรือ ตัวบริบทของการทำงานเพียงท่านเดียว สามารถลงทะเบียนโดยใช้ เลขประจำตัวประชาชน แทน เลขที่ผู้เสียภาษี (TaxId)
**Body Request**
| Parameter | Description | Schema |
| -------------- | ------------------------------------------------------ | ------- |
| TaxId | เลขที่ผู้เสียภาษี หรือ เลขประจำตัวประชาชน | string |
| CompanyName | ชื่อบริษัท หรือ ชื่อเรียกแทน | string |
| JuristicPerson | สถานะ นิติบุคคล true = นิติบุคคล / false = บุคคลทั่วไป | boolean |
| Address | รายละเอียดที่อยู่ย่อย | string |
| SubDistrictId | รหัสตำบล ของ rakmao | number |
| DistrictId | รหัสอำเภอ ของ rakmao | number |
| ProvinceId | รหัสจังหวัด ของ rakmao | number |
| PostalCode | รหัสไปรษณีย์ ของ rakmao | string |
**Example Request**
```json
{
"TaxId": "1234567891011",
"CompanyName": "builk",
"JuristicPerson": true,
"Address": "112/44",
"SubDistrictId": 127,
"DistrictId": 37,
"ProvinceId": 111,
"PostalCode": "10400",
}
```
**Body Request**
| Parameter | Description | Schema |
| --------- | ------------------------------------ | ------ |
| CompanyId | Id Company / Organization ของ Rakmao | Guid |
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"CompanyId":"1dcdaa45-f3db-4384-95d3-c06b95ba1873"
}
}
```
### CompanyConnect Update
**Request Path `PATCH /api/v1/ExternalInterface/BuyerCenter/CompanyConnect`**
> ปรับปรุงข้อมูล Company
> **Body Request**
| Parameter | Description | Schema |
| -------------- | ------------------------------------------------------ | ------- |
| CompanyId | Id Company / Organization ของ Rakmao | string |
| CompanyName | ชื่อบริษัท หรือ ชื่อเรียกแทน | string |
| JuristicPerson | สถานะ นิติบุคคล true = นิติบุคคล / false = บุคคลทั่วไป | boolean |
**Example Request**
```json
{
"CompanyId":"1dcdaa45-f3db-4384-95d3-c06b95ba1873",
"CompanyName": "builk",
"JuristicPerson": true
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### RegisterRFQ
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/RegisterRFQ`**
> ลงทะเบียนข้อมูล RFQ เพื่อเริ่มทำการจัดประกวดสินค้ากับ Rakmao Seller Center
**Body Request**
| Parameter | Description | Schema |
| -------------------------------------------------- | --------------------------------------------- | --------------- |
| CompanyRefId (*required*) | Id Company ของ Rakmao | guid |
| ProjectName (*required*) | ชื่อโครงการ | string |
| [PaymentMethod](#PaymentMethodEnum) (*required*) | รูปแบบการชำระเงิน | Number |
| PaymentCreditDay | Credit day เมื่อ รูปแบบการชำระเงินเป็น Credit | Number |
| [DeliveryMethod](#DeliveryMethodType) (*required*) | รูปแบบการจัดส่ง | Number |
| DeliveryDetail (*required*) | ที่อยู่ในการจัดส่ง | Object |
| DeliveryDate (*required*) | วันที่ต้องการให้จัดส่ง | String |
| DueDate (*required*) | วันสิ้นสุดการส่งประกวดราคา | DateTime |
| RfqCode (*required*) | รหัสอ้างอิงของเลขที่เอกสาร RFQ ในระบบคุณ | String |
| Remark | หมายเหตุของเอกสาร | String |
| IsPublicAuction(*required*) | ระบุบรูปแบบของการประกวดราคาสาธารณะ | boolean |
| ContactName | ชื่อผู้ติดต่อ | String |
| ContactEmail | อีเมลผู้ติดต่อ | String |
| ContactPhone | หมายเลขโทรศัพท์ | String |
| ContactLineId | ไลน์ไอดีผู้ติดต่อ | String |
| RFQItem (*required*) | รายการสินค้าที่ต้องการจัดซื้อ | Array of Object |
| PreferredVendorList | รายการผู้ขายที่เจาะจงจะทำการประกวดราคาด้วย | Array of Object |
**DeliveryDetail Object**
> ต้องใช้ข้อมูล Address จาก rakmao.com โดยสามารถดูข้อมูลที่เรียกใช้ได้ดังนี้ [Rakmao Address](#Rakmao-Address)
| Parameter | Description | Schema |
| ------------------------- | ----------- | ------ |
| Address | ที่อยู่ | String |
| SubDistric | Id ตำบล/แขวง | number |
| Distric | Id อำเภอ/เขต | number |
| Province | Id จังหวัด | number |
| PostCode | รหัสไปรษณีย์ | String |
**RFQItem Object**
| Parameter | Description | Schema |
| --------------------------- | -------------------------------------- | ------ |
| CategoriesName (*required*) | ชื่อของประเภทสินค้า | String |
| CategoriesId (*required*) | รหัสของประเภทสินค้า | number |
| ItemName(*required*) | ชื่อหรือ คำอธิบายสินค้า | String |
| ItemId (*required*) | Id ของทาง Platform ที่ทำการ Request มา | String |
| Quantity (*required*) | จำนวน | Number |
| Unit (*required*) | หน่วย | String |
| Line | เลขลำดับรายการ | Number |
**PreferredVendorList Object**
| Parameter | Description | Schema |
| --------------------------- | -------------------------------------- | ------ |
| VendorId (*required*) | รหัสของ vendor ที่ได้จากการระบบ rakmao | String |
| VendorName (*required*) | ชื่อของ vendor ที่ได้ระบุไว้ | String |
**Example Request**
```json
{
"CompanyRefId" : "",
"RfqCode" : "RFQ-20240220-00001",
"ProjectName" : "",
"PaymentMethod" : 0,
"PaymentCreditDay" : 7,
"DeliveryMethod" : "",
"DeliveryDetail" : {
"Address":"abc/114",
"SubDistric":36,
"Distric":7,
"Province":111,
"PostCode":"10300",
},
"DeliveryDate" : "2021-12-31",
"DueDate" : "2021-12-31",
"Remark" : "",
"IsPublicAuction" : false,
"ContactName" : "",
"ContactEmail" : "",
"ContactPhone" : "",
"ContactLineId" : "",
"PreferredVendorList" : [
{
"vendorId": "1-1",
"vendorName": "Test Vendor name จำกัด"
},
{
"vendorId": "1-2",
"vendorName": "บริษัทพร้อมรับทราบ จำกัด"
}
],
"RFQItem" : [
{
"CategoriesName":"",
"CategoriesId":123,
"ItemName":"",
"ItemId":"",
"Quantity":1,
"Unit":"",
"Line":1,
},
{
"CategoriesName":"",
"CategoriesId":123,
"ItemName":"",
"ItemId":"",
"Quantity":99,
"Unit":"",
"Line":2,
},
]
}
```
**Body Response**
| Parameter | Description | Schema |
| ---------- | ----------------------------------------------------------- | ------ |
| RFQRefId | Id RFQ ของ Rakmao ใช้สำหรับติดต่อใน Action อืนๆของเอกสารนี้ | Guid |
| RFQRefCode | รหัสเบื้องต้นที่ออกโดยระบบ Rakmao | String |
| ItemIdRef | Id ของ Item ที่ใช้สำหรับติดต่อกลับ Rakmao | Object |
| VendorIdRef | Id ของ Vendor ที่ใช้สำหรับติดต่อกลับ Rakmao ประจำ RFQ นี้ ที่ทำการ Perfered vendor มา (vendorId กลับ PreferredVendorId ไม่ใช่ข้อมูลชุดเดียวกัน )| Object |
**ItemIdRef Object**
| Parameter | Description | Schema |
| --------- | -------------------------------------- | ------ |
| ItemRefId | Id Item ของทาง Rakmao | guid |
| ItemId | Id ของทาง Platform ที่ทำการ Request มา | String |
| Line | เลขลำดับของทาง Platform ที่ทำการ Request มา | Number |
**VendorIdRef Object**
| Parameter | Description | Schema |
| --------- | -------------------------------------- | ------ |
| VendorRefId | Id Vendor ของทาง Rakmao | guid |
| VendorId | Id PreferredVendor ที่ส่งเข้ามา | String |
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"RFQRefId" : "73b9fd9d-6692-45bb-8390-0c43a0307e87",
"RFQRefCode" : "RFQ-211212-001",
"ItemIdRef" : [
{
"ItemRefId":"388dfc41-0583-4c0d-9de1-0969e68066ef",
"ItemId":"1",
},
{
"ItemRefId":"202755af-f977-4de2-9f82-94e36b474249",
"ItemId":"2",
}
]
}
}
```
### DeRegisterRFQ
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/DeRegisterRFQ`**
> ยกเลิกการลงทะเบียนและการประกวดราคาของ RFQ
**Body Request**
| Parameter | Description | Schema |
| --------------------------- | ----------------------- | ------ |
| RfqRefId (*required*) | Id Rfq ของ Rakmao | guid |
| Timestamp (*required*) | เวลาที่ทำการยกเลิก | Date |
| Reason | เหตุผลในการยกเลิกการขอราคา | string |
**Example Request**
```json
{
"RfqRefId" : "8907fb61-b976-43d5-99b7-1dd936a9d00c",
"Timestamp" : "2021-12-09 15:00:00",
"Reason" : "เปลี่ยนแปลงความต้องการ",
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### NegotiateRFQ
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/NegotiateRFQ`**
> ร้องขอการแก้ไขราคาใบเสนอราคาจาก SellerCenter
**Body Request**
| Parameter | Description | Schema |
| --------------------------- | ----------------------- | ------ |
| RfqRefId (*required*) | Id Rfq ของ Rakmao | guid |
| QuotationRefId (*required*) | Id Quotation ของ Rakmao | guid |
| RfqItemIds (*required*) | รายการ Id Item ของ Rakmao ที่เจาะจงขอแก้ไขราคา | Array of Guid |
| Note | คำอธิบายเพิ่มเติ่ม | string |
**ItemIdRef Object**
| Parameter | Description | Schema |
| --------- | --------------------- | ------ |
| ItemRefId | Id Item ของทาง Rakmao | guid |
**Example Request**
```json
{
"RfqRefId" : "8907fb61-b976-43d5-99b7-1dd936a9d00c",
"QuotationRefId" : "e2f23e2d-9d09-4e67-af2a-e69ae914c575",
"RfqItems" : ["0b1f669a-bbad-43bd-9cd2-c1ea4db08602","0b1f669a-bbad-43bd-9cd2-c1ea4db08602"]
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### SelectWinnerRFQ
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/SelectWinnerRFQ`**
> ดำเนินการเลือกผู้ชนะในใบ RFQ นี้
**Body Request**
| Parameter | Description | Schema |
| --------------------------- | ----------------------- | ------ |
| RfqRefId (*required*) | Id Rfq ของ Rakmao | guid |
| QuotationRefId | Id Quotation ของ Rakmao (ถ้าผู้ชนะไม่ใช่ผู้ค้าใน rakmao ให้ระบุเป็น null) | guid |
| Timestamp (*required*) | เวลาที่ทำการเลือกผู้ชนะ | Date |
| Reason | เหตุผลอธิบายเพิ่มเติมที่ แพ้/ชนะ | string |
**Example Request**
```json
{
"RfqRefId" : "8907fb61-b976-43d5-99b7-1dd936a9d00c",
"QuotationRefId" : "e2f23e2d-9d09-4e67-af2a-e69ae914c575",
"Timestamp" : "2021-12-09 15:00:00",
"Reason" : "ราคา",
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### (***DEPRECATED***) UploadPurchaseOrderDocument
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/UploadPurchaseOrderDocument`**
> แนบเอกสารสั่งซื้อไปยัง Seller Center
**Body Request**
| Parameter | Description | Schema |
| --------------------------- | ----------------------- | ------ |
| RfqRefId (*required*) | Id Rfq ของ Rakmao | guid |
| QuotationRefId (*required*) | Id Quotation ของ Rakmao | guid |
| DocumentUrl (*required*) | URL เอกสารที่แนบมาด้วย | string |
**Example Request**
```json
{
"RfqRefId" : "8907fb61-b976-43d5-99b7-1dd936a9d00c",
"QuotationRefId" : "e2f23e2d-9d09-4e67-af2a-e69ae914c575",
"DocumentUrl" : "https://www.example.domain/path/to/file/filename.extendtion?queryparam"
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### GetPreferredVendorByProvince
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/GetPreferredVendorByProvince`**
> เรียกแสดงรายชื่อร้านค้าที่มีในระบบ
**Body Request**
| Parameter | Description | Schema |
| --------------------------- | ----------------------- | ------ |
| Provinces | รายชื่อจังหวัดที่ต้องการค้นหา | Array of string |
| TextSearch | ข้อมูลที่ต้องการค้นหา (TaxId หรือ ร้านค้า ) | string |
| Page | เลขที่หน้าที่ต้องการเรียกข้อมูล | number |
**Body Response**
| Parameter | Description | Schema |
| ----------- | ----------------------------- | --------------- |
| Vendors | รายชื่อจังหวัดที่ต้องการค้นหา | Array of object |
| TotalVendor | จำนวนร้านค้าทั้งหมดจากผลลัพท์ | number |
| TotalPage | จำนวนหน้าทั้งหมดจากผลลัพท์ | number |
**Vendors Object**
| Parameter | Description | Schema |
| -------------- | ------------------------------------------ | --------------- |
| Provinces | รายชื่อจังหวัดที่ให้บริการ | Array of string |
| VendorId | รหัสร้านค้า (ใช้ในกรณี Prefervendor) | |
| VendorName | ชื่อร้านค้า | |
| VendorEmail | email ร้านค้า | |
| VendorType | ชนิดของร้านค้า (company/personal) | |
| TaxId | เลขประจำตัวผู้เสียภาษี (ในกรณีนิติบุุคคล) | |
| IdCardNumber | เลขบัตรประจำตัวประชาชน (ในกรณีบุคคลธรรมดา) | |
| SellerProvince | จังหวัดที่ร้านค้า(หลัก)ตั้งอย่ | |
**Example 1 Request**
```json
{
// empty body
}
```
**Example 1 Response**
```json
{
"data": {
"vendors": [
{
"vendorId": "1-98",
"vendorName": "Rakmao South",
"vendorEmail": "rakmao.south@gmail.com",
"vendorType": "company",
"taxId": "1111111111111",
"idCardNumber": "1111111111111",
"sellerProvince": "กระบี่",
"provinces": [
"นครศรีธรรมราช"
]
},
{
"vendorId": "1-1",
"vendorName": "ร้านค้าวัสดุก่อสร้าง 03",
"vendorEmail": "sname1@test.com",
"vendorType": "company",
"taxId": "0105541076586",
"idCardNumber": "0105541076586",
"sellerProvince": "กรุงเทพมหานคร",
"provinces": [
"กรุงเทพมหานคร"
]
},
],
"totalVendor": 66,
"totalPage": 7
},
"status": 200,
"message": "success"
}
```
**Example 2 Request**
```json
{
"Provinces" : ['กรุงเทพ'],
"Page" : 1
}
```
**Example 2 Response**
```json
{
"data": {
"vendors": [
{
"vendorId": "1-1",
"vendorName": "ร้านค้าวัสดุก่อสร้าง 03",
"vendorEmail": "sname1@test.com",
"vendorType": "company",
"taxId": "0105541076586",
"idCardNumber": "0105541076586",
"sellerProvince": "กรุงเทพมหานคร",
"provinces": [
"กรุงเทพมหานคร"
]
},
],
"totalVendor": 66,
"totalPage": 7
},
"status": 200,
"message": "success"
}
```
### RequestExtendDueDate
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/RequestExtendDueDate`**
> ใช้สำหรับขอขยายระยะเวลาเปิดรับใบเสนอราคาและวันที่จัดส่ง
**Body Request**
| Parameter | Description | Schema |
| ---------------------------- | --------------------------------- | ------ |
| RfqId (*required*) | Id Rfq ของ Rakmao | guid |
| NewDueDate (*required*) | วันที่ที่ต้องการขยายอายุใบข้อราคา | date |
| NewDeliveryDate (*required*) | วันที่ที่ต้องการขยายวันที่จัดส่ง | date |
**Example Request**
```json
{
"RfqRefId" : "8907fb61-b976-43d5-99b7-1dd936a9d00c",
"NewDueDate" : "2023-10-10 23:59:59",
"NewDeliveryDate" : "2023-10-30 15:00:00"
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
### UpdateInquiry
**Request Path `POST /api/v1/ExternalInterface/BuyerCenter/UpdateInquiry`**
> ใช้สำหรับแก้ไขข้อมูลตามที่ร้านค้าร้องข้อ
**Body Request**
| Parameter | Description | Schema |
| ---------------------------------------------------- | -------------------------------- | ------ |
| RfqId (*required*) | Id Rfq ของ Rakmao | guid |
| [InquiryRequestDetail](#RfqInquiryType) (*required*) | รายการชนิดของข้อมูลที่ทำการแก้ไข | Number |
| Address | ที่อยู่ที่แก้ไข | Object |
| ItemDetail | รายการสินค้าที่แก้ไข | Object |
| Remark | หมายเหตุ | String |
**Address Object**
| Parameter | Description | Schema |
| ------------- | --------------- | ------ |
| Address | ที่อยู่ที่แก้ไข | String |
| SubDistrictId | รหัสตำบล | Number |
| DistrictId | รหัสอำเภอ | Number |
| ProvinceId | รหัสจังหวัด | Number |
| PostCode | รหัสไปรษณีย์ | String |
**ItemDetail Object**
| Parameter | Description | Schema |
| ------------------- | ---------------------- | ------ |
| ItemId (*required*) | Id Rfq Item ของ Rakmao | guid |
| ItemDescription | คำอธิบายสินค้า | String |
**Example Request**
```json
{
"rfqId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"inquiryRequestDetail": [
1
],
"remark": "string",
"address": null,
"itemDetail": [
{
"itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"itemDescription": "new titanium 1 ton."
}
]
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
## Webhook
| WebhookName | Value | Description | Schema |
| ---------------- | ----- | ---------------------------------------------------------------------------------------- | ------------------------- |
| VendorInterested | 101 | จะมีการตอบกลับเมื่อมีผู้สนใจประกวดราคาในใบขอราคา | [LINK](#VendorInterested) |
| NewQuotations | 102 | จะมีการตอบกลับเมื่อผู้สนใจประกวดราคาส่งใบเสนอราคา | [LINK](#NewQuotations) |
| NewRevise | 103 | จะมีการตอบกลับเมื่อใบเสนอราคาอยู่สถานะ Negotiate และผู้สนใจประกวดราคาได้ทำการปรับปรุงราคาหรือข้อมูลใหม่ | [LINK](#NewRevise) |
| CancelQuotations | 104 | จะมีการตอบกลับเมื่อผู้สนใจประกวดราคา ยกเลิกการดำเนินการประกวดราคาต่อ | [LINK](#CancelQuotations) |
| NewInquiry | 105 | จะมีการตอบกลับเมื่อร้านค้าต้องการข้อมูลเพิ่มเติม | [LINK](#NewInquiry) |
| UpdateQuotation | 106 | จะมีการตอบกลับเมื่อได้ทำการแก้ไขใบเสนอราคา | [LINK](#UpdateQuotation) |
### List Webhook
**Rqeuest Path `GET /api/v1/Webhook/buyer`**
> List รายการ webhook ที่ลงทะเบียนและไม่ลงทะเบียน
**Body Response**
| Parameter | Description | Schema |
| --------- | --------------------------------------- | -------------- |
| WebhookType | ชื่อของ Webhook | string |
| WebhookEndpoint | Url Webhook ที่ลงทะเบียน | string |
| WebhookHeader | Header ที่แนบไปกับ Webhook ที่ลงทะเบียน | key/pair value |
**Example Request**
> GET https://rakmao-api-test.builk.com/api/v1/Webhook
>
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": [
{
"WebhookType" : "VendorInterested",
"WebhookEndpoint" : "https://api-name.domain/path-to-example-api/VendorInterested",
"WebhookHeader" : {
"Authorization": "beare **********"
}
},
{
"WebhookType" : "NewQuotations",
"WebhookEndpoint" : "https://api-name.domain/path-to-example-api/NewQuotations",
"WebhookHeader" : {
"Authorization": "beare **********"
}
},
{
"WebhookType" : "NewRevies",
"WebhookEndpoint" : null,
"WebhookHeader" : null
},
{
"WebhookType" : "CancelQuotations",
"WebhookEndpoint" : null,
"WebhookHeader" : null
}
]
}
```
### Get Webhook
**Rqeuest Path `GET /api/v1/Webhook/buyer/{enumValue}`**
> เรียกข้อมูล webhook แบบเจาะจง
**Body Response**
| Parameter | Description | Schema |
| --------- | --------------------------------------- | -------------- |
| WebhookType | ชื่อของ Webhook | string |
| WebhookEndpoint | Url Webhook ที่ลงทะเบียน | string |
| WebhookHeader | Header ที่แนบไปกับ Webhook ที่ลงทะเบียน | key/pair value |
**Example Request**
> GET https://rakmao-api-test.builk.com/api/v1/Webhook/1
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"WebhookType" : "VendorInterested",
"WebhookEndpoint" : "https://api-name.domain/path-to-example-api/VendorInterested",
"WebhookHeader" : {
"Authorization": "beare **********"
}
}
}
```
### Register Webhook
**Rqeuest Path `POST /api/v1/Webhook/buyer`**
> ผู้พัฒนาต้องลงทะเบียน Webhook ก่อนใช้งานระบบมิเช่นนั้นจะไม่ดำเนินการ Reqeust ใดๆทีข้ามา
> และในบางกรณีผู้พัฒนาอาจจะต้องทำการเพิ่ม Whitelist ตัว Rakmao endpoint ของ environment นั้นๆเพือให้ Webhook สามารถตอบกลับได้สำเร็จ (อาจเกิดขึ้นในกรณีมี security หรือ Firewall)
**Body Request**
| Parameter | Description | Schema |
| ------------------------------------ | ---------------------------------------------------------------------------------------------- | -------------- |
| [WebhookType](#Webhook) (*required*) | ชนิดของ webhook ที่ต้องการสมัคร | enum |
| WebhookEndpoint (*required*) | URL ปลายทางของ webhook ที่ต้องการสมัคร | string |
| WebhookHeader (*option*) | เป็นตัวเลือกเพิ่มเติมในกรณีทีต้องการแนบ Header ใดๆในขณะที่ Webhook ตอบกลับ (เช่น Authorization) | key/pair value |
**Body Response**
| Parameter | Description | Schema |
| --------- | ---------------------------- | ------ |
| Endpoint | Url ที่ Input เขามา | string |
| WebHook | ชื่อของ Webhook ที่ลงทะเบียน | string |
**Example Request**
```json
{
"WebhookType": 1,
"WebhookEndpoint": "https://api-name.domain/path-to-example-api",
"WebhookHeader": {
"Authorization": "beare **********",
"additionalProp1": "string",
"additionalProp2": "string",
...
"additionalPropN": "string"
}
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"WebHook" : "VendorInterested",
"Endpoint" : "https://api-name.domain/path-to-example-api"
}
}
```
### Update Webhook
**Rqeuest Path `PUT /api/v1/Webhook/buyer/{enumValue}`**
> อัพเดท value ทั้งหมดที่ request เข้ามา
**Body Request**
| Parameter | Description | Schema |
| ------------------------------------ | ---------------------------------------------------------------------------------------------- | -------------- |
| [WebhookType](#Webhook) (*required*) | ชนิดของ webhook ที่ต้องการสมัคร | enum |
| WebhookEndpoint (*required*) | URL ปลายทางของ webhook ที่ต้องการสมัคร | string |
| WebhookHeader (*option*) | เป็นตัวเลือกเพิ่มเติมในกรณีทีต้องการแนบ Header ใดๆในขณะที่ Webhook ตอบกลับ (เช่น Authorization) | key/pair value |
**Body Response**
| Parameter | Description | Schema |
| --------- | ---------------------------- | ------ |
| Endpoint | Url ที่ Input เขามา | string |
| WebHook | ชื่อของ Webhook ที่ลงทะเบียน | string |
**Example Request**
> PUT https://rakmao-api-test.builk.com/api/v1/Webhook/1
```json
{
"WebhookType": 1,
"WebhookEndpoint": "https://api-name.domain/path-to-example-api",
"WebhookHeader": {
"Authorization": "beare **********",
"additionalProp1": "string",
"additionalProp2": "string",
...
"additionalPropN": "string"
}
}
```
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": {
"WebHook" : "VendorInterested",
"Endpoint" : "https://api-name.domain/path-to-example-api"
}
}
```
### De-Register Webhook
**Rqeuest Path `DELETE /api/v1/Webhook/buyer/{enumValue}`**
> ลบการลงทะเบียน Webhook ออกจากระบบ
**Example Request**
> DELETE https://rakmao-api-test.builk.com/api/v1/Webhook/1
**Example Response**
```json
{
"status": 200,
"message": "Success",
"data": true
}
```
## Webhook Schema
### VendorInterested
| Parameter | Description | Schema |
| ------------------------ | ------------------------------------ | ------ |
| RFQRefId (*required*) | Id RFQ ของทาง Rakmao | Guid |
| VendorRefId (*required*) | Id Vendor ของทาง Rakmao | Guid |
| VendorName (required) | ชื่อของ vendor | String |
| ContactName | ชื่อของผู้ติดต่อ | String |
| ContactPhone | เบอร์ของผู้ติดต่อ | String |
| ContactEmail | อีเมลของผู้ติดต่อ | String |
| Address (*required*) | ที่อยู่ของ vendor ทั้งหมด | String |
| TaxId | เลขประจำตัวผู้เสียภาษี (นิติบุคล) | String |
| IdCardNumber | เลขประจำตัวผู้เสียภาษี (บุคคลธรรมดา) | String |
| SellerCenterRefId | Code ของ Seller ที่ใช้สำหรับการดำเนินการ Prefervendor ในภายหลัง | String |
| AddressNo (*required*) | เลขที่อยู่และรายละเอียด ของ vendor | String |
| SubDistrict (*required*) | ตำบล/แขวง ที่อยู่ของ vendor ทั้งหมด | String |
| District (*required*) | อำเภอ/เขต ที่อยู่ของ vendor ทั้งหมด | String |
| Province (*required*) | จังหวัดที่อยู่ของ vendor ทั้งหมด | String |
| Zipcode (*required*) | รหัสไปรษณีของ vendor ทั้งหมด | String |
**Example Request**
```json
{
"RFQRefId" : "491482c2-6d89-4511-9cd3-aed095853663",
"VendorRefId": "aed09585-6d89-4511-9cd3-491482c23663",
"VendorName": "Test Vendor",
"ContactName" : "MaD",
"ContactPhone": "0811111180",
"ContactEmail": "Mad@testVendor.org",
"TaxId" : "3422121212121",
"IdCardNumber" : "3434342121",
"Address":"เลขที่ 47 ม.4 เขตคันนายาว แขวงคันนายาว กรุงเทพมหานคร 10230 ",
"SellerCenterRefId" : "1-101",
"AddressNo":"เลขที่ 47 ม.4",
"SubDistrict":"เขตคันนายาว",
"District":"แขวงคันนายาว",
"Province":"กรุงเทพมหานคร",
"Zipcode":"10230 "
}
```
### NewQuotations
| Parameter | Description | Schema |
| ---------------------------------------------------- | ------------------------------- | -------- |
| RFQRefId (*required*) | Id RFQ ของทาง Rakmao | Guid |
| VendorRefId (*required*) | Id vendor ของทาง Rakmao | Guid |
| QuotationRefId (*required*) | Id quotations ของทาง Rakmao | Guid |
| [PaymentMethodType](#PaymentMethodEnum) (*required*) | รูปแบบการรับชำระ | Number |
| PaymentCreditDays | Credit days | Number |
| PaymentRemark | คำอธิบายเพิ่มเติมในกรณี PaymentMethodType เป็น Other | string |
| DueDate (*required*) | วันที่สิ้นสุดของราคาที่เสนอ | DateTime |
| TotalOfferItem (*required*) | จำนวนสินค้าที่ต้องการประกวดราคา | Number |
| SubTotal (*required*) | ราคารวมของสินค้า | Number |
| Discount (*required*) | ส่วนลด | Number |
| [DiscountType](#CalculateType) (*required*) | รูปแบบการคำนวณส่วนลด | Number |
| DiscountRate (*required*) | อัตราส่วนลดในรูปแบบ Percentage | Number |
| BeforeTax (*required*) | ราคาก่อนคำนวณภาษี | Number |
| [TaxType](#TaxTypeEnum) (*required*) | ชนิดการคำนวณภาษี | Integer |
| TaxRate (*required*) | อัตราการคำนวณภาษี | Number |
| TaxAmount (*required*) | อัตราภาษี | Number |
| [ShippingType](#DeliveryMethodType) (*required*) *** | ชนิดการจัดส่ง | Number |
| ShippingTaxRate (*required*) *** | อัตราการคำนวณภาษีจัดส่ง | Number |
| [ShippingTaxType](#TaxTypeEnum) (*required*) *** | ชนิดการคำนวณภาษี | Number |
| ShippingTaxAmount (*required*) *** | อัตราภาษี | Number |
| ShippingBeforeTax (*required*) | ราคาค่าขนส่งก่อนภาษี | Number |
| Shipping (*required*) *** | ราคาค่าขนส่งรวมภาษี | Number |
| GrandTotal (*required*) | ราคารวมสุทธิ | Number |
| GrandTotalWithShipping (*required*) | ราคาสุทธิรวมค่าขนส่งสุทธิ | Number |
| QuotationRemark (*required*) | หมายเหตุของใบเสนอราคา | String |
| QuotationItem (*required*) | รายการสินค้าที่ประกวดราคา | Object |
**QuotationItem Object**
| Parameter | Description | Schema |
| ---------------------- | --------------------- | ------ |
| ItemRefId (*required*) | Id Item ของทาง Rakmao | String |
| Quantity (*required*) | จำนวน Item ที่่เสนอ | Number |
| Price (*required*) | ราคา Item ทีเสนอ | Number |
| Total (*required*) | ราคารวม | Number |
| Note | | String |
**Example Request**
```json
{
"RFQRefId": "491482c2-6d89-4511-9cd3-aed095853663",
"VendorRefId": "491482c2-6d89-4511-9cd3-aed095853663",
"QuotationRefId": "491482c2-6d89-4511-9cd3-aed095853663",
"PaymentMethodType": 2,
"PaymentCreditDays": 7,
"DueDate": "2021-12-31",
"TotalOfferItem": 12,
"SubTotal": 2500,
"Discount": 0,
"DiscountType": 1,
"DiscountRate":0,
"BeforeTax": 2500,
"TaxType": 0,
"TaxRate" : 0,
"TaxAmount" : 0,
"ShippingType": 2,
"ShippingTaxRate" : 0,
"ShippingTaxType": 2,
"ShippingTaxAmount": 50,
"ShippingBeforeTax": 450,
"Shipping": 500,
"GrandTotal": 2550,
"GrandTotalWithShipping" : 3050,
"QuotationRemark": "-",
"QuotationItem": [
{
"ItemRefId":"491482c2-6d89-4511-9cd3-aed095853663",
"Quantity":99,
"Price": 2000,
"Total": 198000,
"Note": "test1"
},
{
"ItemRefId":"491482c2-6d89-4511-9cd3-aed095853663",
"Quantity":1,
"Price": 500,
"Total": 198000,
"Note": "test2"
}
]
}
```
### NewRevise
| Parameter | Description | Schema |
| -------------------------------------------------- | --------------------------- | -------- |
| QuotationsRefId (*required*) | Id Quotations ของทาง Rakmao | Guid |
| UpdateDateTime (*required*) | เวลาที่ทำการอัพเดท | DateTime |
| SubTotal (*required*) | ราคารวมของสินค้า | Number |
| Discount (*required*) | ส่วนลด | Number |
| BeforeTax (*required*) | ราคาก่อนคำนวณภาษี | Number |
| [TaxType](#TaxTypeEnum) (*required*) | ชนิดการคำนวณภาษี | Integer |
| TaxRate (*required*) | อัตราการคำนวณภาษี | Number |
| TaxAmount (*required*) | อัตราภาษี | Number |
| [ShippingType](#DeliveryMethodType) (*required*) *** | ชนิดการจัดส่ง | Number |
| ShippingTaxRate (*required*) *** | อัตราการคำนวณภาษีจัดส่ง | Number |
| [ShippingTaxType](#TaxTypeEnum) (*required*) *** | ชนิดการคำนวณภาษี | Number |
| ShippingTaxAmount (*required*) *** | อัตราภาษี | Number |
| ShippingBeforeTax (*required*) | ราคาค่าขนส่งก่อนภาษี | Number |
| Shipping (*required*) *** | ราคาค่าขนส่งรวมภาษี | Number |
| GrandTotal (*required*) | ราคารวมสุทธิ | Number |
| GrandTotalWithShipping (*required*) | ราคาสุทธิรวมค่าขนส่งสุทธิ | Number |
| QuotationItem (*required*) | รายการสินค้าที่อัพเดทราคา | Object |
| [DiscountType](#CalculateType) (*required*) | รูปแบบการคำนวณส่วนลด | Number |
| DiscountRate (*required*) | อัตราส่วนลดในรูปแบบ Percentage | Number |
**QuotationItem Object**
| Parameter | Description | Schema |
| ---------------------- | --------------------- | ------ |
| ItemRefId (*required*) | Id Item ของทาง Rakmao | String |
| Quantity (*required*) | จำนวน Item ที่่เสนอ | Number |
| Price (*required*) | ราคา Item ทีเสนอ | Number |
| Total (*required*) | ราคารวม | Number |
| Note | | String |
**Example Request**
```json
{
"QuotationRefId": "491482c2-6d89-4511-9cd3-aed095853663",
"UpdateDateTime": "2021-12-31",
"SubTotal": 2500,
"Discount": 0,
"BeforeTax": 2500,
"TaxType": 0,
"TaxRate" : 0,
"TaxAmount" : 0,
"ShippingType": 2,
"ShippingTaxRate" : 0,
"ShippingTaxType": 2,
"ShippingTaxAmount": 50,
"ShippingBeforeTax": 450,
"Shipping": 500,
"GrandTotal": 2550,
"GrandTotalWithShipping" : 3050,
"QuotationRemark": "-",
"QuotationItem": [
{
"ItemRefId":"491482c2-6d89-4511-9cd3-aed095853663",
"Quantity":99,
"Price": 2000,
"Total": 198000,
"Note": "test1"
},
{
"ItemRefId":"491482c2-6d89-4511-9cd3-aed095853663",
"Quantity":1,
"Price": 500,
"Total": 198000,
"Note": "test2"
}
]
}
```
### CancelQuotations
| Parameter | Description | Schema |
| ---------------------------- | --------------------------- | ------ |
| QuotationsRefId (*required*) | Id Quotations ของทาง Rakmao | Guid |
| Reason | เหตุผลในการยกเลิก | string |
| UpdateDateTime (*required*) | เวลาที่ทำการอัพเดท | DateTime |
### NewInquiry
| Parameter | Description | Schema |
| ---------------------------- | ---------------------------------- | ------------ |
| RfqRefId (*required*) | Id RFQ ของทาง Rakmao | Guid |
| InterestedRefId (*required*) | Id Vendor ในรูปแบบของ Perfervendor | String |
| VendorName (required) | ชื่อของ vendor | String |
| Inquiries | รายการข้อมูลที่สอบถาม | Array Object |
**Inquiries Object**
| Parameter | Description | Schema |
| ---------------------------- | ---------------------------------- | ------------ |
| [InquiryType](#RfqInquiryType) (*required*) | ชนิดของข้อมูลทีร้องขอ | String |
| Note (*required*) | รายละเอียดเพิ่มเติม | String |
**Example Request**
```json
{
"RfqRefId": "8b11b6c4-a393-4c7a-9d8d-77549280a842",
"InterestedRefId": "1-155582",
"VendorName": "Tes2",
"Inquiries": [
{
"InquiryType": "1",
"Note": " Test 1"
},
{
"InquiryType": "2",
"Note": " Test 2"
}
]
}
```
### UpdateQuotation
| Parameter | Description | Schema |
| ---------------------------------------------- | --------------------------- | -------- |
| QuotationRefId (*required*) | Id Quotations ของทาง Rakmao | Guid |
| UpdateDateTime (*required*) | เวลาที่ทำการอัพเดท | DateTime |
| SubTotal (*required*) | ราคารวมของสินค้า | Number |
| Discount (*required*) | ส่วนลด | Number |
| [DiscountType](#CalculateType) (*required*) | รูปแบบการคำนวณส่วนลด | Number |
| DiscountRate (*required*) | อัตราส่วนลดในรูปแบบ Percentage | Number |
| BeforeTax (*required*) | ราคาก่อนคำนวณภาษี | Number |
| [TaxType](#TaxTypeEnum) (*required*) | ชนิดการคำนวณภาษี | Integer |
| TaxRatePercentage (*required*) | อัตราการคำนวณภาษี | Number |
| TaxRate (*required*) | อัตราการคำนวณภาษี | Number |
| TaxAmount (*required*) | อัตราภาษี | Number |
| [ShippingType](#ShippingTypeEnum) (*required*) | ชนิดการจัดส่ง | Number |
| ShippingTaxRate (*required*) | อัตราการคำนวณภาษีจัดส่ง | Number |
| ShippingTaxType (*required*) | ชนิดการคำนวณภาษี | Number |
| ShippingTaxAmount (*required*) | | Number |
| ShippingBeforeTax (*required*) | | Number |
| GrandTotalShippingPrice (*required*) | ราคาค่าขนส่งรวมภาษี | Number |
| GrandTotal (*required*) | ราคารวมสุทธิ | Number |
| GrandTotalWithShipping (*required*) | ราคาสุทธิรวมค่าขนส่ง | Number |
| [PaymentMethodType](#PaymentMethodEnum) (*required*) | รูปแบบการรับชำระ | Number |
| PaymentCreditDays | Credit days | Number |
| PaymentRemark | | String |
| DueDate (*required*) | วันที่สิ้นสุดของราคาที่เสนอ | DateTime |
| Shipping (*required*) | ราคาค่าขนส่ง | Number |
| QuotationRemark | หมายเหตุของใบเสนอราคา | String |
| QuotationItem (*required*) | รายการสินค้าที่อัพเดทราคา | Array Object |
| AttachedFileList (*required*) | รายการไฟล์แนบ | Array Object |
**QuotationItem Object**
| Parameter | Description | Schema |
| ---------------------- | ----------- | ------ |
| ItemRefId (*required*) | | String |
| ItemQuotationRefId (*required*) | | String |
| Price (*required*) | | Number |
| Quantity (*required*) | | Number |
| Total (*required*) | | Number |
| Note | | String |
**AttachedFileList Object**
| Parameter | Description | Schema |
| ---------------------- | ----------- | ------ |
| AttachedFileName (*required*) | | String |
| AttachedFileLink (*required*) | | String |
**Body Response**
| Parameter | Description | Schema |
| --------- | -------------------- | ------- |
| Data | สถานะของการรับข้อมูล | boolean |
#### Example Request
```json
{
"QuotationRefId": "144982c2-9cd3-4511-6d89-aed095853663",
"UpdateDateTime": "2022-02-14T08:35:45.2918396Z",
"DueDate": "2022-04-16T00:00:00.000000Z",
"PaymentMethodType": 2,
"PaymentMethodDetail": 7,
"SubTotal": 3200,
"Discount": 0,
"DiscountType": 1,
"DiscountRate":0,
"BeforeTax": 3200,
"TaxType": 0,
"TaxRatePercentage" : 0,
"TaxAmount" : 0,
"ShippingType": 1,
"ShippingTaxRate" : 0,
"ShippingTaxType": 2,
"Shipping": 50,
"GrandTotalShippingPrice" : 1200,
"GrandTotal": 3200,
"GrandTotalWithShipping": 4400,
"QuotationRemark": "-",
"QuotationItem": [
{
"ItemRefId":"9cd36d89-82c2-3663-4914-45119585aed0",
"Price": 1980,
"Note":""
},
{
"ItemRefId":"491482c2-6d89-4511-9cd3-aed095853663",
"Price": 1220,
"Note":""
}
],
"AttachedFileList": [
{
"AttachedFileName" : "test.png",
"AttachedFileLink" : "url/to/file"
},
{
"AttachedFileName" : "test.png",
"AttachedFileLink" : "url/to/file"
}
]
}
```