Picture

Create Expense

Picture

Request Header

Name
Type
Required
Description
Authorization
String
Required
OAuth token obtained after the user has provided consent and the authorized partner calls the /authorization/Connect/Token endpoint to retrieve this token
Content-Type
String
Required
Content type of request payload
Value:
- application/json
Ocp-Apim-Subscription-Key
String
Required

Request Body

Name
Type
Required
Description
expenseDetails
List<ExpenseDetailModel>
Required
รายการรายละเอียดค่าใช้จ่าย
expenseDetailId
Long
Optional
รหัสรายละเอียดค่าใช้จ่าย
expenseTypeId
ExpenseTypes
Required
รหัสประเภทค่าใช้จ่าย Accommodation = 1001,Enterainment = 1002,
Fuel = 1003,Other = 1004,Training = 1005,Travelling = 1006,
MeetingWithStaff = 1007,MeetingWithSales = 1008,
amount
Decimal
Optional
ราคา For Accommodation & Fuel & MeetingWithStaff & Training & MeetingWithSales & Enterainment & Other
night
Integer
Optional
จำนวนคืน For Accommodation
milesStart
Integer
Optional
เลขไมล์เริ่มต้น For Fuel
milesEnd
Integer
Optional
เลขไมล์สุดท้าย For Fuel
trainingTitle
String
Optional
หัวข้ออบรบ For Training
hours
Integer
Optional
จำนวนชั่วโมง For Training
minutes
Integer
Optional
จำนวนนาที For Training
taxi
Decimal
Optional
ค่า Taxi For Travelling
tollway
Decimal
Optional
ค่าทางด่วน For Travelling
parking
Decimal
Optional
ค่าที่จอด For Travelling
person
Integer
Optional
จำนวนคน For Training & MeetingWithStaff & Enterainment
note
String
Optional
เพิ่มเติม For Other
usedFuelCard
Boolean
Optional
ใช้บัตรเติมน้ำมันหรือไม่ For Fuel
subject
String
Required
เรื่อง
activityId
String
Optional
รหัสกิจกรรม
dateTransaction
DateTime
Optional
เวลาธุรกรรม
attachments
List<Attachment>
Optional
รายการเอกสารแนบ

Example Request

curl --location --request POST 'https: //api.veniocrm.com/dev/v1/Expenses' \

--header 'Ocp-Apim-Subscription-Key: <Your Subscription-Key>' \

--header 'Authorization: Bearer <Your access_token>' \

--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

      }

    ],

    "subject": "string",

    "activityId": "string",

    "dateTransaction": "2021-09-17T08:47:23.771Z",

    "remark": "string",

    "attachments": [

      {

        "attachmentId": 0,

        "refId": 0,

        "type": 0,

        "filename": "string",

        "extension": "string",

        "fileSize": 0,

        "isActive": true,

        "createdByUserId": "string",

        "dateCreated": "2021-09-17T08:47:23.771Z",

        "resourceUrl": "string",

        "companyId": 0,

        "isProcessed": true,

        "url": "string",

        "urlResponseUpload": "string",

        "thumbnail": "string"

      }

    ]

  }'

Download postman Collection

Response

Name
Type
Description
expenseId
Long
รหัสค่าใช้จ่าย
teamId
Integer
รหัสทีม
activityId
Long
รหัสกิจกรรม
expenseNo
String
หมายเลขค่าใช้จ่าย
statusId
Integer
รหัสสถานะ
dateTransaction
DateTime
วันที่ทำรายการ
createdByUserId
String
รหัสผู้สร้าง
dateCreated
DateTime
วันที่สร้าง
updatedByUserId
String
รหัสผู้ Update
dateUpdated
DateTime
วันที่แก้ไข
waitingApproveByUserId
String
waitingApproveByRoleId
String
waitingApproveByRankNo
Integer
approvedByUserId
String
อนุมัติโดยผู้ใช้หัส
dateApproved
DateTime
เวลาที่อนุมัติ
modifiedByUserId
String
แก้ไขโดยผู้ใช้รหัส
remark
String
subject
String
หัวข้อ
canApprove
Boolean
สามารถอนุมัติได้หรือไม่
isEdit
Boolean
แก้ไข
deletable
Boolean
ลบได้หรือไม่
total
Decimal
ราคารวมทั้งหมด
statusName
String
ชื่อสถานะ
reason
String
เหตุผล
attachments
List<Attachment>
รายการเอกสารแนบ
dateCheckout
DateTme
เวลาออก
totalDistance
Double
รวมระยะทาง
customerName
String
ชื่อลูกค้า
dateCheckin
DateTime
เวลาเข้า
note
String
รายละเอียดเพิ่มเติม
pictureUrl
String
Url รูปภาพ
activityIds
List<long>
รายการรหัสกิจกรรม

Example Response

{

    "data": {

        "value": {

            "expenseId": 0,

            "teamId": 0,

            "activityId": 0,

            "expenseNo": "string",

            "statusId": 0,

            "dateTransaction": "2021-09-17T10:04:52.509Z",

            "createdByUserId": "string",

            "dateCreated": "2021-09-17T10:04:52.509Z",

            "updatedByUserId": "string",

            "dateUpdated": "2021-09-17T10:04:52.509Z",

            "waitingApproveByUserId": "string",

            "waitingApproveByRoleId": "string",

            "waitingApproveByRankNo": 0,

            "approvedByUserId": "string",

            "dateApproved": "2021-09-17T10:04:52.509Z",

            "modifiedByUserId": "string",

            "remark": "string",

            "subject": "string",

           "canApprove": true,

            "isEdit": true,

            "deletable": true,

            "total": 0,

            "statusName": "string",

            "reason": "string",

            "attachments": [

                {

                    "attachmentId": 0,

                    "refId": 0,

                    "type": 0,

                    "filename": "string",

                    "extension": "string",

                    "fileSize": 0,

                    "isActive": true,

                    "createdByUserId": "string",

                    "dateCreated": "2021-09-17T10:04:52.510Z",

                    "resourceUrl": "string",

                    "companyId": 0,

                    "isProcessed": true,

                    "url": "string",

                    "urlResponseUpload": "string",

                    "thumbnail": "string"

                }

            ],

            "dateCheckout": "2021-09-17T10:04:52.510Z",

            "totalDistance": 0,

            "customerName": "string",

            "dateCheckin": "2021-09-17T10:04:52.510Z",

            "note": "string",

            "pictureUrl": "string",

            "activityIds": [

                0

            ]

        },

        "formatters": [],

        "statusCode": 200

    },

    "statusCode": 1000,

    "httpStatusCode": 200

}

Response Codes

HTTP Status Code
Description
200
สร้างข้อมูลสำเร็จ
400
ข้อมูล Request ไม่ถูกต้อง
401
Unauthorized
403
Forbidden
© Copyright 2021 Gofive Co., Ltd. All right reserved.