Expense type fields - update
Recomputes the field definitions after a client-side change to one or more fields. Send the current fields payload as the request body — typically after a field marked requiresUpdate: true was edited — and the response returns the same shape with derived and dependent fields refreshed and any custom-field scripts re-evaluated. Unlike the GET variant, no fields are seeded from server-side records; the client’s payload is the source of truth. Pass applyScanResult=<contentId> to fold receipt-scan results into the response.
curl --request PUT \
--url https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": null,
"error": null,
"custom": false
},
{
"name": null,
"property": "version",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": 2,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": "receiptAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": false,
"visible": true,
"value": "2019-09-30T14:33:26Z",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"allowFutureDate": false
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": null,
"error": null,
"custom": false,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": null,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": null
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "SEK",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": null,
"id": "SEK",
"name": "Swedish Krona",
"section": null
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": 1,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": false,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": false,
"visible": false,
"value": [],
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": true,
"visible": false,
"value": "guestListAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": false,
"visible": true,
"value": "Some comment",
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": "Some id",
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": [
"id1",
"id2"
],
"errorText": null,
"error": null,
"custom": false,
"disabled": false,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
]
}
'import requests
url = "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields"
payload = { "fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": None,
"error": None,
"custom": False
},
{
"name": None,
"property": "version",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": 2,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": False,
"visible": True,
"value": "receiptAttachmentId",
"errorText": None,
"error": None,
"custom": False,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"disabled": True
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": False,
"visible": True,
"value": "2019-09-30T14:33:26Z",
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"allowFutureDate": False
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": True,
"visible": True,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": None,
"error": None,
"custom": False,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": None,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": None
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"scannable": True
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"scannable": True
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": True,
"visible": True,
"value": "SEK",
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": None,
"id": "SEK",
"name": "Swedish Krona",
"section": None
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": False,
"visible": False,
"value": 1,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": False,
"visible": False,
"value": False,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": False,
"visible": False,
"value": [],
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": True,
"visible": False,
"value": "guestListAttachmentId",
"errorText": None,
"error": None,
"custom": False,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": True,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": True,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": False,
"visible": True,
"value": "Some comment",
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": "Some id",
"errorText": None,
"error": None,
"custom": False,
"disabled": True
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": False,
"visible": True,
"value": ["id1", "id2"],
"errorText": None,
"error": None,
"custom": False,
"disabled": False,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: [
{
name: 'Id',
property: 'id',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: '99601cd0f6ba438cb16ca17b8edf25a0',
errorText: null,
error: null,
custom: false
},
{
name: null,
property: 'version',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: 2,
errorText: null,
error: null,
custom: false
},
{
name: 'Receipt',
property: 'verification.receiptAttachment',
controlType: 'CONTENT_HOLDER',
mandatory: false,
visible: true,
value: 'receiptAttachmentId',
errorText: null,
error: null,
custom: false,
data: {id: 'receiptAttachmentId', name: 'name of receiptAttachment'}
},
{
name: 'Category',
property: 'categoryId',
controlType: 'LIST',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories'
},
{
name: 'Expense report',
property: 'expenseReportId',
controlType: 'LIST',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
url: '/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Verification number',
property: 'verification.verificationNumber',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
disabled: true
},
{
name: 'Description',
property: 'verification.description',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Date of purchase',
property: 'verification.purchaseDate',
controlType: 'DATE',
mandatory: false,
visible: true,
value: '2019-09-30T14:33:26Z',
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
allowFutureDate: false
},
{
name: 'Payment method',
property: 'verification.paymentTypeId',
controlType: 'LIST',
mandatory: true,
visible: true,
value: 'f433bd56f038486faeee6a5ddd5177f2',
errorText: null,
error: null,
custom: false,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes',
data: {
iconUrl: null,
id: 'f433bd56f038486faeee6a5ddd5177f2',
name: 'Payment',
section: null
}
},
{
name: 'Store',
property: 'verification.storeName',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Amount incl. VAT',
property: 'verification.amount',
controlType: 'DOUBLE',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
scannable: true
},
{
name: 'Tip',
property: 'verification.tip',
controlType: 'DOUBLE',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'VAT',
property: 'verification.taxAmount',
controlType: 'DOUBLE',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
scannable: true
},
{
name: 'Currency',
property: 'verification.currency',
controlType: 'LIST',
mandatory: true,
visible: true,
value: 'SEK',
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies',
data: {iconUrl: null, id: 'SEK', name: 'Swedish Krona', section: null}
},
{
name: 'Exchange rate',
property: 'verification.exchangeRate',
controlType: 'DOUBLE',
mandatory: false,
visible: false,
value: 1,
errorText: null,
error: null,
custom: false
},
{
name: 'Expense Level (not-changable)',
property: '8ab28c4f70f773590170f7cda2ea08bc',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Employee dim',
property: '8ab28c4f723887dd01723c5cae82020e',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Entertainment',
property: 'verification.representation',
controlType: 'FIELD_GROUP',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false,
fields: [
{
name: 'Type',
property: 'verification.representation.type',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false,
requiresUpdate: true
},
{
name: 'Included liquor/wine/strong beer',
property: 'verification.representation.includesLiquor',
controlType: 'SWITCH',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Attach guest list',
property: 'verification.representation.guestListAttached',
controlType: 'SWITCH',
mandatory: false,
visible: false,
value: false,
errorText: null,
error: null,
custom: false,
requiresUpdate: true
},
{
name: 'Guests',
property: 'verification.representation.guests',
controlType: 'GUEST_LIST',
mandatory: false,
visible: false,
value: [],
errorText: null,
error: null,
custom: false
},
{
name: 'Number of guests',
property: 'verification.representation.numberOfGuests',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Number of external guests',
property: 'verification.representation.numberOfExternalGuests',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Place',
property: 'verification.representation.place',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Attached guest list',
property: 'verification.representation.guestListAttachment',
controlType: 'CONTENT_HOLDER',
mandatory: true,
visible: false,
value: 'guestListAttachmentId',
errorText: null,
error: null,
custom: false,
data: {id: 'guestListAttachmentId', name: 'name of guestListAttachment'}
}
],
commands: [
{
text: 'Clear guests',
confirmationRequired: true,
confirmation: 'Are you sure you want to clear guests?',
command: 'action=removeGuests'
},
{
text: 'Clear representation',
confirmationRequired: true,
confirmation: 'Are you sure you want to clear representation?',
command: 'action=removeRepresentation'
}
]
},
{
name: 'Comment',
property: 'verification.comment',
controlType: 'MULTI_LINE_TEXT',
mandatory: false,
visible: true,
value: 'Some comment',
errorText: null,
error: null,
custom: false
},
{
name: 'Card transaction',
property: 'verification.cardTransaction',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: 'Some id',
errorText: null,
error: null,
custom: false,
disabled: true
},
{
name: 'Attachments',
property: 'verification.attachments',
controlType: 'CONTENT_HOLDER',
mandatory: false,
visible: true,
value: ['id1', 'id2'],
errorText: null,
error: null,
custom: false,
disabled: false,
data: [
{id: 'id1', name: 'name of attachment with id1'},
{id: 'id2', name: 'name of attachment with id2'}
]
}
]
})
};
fetch('https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
[
'name' => 'Id',
'property' => 'id',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => '99601cd0f6ba438cb16ca17b8edf25a0',
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => null,
'property' => 'version',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => 2,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Receipt',
'property' => 'verification.receiptAttachment',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => false,
'visible' => true,
'value' => 'receiptAttachmentId',
'errorText' => null,
'error' => null,
'custom' => false,
'data' => [
'id' => 'receiptAttachmentId',
'name' => 'name of receiptAttachment'
]
],
[
'name' => 'Category',
'property' => 'categoryId',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories'
],
[
'name' => 'Expense report',
'property' => 'expenseReportId',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'url' => '/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Verification number',
'property' => 'verification.verificationNumber',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => true
],
[
'name' => 'Description',
'property' => 'verification.description',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Date of purchase',
'property' => 'verification.purchaseDate',
'controlType' => 'DATE',
'mandatory' => false,
'visible' => true,
'value' => '2019-09-30T14:33:26Z',
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'allowFutureDate' => false
],
[
'name' => 'Payment method',
'property' => 'verification.paymentTypeId',
'controlType' => 'LIST',
'mandatory' => true,
'visible' => true,
'value' => 'f433bd56f038486faeee6a5ddd5177f2',
'errorText' => null,
'error' => null,
'custom' => false,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes',
'data' => [
'iconUrl' => null,
'id' => 'f433bd56f038486faeee6a5ddd5177f2',
'name' => 'Payment',
'section' => null
]
],
[
'name' => 'Store',
'property' => 'verification.storeName',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Amount incl. VAT',
'property' => 'verification.amount',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'scannable' => true
],
[
'name' => 'Tip',
'property' => 'verification.tip',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'VAT',
'property' => 'verification.taxAmount',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'scannable' => true
],
[
'name' => 'Currency',
'property' => 'verification.currency',
'controlType' => 'LIST',
'mandatory' => true,
'visible' => true,
'value' => 'SEK',
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies',
'data' => [
'iconUrl' => null,
'id' => 'SEK',
'name' => 'Swedish Krona',
'section' => null
]
],
[
'name' => 'Exchange rate',
'property' => 'verification.exchangeRate',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => false,
'value' => 1,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Expense Level (not-changable)',
'property' => '8ab28c4f70f773590170f7cda2ea08bc',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Employee dim',
'property' => '8ab28c4f723887dd01723c5cae82020e',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Entertainment',
'property' => 'verification.representation',
'controlType' => 'FIELD_GROUP',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'fields' => [
[
'name' => 'Type',
'property' => 'verification.representation.type',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true
],
[
'name' => 'Included liquor/wine/strong beer',
'property' => 'verification.representation.includesLiquor',
'controlType' => 'SWITCH',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Attach guest list',
'property' => 'verification.representation.guestListAttached',
'controlType' => 'SWITCH',
'mandatory' => false,
'visible' => false,
'value' => false,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true
],
[
'name' => 'Guests',
'property' => 'verification.representation.guests',
'controlType' => 'GUEST_LIST',
'mandatory' => false,
'visible' => false,
'value' => [
],
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Number of guests',
'property' => 'verification.representation.numberOfGuests',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Number of external guests',
'property' => 'verification.representation.numberOfExternalGuests',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Place',
'property' => 'verification.representation.place',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Attached guest list',
'property' => 'verification.representation.guestListAttachment',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => true,
'visible' => false,
'value' => 'guestListAttachmentId',
'errorText' => null,
'error' => null,
'custom' => false,
'data' => [
'id' => 'guestListAttachmentId',
'name' => 'name of guestListAttachment'
]
]
],
'commands' => [
[
'text' => 'Clear guests',
'confirmationRequired' => true,
'confirmation' => 'Are you sure you want to clear guests?',
'command' => 'action=removeGuests'
],
[
'text' => 'Clear representation',
'confirmationRequired' => true,
'confirmation' => 'Are you sure you want to clear representation?',
'command' => 'action=removeRepresentation'
]
]
],
[
'name' => 'Comment',
'property' => 'verification.comment',
'controlType' => 'MULTI_LINE_TEXT',
'mandatory' => false,
'visible' => true,
'value' => 'Some comment',
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Card transaction',
'property' => 'verification.cardTransaction',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => 'Some id',
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => true
],
[
'name' => 'Attachments',
'property' => 'verification.attachments',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => false,
'visible' => true,
'value' => [
'id1',
'id2'
],
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => false,
'data' => [
[
'id' => 'id1',
'name' => 'name of attachment with id1'
],
[
'id' => 'id2',
'name' => 'name of attachment with id2'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields"
payload := strings.NewReader("{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": null,
"error": null,
"custom": false
},
{
"name": null,
"property": "version",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": 2,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": "receiptAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": false,
"visible": true,
"value": "2019-09-30T14:33:26Z",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"allowFutureDate": false
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": null,
"error": null,
"custom": false,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": null,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": null
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "SEK",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": null,
"id": "SEK",
"name": "Swedish Krona",
"section": null
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": 1,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": false,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": false,
"visible": false,
"value": [],
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": true,
"visible": false,
"value": "guestListAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": false,
"visible": true,
"value": "Some comment",
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": "Some id",
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": [
"id1",
"id2"
],
"errorText": null,
"error": null,
"custom": false,
"disabled": false,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id of the organization of the user UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Expense type where CarSpecification relates to Mileage, SubsistenceAllowance to Per Diem, etc
CarSpecification, FoodBenefitsSpecification, FuelBenefitsSpecification, ReceiptVerification, SubsistenceAllowance Query Parameters
scan result id that should be applied on the fields UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Body
Fields format of expense record
Field-builder array describing the editable properties of the resource. Each entry pairs a property name with a value and any errors.
Hide child attributes
Hide child attributes
A translated name of the field, can be used to present to to the user
Identifier of the field. Contains the path to the property in the expense API, for example verification.amount, cardLiability. Expense record and expense report fields include a hidden (visible: false) version field (controlType INTEGER) holding the optimistic-lock version of the stored object (null for a new object). Send it back unchanged in the fields of the update request; if the object has been modified since it was read, the update is rejected with 409 CONCURRENT_MODIFICATION.
TEXT, MULTI_LINE_TEXT, DOUBLE, INTEGER, SWITCH, DATE, DATE_TIME, LIST, CONTENT_HOLDER, GUEST_LIST, FIELD_GROUP, LOCAL_DATE_TIME, INFORMATION The field is required
Only fields with visible = true should be shown
Tells the client that if this field is changed, the client must call the API again with the fields data
If controlType is LIST this property contains an url to the selectable values for this field
Indicates if this is a custom field not part of the standard fields
Indicates if this field is part of the data extracted by the receipt scanning
Set on the verification.receiptAttachment (CONTENT_HOLDER) field when the organization's booking country uses fiscal QR codes on receipts (currently Portugal). When true, clients should offer a QR-scan step in the receipt capture flow and, on success, send the decoded string as the qrScan header on POST /content. Absent when not applicable.
The value of the field, this is dynamic based on the control type. For example if the control type is DOUBLE the value property must have a double type. For SubsistenceAllowance and property = verification.specification[x].date1 or date2, this value is set/delivered in format "yyyy-MM-dd HH:mm" where the date is at UTC date time
When calling the fields-endpoint initially, this may contain a list object for fields with control type LIST. This way the client does not have to make a call to the list endpoint to fetch the value. This has the same structure as the result in the list.
If controlType is DATE or DATE_TIME or LOCAL_DATE_TIME, this property is set. Default value is false. If the value is false, then date picker shouldn't allow setting date to value higher than today's date.
A string that represents the error. This property is not empty when there is some error related to the specific field.
Human readable description of value returned in error property. This property is not empty when there is some error related to the specific field.
Indicates if property should be enabled or disabled for editing. In Approval flow, this property is always set to "true".
This property is populated when controlType="FIELD_GROUP" and it has the same structure as this array of objects. The list of objects represents all fields that are related to the specific field group.
This property is used for removable fields, for example on the FIELD_GROUP for a specification in allowance
This property is used to define the command available on the filed of controlType=FIELD_GROUP
Hide child attributes
Hide child attributes
This property contains the text for the command to be displayed
This property indicates if the client should display a dialog with confirmation as result of it
This property contains the text that should be displayed in case that confirmationRequired=true and client decided to perform the command/action
This property contains the command that can be executed by performing the PUT request with it on the fields endpoint
This property is set when controlType=INFORMATION and it should indicate which type of information the field is
normal, information, warning, error, success This property is set when controlType=INFORMATION to indicate if the information is dismissible or not
This property is going in combination with controlType=LIST to indicate that multiple values can be selected from the list
This property is set when there is controlType=LIST & multiSelect=true to indicate which type of item is list made of
This property is set by the URL value for the icon which can indicate access to different provided commands. It is usually provided within the field of controlType=FIELD_GROUP
This property represents the text that can be set as replacement for all the fields behind the defined FIELD_GROUP. It can be used as display for accessor to the list of the fields provided in the FIELD_GORUP
The maximum number of decimals this field can present, uses current currency. only set for fields with an amount in value.
This property contains the list of possible commands that can be performed on the specific field
Hide child attributes
Hide child attributes
This property contains the text for the command to be displayed
This property indicates if the client should display a dialog with confirmation as result of it
This property contains the text that should be displayed in case that confirmationRequired=true and client decided to perform the command/action
This property contains the command that can be executed by performing the PUT request with it on the fields endpoint
Response-only. Server-populated array of validation errors that apply to the resource as a whole (not tied to a specific field).
Hide child attributes
Hide child attributes
description provided for errorCode
textual code of error
BLOCKER indicates that expense instance cannot be sent unless the issue is corrected, ERROR indicates issue with storing/saving expense instances, WARNING indicates there is an issue with the expense instance but it allows to user to send the expense instance
BLOCKER, ERROR, WARNING Response
OK
Fields format of expense record
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Indicates if the expense record can be added to a report
false
Indicates if the expense record can be removed from a report
false
Indicates if the expense record can be deleted
true
true if the expense record can be sent in directly without report
true
Indicates if the expense record can be split
false
Indicates if the expense record can be edited
true
Indicates if the expense record can be merged with another expense record. Will only be true for expense records that are based on card transaction, has not been split and is editable by end user.
false
ONLY PART OF FoodBenefitsSpecifications! Indicates if breakfast is available for meal benefits.
false
ONLY PART OF FoodBenefitsSpecifications! Indicates if lunch is available for meal benefits.
false
ONLY PART OF FoodBenefitsSpecifications! Indicates if dinner is available for meal benefits.
false
Field-builder array describing the editable properties of the resource. Each entry pairs a property name with a value and any errors.
Hide child attributes
Hide child attributes
A translated name of the field, can be used to present to to the user
Identifier of the field. Contains the path to the property in the expense API, for example verification.amount, cardLiability. Expense record and expense report fields include a hidden (visible: false) version field (controlType INTEGER) holding the optimistic-lock version of the stored object (null for a new object). Send it back unchanged in the fields of the update request; if the object has been modified since it was read, the update is rejected with 409 CONCURRENT_MODIFICATION.
TEXT, MULTI_LINE_TEXT, DOUBLE, INTEGER, SWITCH, DATE, DATE_TIME, LIST, CONTENT_HOLDER, GUEST_LIST, FIELD_GROUP, LOCAL_DATE_TIME, INFORMATION The field is required
Only fields with visible = true should be shown
Tells the client that if this field is changed, the client must call the API again with the fields data
If controlType is LIST this property contains an url to the selectable values for this field
Indicates if this is a custom field not part of the standard fields
Indicates if this field is part of the data extracted by the receipt scanning
Set on the verification.receiptAttachment (CONTENT_HOLDER) field when the organization's booking country uses fiscal QR codes on receipts (currently Portugal). When true, clients should offer a QR-scan step in the receipt capture flow and, on success, send the decoded string as the qrScan header on POST /content. Absent when not applicable.
The value of the field, this is dynamic based on the control type. For example if the control type is DOUBLE the value property must have a double type. For SubsistenceAllowance and property = verification.specification[x].date1 or date2, this value is set/delivered in format "yyyy-MM-dd HH:mm" where the date is at UTC date time
When calling the fields-endpoint initially, this may contain a list object for fields with control type LIST. This way the client does not have to make a call to the list endpoint to fetch the value. This has the same structure as the result in the list.
If controlType is DATE or DATE_TIME or LOCAL_DATE_TIME, this property is set. Default value is false. If the value is false, then date picker shouldn't allow setting date to value higher than today's date.
A string that represents the error. This property is not empty when there is some error related to the specific field.
Human readable description of value returned in error property. This property is not empty when there is some error related to the specific field.
Indicates if property should be enabled or disabled for editing. In Approval flow, this property is always set to "true".
This property is populated when controlType="FIELD_GROUP" and it has the same structure as this array of objects. The list of objects represents all fields that are related to the specific field group.
This property is used for removable fields, for example on the FIELD_GROUP for a specification in allowance
This property is used to define the command available on the filed of controlType=FIELD_GROUP
Hide child attributes
Hide child attributes
This property contains the text for the command to be displayed
This property indicates if the client should display a dialog with confirmation as result of it
This property contains the text that should be displayed in case that confirmationRequired=true and client decided to perform the command/action
This property contains the command that can be executed by performing the PUT request with it on the fields endpoint
This property is set when controlType=INFORMATION and it should indicate which type of information the field is
normal, information, warning, error, success This property is set when controlType=INFORMATION to indicate if the information is dismissible or not
This property is going in combination with controlType=LIST to indicate that multiple values can be selected from the list
This property is set when there is controlType=LIST & multiSelect=true to indicate which type of item is list made of
This property is set by the URL value for the icon which can indicate access to different provided commands. It is usually provided within the field of controlType=FIELD_GROUP
This property represents the text that can be set as replacement for all the fields behind the defined FIELD_GROUP. It can be used as display for accessor to the list of the fields provided in the FIELD_GORUP
The maximum number of decimals this field can present, uses current currency. only set for fields with an amount in value.
This property contains the list of possible commands that can be performed on the specific field
Hide child attributes
Hide child attributes
This property contains the text for the command to be displayed
This property indicates if the client should display a dialog with confirmation as result of it
This property contains the text that should be displayed in case that confirmationRequired=true and client decided to perform the command/action
This property contains the command that can be executed by performing the PUT request with it on the fields endpoint
Response-only. Server-populated array of validation errors that apply to the resource as a whole (not tied to a specific field).
Hide child attributes
Hide child attributes
description provided for errorCode
textual code of error
BLOCKER indicates that expense instance cannot be sent unless the issue is corrected, ERROR indicates issue with storing/saving expense instances, WARNING indicates there is an issue with the expense instance but it allows to user to send the expense instance
BLOCKER, ERROR, WARNING curl --request PUT \
--url https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": null,
"error": null,
"custom": false
},
{
"name": null,
"property": "version",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": 2,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": "receiptAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": false,
"visible": true,
"value": "2019-09-30T14:33:26Z",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"allowFutureDate": false
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": null,
"error": null,
"custom": false,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": null,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": null
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "SEK",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": null,
"id": "SEK",
"name": "Swedish Krona",
"section": null
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": 1,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": false,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": false,
"visible": false,
"value": [],
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": true,
"visible": false,
"value": "guestListAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": false,
"visible": true,
"value": "Some comment",
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": "Some id",
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": [
"id1",
"id2"
],
"errorText": null,
"error": null,
"custom": false,
"disabled": false,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
]
}
'import requests
url = "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields"
payload = { "fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": None,
"error": None,
"custom": False
},
{
"name": None,
"property": "version",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": 2,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": False,
"visible": True,
"value": "receiptAttachmentId",
"errorText": None,
"error": None,
"custom": False,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"disabled": True
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": False,
"visible": True,
"value": "2019-09-30T14:33:26Z",
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"allowFutureDate": False
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": True,
"visible": True,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": None,
"error": None,
"custom": False,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": None,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": None
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"scannable": True
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": False,
"visible": True,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"scannable": True
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": True,
"visible": True,
"value": "SEK",
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True,
"scannable": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": None,
"id": "SEK",
"name": "Swedish Krona",
"section": None
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": False,
"visible": False,
"value": 1,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": True,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": False,
"visible": False,
"value": False,
"errorText": None,
"error": None,
"custom": False,
"requiresUpdate": True
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": False,
"visible": False,
"value": [],
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": False,
"visible": False,
"value": None,
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": True,
"visible": False,
"value": "guestListAttachmentId",
"errorText": None,
"error": None,
"custom": False,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": True,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": True,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": False,
"visible": True,
"value": "Some comment",
"errorText": None,
"error": None,
"custom": False
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": False,
"visible": True,
"value": "Some id",
"errorText": None,
"error": None,
"custom": False,
"disabled": True
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": False,
"visible": True,
"value": ["id1", "id2"],
"errorText": None,
"error": None,
"custom": False,
"disabled": False,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields: [
{
name: 'Id',
property: 'id',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: '99601cd0f6ba438cb16ca17b8edf25a0',
errorText: null,
error: null,
custom: false
},
{
name: null,
property: 'version',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: 2,
errorText: null,
error: null,
custom: false
},
{
name: 'Receipt',
property: 'verification.receiptAttachment',
controlType: 'CONTENT_HOLDER',
mandatory: false,
visible: true,
value: 'receiptAttachmentId',
errorText: null,
error: null,
custom: false,
data: {id: 'receiptAttachmentId', name: 'name of receiptAttachment'}
},
{
name: 'Category',
property: 'categoryId',
controlType: 'LIST',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories'
},
{
name: 'Expense report',
property: 'expenseReportId',
controlType: 'LIST',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
url: '/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Verification number',
property: 'verification.verificationNumber',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
disabled: true
},
{
name: 'Description',
property: 'verification.description',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Date of purchase',
property: 'verification.purchaseDate',
controlType: 'DATE',
mandatory: false,
visible: true,
value: '2019-09-30T14:33:26Z',
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
allowFutureDate: false
},
{
name: 'Payment method',
property: 'verification.paymentTypeId',
controlType: 'LIST',
mandatory: true,
visible: true,
value: 'f433bd56f038486faeee6a5ddd5177f2',
errorText: null,
error: null,
custom: false,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes',
data: {
iconUrl: null,
id: 'f433bd56f038486faeee6a5ddd5177f2',
name: 'Payment',
section: null
}
},
{
name: 'Store',
property: 'verification.storeName',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Amount incl. VAT',
property: 'verification.amount',
controlType: 'DOUBLE',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
scannable: true
},
{
name: 'Tip',
property: 'verification.tip',
controlType: 'DOUBLE',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'VAT',
property: 'verification.taxAmount',
controlType: 'DOUBLE',
mandatory: false,
visible: true,
value: null,
errorText: null,
error: null,
custom: false,
scannable: true
},
{
name: 'Currency',
property: 'verification.currency',
controlType: 'LIST',
mandatory: true,
visible: true,
value: 'SEK',
errorText: null,
error: null,
custom: false,
requiresUpdate: true,
scannable: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies',
data: {iconUrl: null, id: 'SEK', name: 'Swedish Krona', section: null}
},
{
name: 'Exchange rate',
property: 'verification.exchangeRate',
controlType: 'DOUBLE',
mandatory: false,
visible: false,
value: 1,
errorText: null,
error: null,
custom: false
},
{
name: 'Expense Level (not-changable)',
property: '8ab28c4f70f773590170f7cda2ea08bc',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Employee dim',
property: '8ab28c4f723887dd01723c5cae82020e',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: true,
url: '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216'
},
{
name: 'Entertainment',
property: 'verification.representation',
controlType: 'FIELD_GROUP',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false,
fields: [
{
name: 'Type',
property: 'verification.representation.type',
controlType: 'LIST',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false,
requiresUpdate: true
},
{
name: 'Included liquor/wine/strong beer',
property: 'verification.representation.includesLiquor',
controlType: 'SWITCH',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Attach guest list',
property: 'verification.representation.guestListAttached',
controlType: 'SWITCH',
mandatory: false,
visible: false,
value: false,
errorText: null,
error: null,
custom: false,
requiresUpdate: true
},
{
name: 'Guests',
property: 'verification.representation.guests',
controlType: 'GUEST_LIST',
mandatory: false,
visible: false,
value: [],
errorText: null,
error: null,
custom: false
},
{
name: 'Number of guests',
property: 'verification.representation.numberOfGuests',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Number of external guests',
property: 'verification.representation.numberOfExternalGuests',
controlType: 'INTEGER',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Place',
property: 'verification.representation.place',
controlType: 'TEXT',
mandatory: false,
visible: false,
value: null,
errorText: null,
error: null,
custom: false
},
{
name: 'Attached guest list',
property: 'verification.representation.guestListAttachment',
controlType: 'CONTENT_HOLDER',
mandatory: true,
visible: false,
value: 'guestListAttachmentId',
errorText: null,
error: null,
custom: false,
data: {id: 'guestListAttachmentId', name: 'name of guestListAttachment'}
}
],
commands: [
{
text: 'Clear guests',
confirmationRequired: true,
confirmation: 'Are you sure you want to clear guests?',
command: 'action=removeGuests'
},
{
text: 'Clear representation',
confirmationRequired: true,
confirmation: 'Are you sure you want to clear representation?',
command: 'action=removeRepresentation'
}
]
},
{
name: 'Comment',
property: 'verification.comment',
controlType: 'MULTI_LINE_TEXT',
mandatory: false,
visible: true,
value: 'Some comment',
errorText: null,
error: null,
custom: false
},
{
name: 'Card transaction',
property: 'verification.cardTransaction',
controlType: 'TEXT',
mandatory: false,
visible: true,
value: 'Some id',
errorText: null,
error: null,
custom: false,
disabled: true
},
{
name: 'Attachments',
property: 'verification.attachments',
controlType: 'CONTENT_HOLDER',
mandatory: false,
visible: true,
value: ['id1', 'id2'],
errorText: null,
error: null,
custom: false,
disabled: false,
data: [
{id: 'id1', name: 'name of attachment with id1'},
{id: 'id2', name: 'name of attachment with id2'}
]
}
]
})
};
fetch('https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
[
'name' => 'Id',
'property' => 'id',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => '99601cd0f6ba438cb16ca17b8edf25a0',
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => null,
'property' => 'version',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => 2,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Receipt',
'property' => 'verification.receiptAttachment',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => false,
'visible' => true,
'value' => 'receiptAttachmentId',
'errorText' => null,
'error' => null,
'custom' => false,
'data' => [
'id' => 'receiptAttachmentId',
'name' => 'name of receiptAttachment'
]
],
[
'name' => 'Category',
'property' => 'categoryId',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories'
],
[
'name' => 'Expense report',
'property' => 'expenseReportId',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'url' => '/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Verification number',
'property' => 'verification.verificationNumber',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => true
],
[
'name' => 'Description',
'property' => 'verification.description',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Date of purchase',
'property' => 'verification.purchaseDate',
'controlType' => 'DATE',
'mandatory' => false,
'visible' => true,
'value' => '2019-09-30T14:33:26Z',
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'allowFutureDate' => false
],
[
'name' => 'Payment method',
'property' => 'verification.paymentTypeId',
'controlType' => 'LIST',
'mandatory' => true,
'visible' => true,
'value' => 'f433bd56f038486faeee6a5ddd5177f2',
'errorText' => null,
'error' => null,
'custom' => false,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes',
'data' => [
'iconUrl' => null,
'id' => 'f433bd56f038486faeee6a5ddd5177f2',
'name' => 'Payment',
'section' => null
]
],
[
'name' => 'Store',
'property' => 'verification.storeName',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Amount incl. VAT',
'property' => 'verification.amount',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'scannable' => true
],
[
'name' => 'Tip',
'property' => 'verification.tip',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'VAT',
'property' => 'verification.taxAmount',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => true,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'scannable' => true
],
[
'name' => 'Currency',
'property' => 'verification.currency',
'controlType' => 'LIST',
'mandatory' => true,
'visible' => true,
'value' => 'SEK',
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true,
'scannable' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies',
'data' => [
'iconUrl' => null,
'id' => 'SEK',
'name' => 'Swedish Krona',
'section' => null
]
],
[
'name' => 'Exchange rate',
'property' => 'verification.exchangeRate',
'controlType' => 'DOUBLE',
'mandatory' => false,
'visible' => false,
'value' => 1,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Expense Level (not-changable)',
'property' => '8ab28c4f70f773590170f7cda2ea08bc',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Employee dim',
'property' => '8ab28c4f723887dd01723c5cae82020e',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => true,
'url' => '/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216'
],
[
'name' => 'Entertainment',
'property' => 'verification.representation',
'controlType' => 'FIELD_GROUP',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'fields' => [
[
'name' => 'Type',
'property' => 'verification.representation.type',
'controlType' => 'LIST',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true
],
[
'name' => 'Included liquor/wine/strong beer',
'property' => 'verification.representation.includesLiquor',
'controlType' => 'SWITCH',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Attach guest list',
'property' => 'verification.representation.guestListAttached',
'controlType' => 'SWITCH',
'mandatory' => false,
'visible' => false,
'value' => false,
'errorText' => null,
'error' => null,
'custom' => false,
'requiresUpdate' => true
],
[
'name' => 'Guests',
'property' => 'verification.representation.guests',
'controlType' => 'GUEST_LIST',
'mandatory' => false,
'visible' => false,
'value' => [
],
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Number of guests',
'property' => 'verification.representation.numberOfGuests',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Number of external guests',
'property' => 'verification.representation.numberOfExternalGuests',
'controlType' => 'INTEGER',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Place',
'property' => 'verification.representation.place',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => false,
'value' => null,
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Attached guest list',
'property' => 'verification.representation.guestListAttachment',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => true,
'visible' => false,
'value' => 'guestListAttachmentId',
'errorText' => null,
'error' => null,
'custom' => false,
'data' => [
'id' => 'guestListAttachmentId',
'name' => 'name of guestListAttachment'
]
]
],
'commands' => [
[
'text' => 'Clear guests',
'confirmationRequired' => true,
'confirmation' => 'Are you sure you want to clear guests?',
'command' => 'action=removeGuests'
],
[
'text' => 'Clear representation',
'confirmationRequired' => true,
'confirmation' => 'Are you sure you want to clear representation?',
'command' => 'action=removeRepresentation'
]
]
],
[
'name' => 'Comment',
'property' => 'verification.comment',
'controlType' => 'MULTI_LINE_TEXT',
'mandatory' => false,
'visible' => true,
'value' => 'Some comment',
'errorText' => null,
'error' => null,
'custom' => false
],
[
'name' => 'Card transaction',
'property' => 'verification.cardTransaction',
'controlType' => 'TEXT',
'mandatory' => false,
'visible' => true,
'value' => 'Some id',
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => true
],
[
'name' => 'Attachments',
'property' => 'verification.attachments',
'controlType' => 'CONTENT_HOLDER',
'mandatory' => false,
'visible' => true,
'value' => [
'id1',
'id2'
],
'errorText' => null,
'error' => null,
'custom' => false,
'disabled' => false,
'data' => [
[
'id' => 'id1',
'name' => 'name of attachment with id1'
],
[
'id' => 'id2',
'name' => 'name of attachment with id2'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields"
payload := strings.NewReader("{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/expense/me/organizations/{id}/expensetypes/{expenseType}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": [\n {\n \"name\": \"Id\",\n \"property\": \"id\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": \"99601cd0f6ba438cb16ca17b8edf25a0\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": null,\n \"property\": \"version\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 2,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Receipt\",\n \"property\": \"verification.receiptAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"receiptAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"receiptAttachmentId\",\n \"name\": \"name of receiptAttachment\"\n }\n },\n {\n \"name\": \"Category\",\n \"property\": \"categoryId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories\"\n },\n {\n \"name\": \"Expense report\",\n \"property\": \"expenseReportId\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Verification number\",\n \"property\": \"verification.verificationNumber\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Description\",\n \"property\": \"verification.description\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Date of purchase\",\n \"property\": \"verification.purchaseDate\",\n \"controlType\": \"DATE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"2019-09-30T14:33:26Z\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"allowFutureDate\": false\n },\n {\n \"name\": \"Payment method\",\n \"property\": \"verification.paymentTypeId\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"f433bd56f038486faeee6a5ddd5177f2\",\n \"name\": \"Payment\",\n \"section\": null\n }\n },\n {\n \"name\": \"Store\",\n \"property\": \"verification.storeName\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Amount incl. VAT\",\n \"property\": \"verification.amount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Tip\",\n \"property\": \"verification.tip\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"VAT\",\n \"property\": \"verification.taxAmount\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"scannable\": true\n },\n {\n \"name\": \"Currency\",\n \"property\": \"verification.currency\",\n \"controlType\": \"LIST\",\n \"mandatory\": true,\n \"visible\": true,\n \"value\": \"SEK\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true,\n \"scannable\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies\",\n \"data\": {\n \"iconUrl\": null,\n \"id\": \"SEK\",\n \"name\": \"Swedish Krona\",\n \"section\": null\n }\n },\n {\n \"name\": \"Exchange rate\",\n \"property\": \"verification.exchangeRate\",\n \"controlType\": \"DOUBLE\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": 1,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Expense Level (not-changable)\",\n \"property\": \"8ab28c4f70f773590170f7cda2ea08bc\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Employee dim\",\n \"property\": \"8ab28c4f723887dd01723c5cae82020e\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": true,\n \"url\": \"/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216\"\n },\n {\n \"name\": \"Entertainment\",\n \"property\": \"verification.representation\",\n \"controlType\": \"FIELD_GROUP\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"fields\": [\n {\n \"name\": \"Type\",\n \"property\": \"verification.representation.type\",\n \"controlType\": \"LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Included liquor/wine/strong beer\",\n \"property\": \"verification.representation.includesLiquor\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attach guest list\",\n \"property\": \"verification.representation.guestListAttached\",\n \"controlType\": \"SWITCH\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": false,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"requiresUpdate\": true\n },\n {\n \"name\": \"Guests\",\n \"property\": \"verification.representation.guests\",\n \"controlType\": \"GUEST_LIST\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": [],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of guests\",\n \"property\": \"verification.representation.numberOfGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Number of external guests\",\n \"property\": \"verification.representation.numberOfExternalGuests\",\n \"controlType\": \"INTEGER\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Place\",\n \"property\": \"verification.representation.place\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": false,\n \"value\": null,\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Attached guest list\",\n \"property\": \"verification.representation.guestListAttachment\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": true,\n \"visible\": false,\n \"value\": \"guestListAttachmentId\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"data\": {\n \"id\": \"guestListAttachmentId\",\n \"name\": \"name of guestListAttachment\"\n }\n }\n ],\n \"commands\": [\n {\n \"text\": \"Clear guests\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear guests?\",\n \"command\": \"action=removeGuests\"\n },\n {\n \"text\": \"Clear representation\",\n \"confirmationRequired\": true,\n \"confirmation\": \"Are you sure you want to clear representation?\",\n \"command\": \"action=removeRepresentation\"\n }\n ]\n },\n {\n \"name\": \"Comment\",\n \"property\": \"verification.comment\",\n \"controlType\": \"MULTI_LINE_TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some comment\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false\n },\n {\n \"name\": \"Card transaction\",\n \"property\": \"verification.cardTransaction\",\n \"controlType\": \"TEXT\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": \"Some id\",\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": true\n },\n {\n \"name\": \"Attachments\",\n \"property\": \"verification.attachments\",\n \"controlType\": \"CONTENT_HOLDER\",\n \"mandatory\": false,\n \"visible\": true,\n \"value\": [\n \"id1\",\n \"id2\"\n ],\n \"errorText\": null,\n \"error\": null,\n \"custom\": false,\n \"disabled\": false,\n \"data\": [\n {\n \"id\": \"id1\",\n \"name\": \"name of attachment with id1\"\n },\n {\n \"id\": \"id2\",\n \"name\": \"name of attachment with id2\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"fields": [
{
"name": "Id",
"property": "id",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": "99601cd0f6ba438cb16ca17b8edf25a0",
"errorText": null,
"error": null,
"custom": false
},
{
"name": null,
"property": "version",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": 2,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Receipt",
"property": "verification.receiptAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": "receiptAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "receiptAttachmentId",
"name": "name of receiptAttachment"
}
},
{
"name": "Category",
"property": "categoryId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/expensetypes/ReceiptVerification/categories"
},
{
"name": "Expense report",
"property": "expenseReportId",
"controlType": "LIST",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"url": "/expensereports?statuses=NORMAL,NEW&organizationId=8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Verification number",
"property": "verification.verificationNumber",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Description",
"property": "verification.description",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Date of purchase",
"property": "verification.purchaseDate",
"controlType": "DATE",
"mandatory": false,
"visible": true,
"value": "2019-09-30T14:33:26Z",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"allowFutureDate": false
},
{
"name": "Payment method",
"property": "verification.paymentTypeId",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "f433bd56f038486faeee6a5ddd5177f2",
"errorText": null,
"error": null,
"custom": false,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/paymenttypes",
"data": {
"iconUrl": null,
"id": "f433bd56f038486faeee6a5ddd5177f2",
"name": "Payment",
"section": null
}
},
{
"name": "Store",
"property": "verification.storeName",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Amount incl. VAT",
"property": "verification.amount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Tip",
"property": "verification.tip",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "VAT",
"property": "verification.taxAmount",
"controlType": "DOUBLE",
"mandatory": false,
"visible": true,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"scannable": true
},
{
"name": "Currency",
"property": "verification.currency",
"controlType": "LIST",
"mandatory": true,
"visible": true,
"value": "SEK",
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true,
"scannable": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/currencies",
"data": {
"iconUrl": null,
"id": "SEK",
"name": "Swedish Krona",
"section": null
}
},
{
"name": "Exchange rate",
"property": "verification.exchangeRate",
"controlType": "DOUBLE",
"mandatory": false,
"visible": false,
"value": 1,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Expense Level (not-changable)",
"property": "8ab28c4f70f773590170f7cda2ea08bc",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_4f38a4cc3fe242d394058626523044c1_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Employee dim",
"property": "8ab28c4f723887dd01723c5cae82020e",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": true,
"url": "/me/organizations/8ab28cb36ccde07d016ccdfb47d00216/lists/CUSTOM_DIMENSIONS_d4c8684b75ff4026b69810c8d912aea4_8ab28cb36ccde07d016ccdfb47d00216"
},
{
"name": "Entertainment",
"property": "verification.representation",
"controlType": "FIELD_GROUP",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"fields": [
{
"name": "Type",
"property": "verification.representation.type",
"controlType": "LIST",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Included liquor/wine/strong beer",
"property": "verification.representation.includesLiquor",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attach guest list",
"property": "verification.representation.guestListAttached",
"controlType": "SWITCH",
"mandatory": false,
"visible": false,
"value": false,
"errorText": null,
"error": null,
"custom": false,
"requiresUpdate": true
},
{
"name": "Guests",
"property": "verification.representation.guests",
"controlType": "GUEST_LIST",
"mandatory": false,
"visible": false,
"value": [],
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of guests",
"property": "verification.representation.numberOfGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Number of external guests",
"property": "verification.representation.numberOfExternalGuests",
"controlType": "INTEGER",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Place",
"property": "verification.representation.place",
"controlType": "TEXT",
"mandatory": false,
"visible": false,
"value": null,
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Attached guest list",
"property": "verification.representation.guestListAttachment",
"controlType": "CONTENT_HOLDER",
"mandatory": true,
"visible": false,
"value": "guestListAttachmentId",
"errorText": null,
"error": null,
"custom": false,
"data": {
"id": "guestListAttachmentId",
"name": "name of guestListAttachment"
}
}
],
"commands": [
{
"text": "Clear guests",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear guests?",
"command": "action=removeGuests"
},
{
"text": "Clear representation",
"confirmationRequired": true,
"confirmation": "Are you sure you want to clear representation?",
"command": "action=removeRepresentation"
}
]
},
{
"name": "Comment",
"property": "verification.comment",
"controlType": "MULTI_LINE_TEXT",
"mandatory": false,
"visible": true,
"value": "Some comment",
"errorText": null,
"error": null,
"custom": false
},
{
"name": "Card transaction",
"property": "verification.cardTransaction",
"controlType": "TEXT",
"mandatory": false,
"visible": true,
"value": "Some id",
"errorText": null,
"error": null,
"custom": false,
"disabled": true
},
{
"name": "Attachments",
"property": "verification.attachments",
"controlType": "CONTENT_HOLDER",
"mandatory": false,
"visible": true,
"value": [
"id1",
"id2"
],
"errorText": null,
"error": null,
"custom": false,
"disabled": false,
"data": [
{
"id": "id1",
"name": "name of attachment with id1"
},
{
"id": "id2",
"name": "name of attachment with id2"
}
]
}
]
}
