Gofive OpenAPI
empeoVenioeTaxGo
empeoVenioeTaxGo
  1. Expense
  • Introduction
  • Activity
    • Activities Enquiry
      POST
    • Get a Activity By Id
      GET
    • Get a Activity By No
      GET
    • Get Key Activities
      GET
    • Create or Update Activity
      POST
  • Authentication API
    • Authorization
      POST
  • Customer
    • Create or Update customer
      POST
    • Get a Customer By CustomerCode
      GET
    • Customers Enquiry
      POST
    • Get a Customer By CustomerName
      GET
    • Create Customer Satisfaction
      POST
    • Add Customer Event
      POST
    • Get Customer Events by Customer Code
      GET
    • Edit Customer Event
      PUT
    • Delete Customer Event
      DELETE
    • Get Customer Event Types
      GET
    • Get file categories
      GET
  • Case
    • Add Case
      POST
    • Edit Case by CaseNo
      PUT
    • Get Case by CaseNo
      GET
    • Get Case Categories
      GET
  • Contract
    • Get Contract By No
    • Get Contract Types
    • Get Contract Templates
    • Create or Update Contract
    • Create or Update Contract Service Agreement
    • Send Contract Document
  • Deal
    • Create Deal
    • Update Deal
    • Deal Enquiry
    • Get Deal
    • Get Deal Board
    • Get Deal Stage
    • Get Deal Interest
    • Get DealLabel
    • Get Deal Missed Reason Categories
  • Employee
    • Employees Enquiry
    • Get a Employee
  • Expense
    • Create Expense
      POST
    • Update Expense
      PUT
    • Expense Enquiry
      POST
    • Get a Expense
      GET
  • Product
    • Create Or Update Products
    • Get a Product Ticket
    • Get Products With Take & Status
    • Get a Product by ProductCode
    • Get Product Groups
    • Get Product Properties
    • Get Products By Filter
    • Verify Serial Number
    • /v3/Products/serials/status
    • Create or Update Codeguard Products
    • Update Product Stock
    • /v1/products/units
    • /v1/products/units Copy
  • Quotation
    • Create Update Quotation
    • Convert Quotation To SalesOrder
    • Quotation Enquiry
    • Get a Quotation By QuotationNo
    • Cancel Quotation
  • SalesOrder
    • Create Or Update SalesOrder
    • Get a SalesOrders By Id
    • Get a SalesOrder By SalesOrderNo
    • Get Sale Order Attachment
    • Reject SaleOrder
    • Approve Sale Order
    • Update SalesOrder Payment
    • Update SalesOrder Tracking Number
  • Webhooks
    • Webhook Payload
  • Task
    • CreateTask
  • Setting
    • Get HeaderTemplate
  • Chat
    • Post Send message
  1. Expense

Create Expense

POST
https://api.gofive.co.th/v1/Expenses
เพิ่มข้อมูล expense

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Content-Type
string 
required
Example:
application/json
Ocp-Apim-Subscription-Key
string 
required
รหัส subscription-key ลูกค้า
Example:
<Your-Subscription-Key>
Body Params application/json
ExpenseDetails
array [object {16}] 
required
รายละเอียค่าใช้จ่าย
expenseDetailId
integer  | null 
optional
รหัสรายละเอียดค่าใช้จ่าย
expenseTypeId
integer 
required
รหัสประเภทexpenseเช่น:
0 = none
1001 = accomadation
1002 = entertainment
1003 = fuel
1004 = other
1005 = training
1006 = travelling
1007= meeting with staff
1008 = meeting with sales
amount
number 
required
จำนวน
night
integer  | null 
optional
จำนวนคืน
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท accomadation
milesStart
integer  | null 
optional
เลขไมล์เริ่มต้น
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท fuel และต้องน้อยกว่า milesend
milesEnd
integer  | null 
optional
เลขไมล์สุดท้าย
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท fuel และต้องมากว่า milesStart
trainingTitle
string  | null 
optional
หัวข้ออบรม
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท training
hours
integer  | null 
optional
จำนวนชั่วโมง
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท training
minutes
integer  | null 
optional
จำนวนนาที
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท training
taxi
number  | null 
optional
ค่า taxi
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท travelling
tollway
string  | null 
optional
ค่าทางด่วน
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท travelling
parking
string  | null 
optional
ค่าที่จอด
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท travelling
person
string  | null 
optional
จำนวนคน
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท entertainment หรือ meetingwithstaff หรือ training
note
string  | null 
optional
เพิ่มเติม
** จำเป็นใส่กรณี expenseTypeIdเป็นประเภท other
usedFuelCard
string 
required
ใช้บัตรเติมนำ้มันหรือไม่
true = ใช่
false = ไม่ใช่
expenseTypeName
string 
optional
ประเภทค่าใช้จ่ายแบบกำหนดเอง **กรณีเลือก expenseTypeId เป็นประเภท none
subject
string 
required
เรื่อง
activityId
string  | null 
optional
รหัสกิจกรรม
dateTransaction
string  | null 
optional
เวลาธุรกรรม
remark
string  | null 
optional
หมายเหตุ
staffCode
string 
optional
รหัสพนักงาน ที่ต้องการให้เป็นเจ้าของ
Example
{
    "expenseDetails": [
        {
            "expenseDetailId": 0,
            "expenseTypeId": 1001,
            "amount": 0,
            "night": 0,
            "milesStart": 0,
            "milesEnd": 0,
            "trainingTitle": "string",
            "hours": 0,
            "minutes": 0,
            "taxi": 0,
            "tollway": 0,
            "parking": 0,
            "person": 0,
            "note": "string",
            "usedFuelCard": true,
            "expenseTypeName":"string"
        }
    ],
    "subject": "string",
    "activityId": "string",
    "dateTransaction": "2021-09-17T08:47:23.771Z",
    "remark": "string",
    "staffCode":"string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.gofive.co.th/v1/Expenses' \
--header 'Ocp-Apim-Subscription-Key: <Your-Subscription-Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "expenseDetails": [
        {
            "expenseDetailId": 0,
            "expenseTypeId": 1001,
            "amount": 0,
            "night": 0,
            "milesStart": 0,
            "milesEnd": 0,
            "trainingTitle": "string",
            "hours": 0,
            "minutes": 0,
            "taxi": 0,
            "tollway": 0,
            "parking": 0,
            "person": 0,
            "note": "string",
            "usedFuelCard": true,
            "expenseTypeName":"string"
        }
    ],
    "subject": "string",
    "activityId": "string",
    "dateTransaction": "2021-09-17T08:47:23.771Z",
    "remark": "string",
    "staffCode":"string"
}'

Responses

🟢200OK
application/json
Body
statusCode
integer 
required

สถานะของ Business Code ถ้า
Success = 1000
Error 1 ตัว = 4001
Error มากกว่า 1 ตัว = 4002    
หรือเป็น Subcode ที่ต้องการจะแสดงเพื่อสื่อความหมายของ Error โดย subcode จะเป็นตัวเดียวกับ business error code หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล

httpStatusCode
integer 
required
สถานะ code ของ httpเช่น
200 Ok
201 Created
400 BadRequest
401 Unauthorized
404 Record not found
500 Internal Server Error
data
object 
required
value
object 
required
statusCode
integer 
required
สถานะ statusCode ของ httpเช่น
200 Ok
201 Created
400 BadRequest
401 Unauthorized
404 Record not found
500 Internal Server Error
Example
{
    "data": {
        "value": {
            "expenseId": 1,
            "teamId": 1,
            "expenseNo": "string",
            "statusId": 302,
            "dateTransaction": "2023-01-22T08:47:23+0700",
            "createdByUserId": "string",
            "dateCreated": "2023-01-22T12:54:25+0700",
            "remark": "string",
            "subject": "string",
            "totalBaht": 2,
            "activityExpenses": [],
            "expenseDetails": [
                {
                    "expenseDetailId": 1,
                    "expenseId": 1,
                    "expenseTypeId": 1,
                    "categoryId": 1,
                    "quantity": 1,
                    "amount1": 1
                }
            ],
            "expenseStates": [
                {
                    "expenseStatesId": 1,
                    "expenseId": 1,
                    "statusId": 302,
                    "createdByUserId": "string",
                    "dateCreated": "2023-01-22T12:54:25+0700",
                    "approveLevel": 1,
                    "seq": 1
                }
            ],
            "canApprove": false,
            "isEdit": true,
            "deletable": true,
            "total": 2,
            "attachments": [],
            "pictureUrl": "string",
            "activityLogs": [
                {
                    "activityLogId": 1,
                    "refId": 1,
                    "comment": "string",
                    "logType": 270002,
                    "status": 1020,
                    "dateCreated": "2023-01-22T12:54:25+0700",
                    "createdByUserId": "string",
                    "userInfo": {
                        "userId": "string",
                        "fullname": "string",
                        "dateCreated": "2018-11-05T10:13:59+0700",
                        "dateModified": "2023-01-20T11:38:34+0700",
                        "identityUserId": "string",
                        "pictureUrl": "string"
                    },
                    "activityId": {}
                }
            ]
        },
        "statusCode": 200
    },
    "statusCode": 1000,
    "httpStatusCode": 200
}
🟠401Unauthorized
🟠400Bad Request
🟠403Forbidden
Modified at 2023-08-07 09:41:23
Previous
Get a Employee
Next
Update Expense
Built with