Expenses API

List expenses

GET /kb_expense
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id
  • total
  • total_net
  • total_gross
  • updated_at

The following scopes are needed:

  • kb_expense_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 1380
Content-Type: application/json
[
  {
    "id": 1,
    "document_nr": "00001",
    "title": null,
    "contact_id": 1,
    "contact_sub_id": null,
    "user_id": 1,
    "pr_project_id": null,
    "logopaper_id": 1,
    "language_id": 1,
    "bank_account_id": 1,
    "currency_id": 1,
    "mwst_type": 0,
    "mwst_is_net": true,
    "show_position_taxes": false,
    "is_valid_from": "2015-09-18",
    "is_valid_to": "2015-10-17",
    "kb_item_status_id": 33,
    "api_reference": null,
    "total_gross": "100.0000",
    "total_net": "100.0000",
    "total_taxes": "8.0000",
    "total_paid_payments": "108.0000",
    "total_remaining_payments": "0.0000",
    "viewed_by_client_at": null,
    "total": "108.0000",
    "updated_at": "2015-09-18 15:41:14",
    "taxs": [
      {
        "percentage": 8,
        "value": "8.0000"
      }
    ],
    "info": null,
    "allowable_bill": null,
    "account_id": null,
    "tax_id": 6,
    "amount": "100.0000"
  },
  {
    "id": 2,
    "document_nr": "00002",
    "title": "",
    "contact_id": 1,
    "contact_sub_id": null,
    "user_id": 1,
    "pr_project_id": null,
    "logopaper_id": 1,
    "language_id": 1,
    "bank_account_id": 1,
    "currency_id": 1,
    "mwst_type": 0,
    "mwst_is_net": true,
    "show_position_taxes": false,
    "is_valid_from": "2015-09-18",
    "is_valid_to": "2015-10-17",
    "kb_item_status_id": 33,
    "api_reference": "",
    "total_gross": "100.0000",
    "total_net": "100.0000",
    "total_taxes": "8.0000",
    "total_paid_payments": "108.0000",
    "total_remaining_payments": "0.0000",
    "viewed_by_client_at": null,
    "total": "108.0000",
    "updated_at": "2015-09-18 15:41:42",
    "taxs": [
      {
        "percentage": "8.00",
        "value": "8.0000"
      }
    ],
    "info": "",
    "allowable_bill": null,
    "account_id": 91,
    "tax_id": 6,
    "amount": "100.0000"
  }
]

Search expenses

POST /kb_expense/search
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
[
  {
    "field": "contact_id",
    "value": 1
  }
]
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id
  • total
  • total_gross
  • total_net
  • updated_at
Name Required Type Description
id optional string
kb_item_status_id optional string
document_nr optional string
title optional string
contact_id optional string
contact_sub_id optional string
user_id optional string
currency_id optional string
total_gross optional string
total_net optional string
total optional string
is_valid_from optional string
is_valid_to optional string
is_valid_until optional string
updated_at optional string

The following scopes are needed:

  • kb_expense_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 1380
Content-Type: application/json
[
  {
    "id": 1,
    "document_nr": "00001",
    "title": null,
    "contact_id": 1,
    "contact_sub_id": null,
    "user_id": 1,
    "pr_project_id": null,
    "logopaper_id": 1,
    "language_id": 1,
    "bank_account_id": 1,
    "currency_id": 1,
    "mwst_type": 0,
    "mwst_is_net": true,
    "show_position_taxes": false,
    "is_valid_from": "2015-09-18",
    "is_valid_to": "2015-10-17",
    "kb_item_status_id": 33,
    "api_reference": null,
    "total_gross": "100.0000",
    "total_net": "100.0000",
    "total_taxes": "8.0000",
    "total_paid_payments": "108.0000",
    "total_remaining_payments": "0.0000",
    "viewed_by_client_at": null,
    "total": "108.0000",
    "updated_at": "2015-09-18 15:41:14",
    "taxs": [
      {
        "percentage": 8,
        "value": "8.0000"
      }
    ],
    "info": null,
    "allowable_bill": null,
    "account_id": null,
    "tax_id": 6,
    "amount": "100.0000"
  },
  {
    "id": 2,
    "document_nr": "00002",
    "title": "",
    "contact_id": 1,
    "contact_sub_id": null,
    "user_id": 1,
    "pr_project_id": null,
    "logopaper_id": 1,
    "language_id": 1,
    "bank_account_id": 1,
    "currency_id": 1,
    "mwst_type": 0,
    "mwst_is_net": true,
    "show_position_taxes": false,
    "is_valid_from": "2015-09-18",
    "is_valid_to": "2015-10-17",
    "kb_item_status_id": 33,
    "api_reference": "",
    "total_gross": "100.0000",
    "total_net": "100.0000",
    "total_taxes": "8.0000",
    "total_paid_payments": "108.0000",
    "total_remaining_payments": "0.0000",
    "viewed_by_client_at": null,
    "total": "108.0000",
    "updated_at": "2015-09-18 15:41:42",
    "taxs": [
      {
        "percentage": "8.00",
        "value": "8.0000"
      }
    ],
    "info": "",
    "allowable_bill": null,
    "account_id": 91,
    "tax_id": 6,
    "amount": "100.0000"
  }
]

Show expense

GET /kb_expense/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_expense_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Etag: cd8d329a693cd043621117bda58be7ea
Content-Length: 687
Content-Type: application/json
{
  "id": 2,
  "document_nr": "00002",
  "title": "",
  "contact_id": 1,
  "contact_sub_id": null,
  "user_id": 1,
  "pr_project_id": null,
  "logopaper_id": 1,
  "language_id": 1,
  "bank_account_id": 1,
  "currency_id": 1,
  "mwst_type": 0,
  "mwst_is_net": true,
  "show_position_taxes": false,
  "is_valid_from": "2015-09-18",
  "is_valid_to": "2015-10-17",
  "kb_item_status_id": 33,
  "api_reference": "",
  "total_gross": "100.0000",
  "total_net": "100.0000",
  "total_taxes": "8.0000",
  "total_paid_payments": "108.0000",
  "total_remaining_payments": "0.0000",
  "viewed_by_client_at": null,
  "total": "108.0000",
  "updated_at": "2015-09-18 15:41:42",
  "taxs": [
    {
      "percentage": "8.00",
      "value": "8.0000"
    }
  ],
  "info": "",
  "allowable_bill": null,
  "account_id": 91,
  "tax_id": 6,
  "amount": "100.0000"
}

Create expense

POST /kb_expense
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "user_id": 1,
  "contact_id": 1,
  "tax_id": 6,
  "amount": 100,
  "account_id": 91
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
account_id required Resource account
amount required decimal
tax_id required Resource tax
user_id required Resource user
api_reference optional string (80) This field can only be read and edited by the api. It can be used to save references to other systems.
bank_account_id optional Resource bank_account
contact_address_id optional Resource contact_address
contact_address_manual optional string (500)
contact_id optional Resource contact
contact_sub_id optional Resource contact
currency_id optional Resource currency
footer optional string (4000)
header optional string (4000)
info optional string
is_compact_view optional boolean
is_valid_from optional date (Format yyyy-mm-dd)
language_id optional Resource language
logopaper_id optional Resource logopaper
mwst_is_net optional boolean This value affects the total if the field mwst_type has been set to 0.
false = Taxes are included in the total
true = Taxes will be added to the total
mwst_type optional integer Possible values
0 = including taxes
1 = excluding taxes
2 = exempt from taxes
nb_decimals_amount optional integer
nb_decimals_price optional integer
payment_type_id optional Resource payment_type
pr_project_id optional Resource pr_project
show_position_taxes optional boolean
terms_of_payment_text optional string (2000)
title optional string (80)
viewed_by_client_at optional datetime (Format yyyy-mm-dd hh:ii:ss)

The following scopes are needed:

  • kb_expense_edit
Status: 201 Created
X-Authenticated-User: apiextract_1
Etag: cd8d329a693cd043621117bda58be7ea
Content-Length: 662
Content-Type: application/json
{
  "id": 2,
  "document_nr": "00002",
  "title": "",
  "contact_id": 1,
  "contact_sub_id": null,
  "user_id": 1,
  "pr_project_id": null,
  "logopaper_id": 1,
  "language_id": 1,
  "bank_account_id": 1,
  "currency_id": 1,
  "mwst_type": 0,
  "mwst_is_net": true,
  "show_position_taxes": false,
  "is_valid_from": "2015-09-18",
  "is_valid_to": "2015-10-17",
  "kb_item_status_id": 33,
  "api_reference": "",
  "total_gross": "100",
  "total_net": "100",
  "total_taxes": "8.0000",
  "total_paid_payments": "108",
  "total_remaining_payments": "0.0000",
  "viewed_by_client_at": null,
  "total": "108",
  "updated_at": "2015-09-18 15:41:42",
  "taxs": [
    {
      "percentage": "8.00",
      "value": "8.0000"
    }
  ],
  "info": "",
  "allowable_bill": null,
  "account_id": 91,
  "tax_id": 6,
  "amount": "100"
}

Create invoice

POST /kb_expense/1/invoice
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "user_id": 1,
  "contact_id": 1,
  "tax_id": 1
}
Name Required Type Description
callback optional string Javascript-Callback
Name Required Type Description
contact_id required Resource contact
tax_id required Resource tax The tax id to use for the newly created expense position
user_id required Resource user
api_reference optional string (80) This field can only be read and edited by the api. It can be used to save references to other systems.
bank_account_id optional Resource bank_account
contact_address_id optional Resource contact_address
contact_address_manual optional string (500)
contact_sub_id optional Resource contact
currency_id optional Resource currency
footer optional string (4000)
header optional string (4000)
is_compact_view optional boolean
is_valid_from optional date (Format yyyy-mm-dd)
is_valid_to optional date (Format yyyy-mm-dd)
kb_terms_of_payment_template_id optional Resource kb_terms_of_payment_template
language_id optional Resource language
logopaper_id optional Resource logopaper
mwst_is_net optional boolean This value affects the total if the field mwst_type has been set to 0.
false = Taxes are included in the total
true = Taxes will be added to the total
mwst_type optional integer Possible values
0 = including taxes
1 = excluding taxes
2 = exempt from taxes
nb_decimals_amount optional integer
nb_decimals_price optional integer
payment_type_id optional Resource payment_type
pr_project_id optional Resource pr_project
show_position_taxes optional boolean
terms_of_payment_text optional string (2000)
title optional string (80)
viewed_by_client_at optional datetime (Format yyyy-mm-dd hh:ii:ss)

The following scopes are needed:

  • kb_expense_show
Status: 201 Created
X-Authenticated-User: apiextract_1
Etag: 0519b39478c0d3695f9c843fb673cce9
Content-Length: 1272
Content-Type: application/json
{
  "id": 2,
  "document_nr": "RE-00002",
  "title": "",
  "contact_id": 1,
  "contact_sub_id": null,
  "user_id": 1,
  "project_id": null,
  "logopaper_id": 1,
  "language_id": 1,
  "bank_account_id": 1,
  "currency_id": 1,
  "payment_type_id": 1,
  "header": "Sehr geehrte Damen und HerrenWir erlauben uns, Ihnen wie folgt in Rechnung zu stellen:",
  "footer": "Bei Fragen stehen wir Ihnen gerne zur Verfügung.Freundliche Grüsse",
  "total_gross": "108",
  "total_net": "108",
  "total_taxes": "8.6400",
  "total_received_payments": "0",
  "total_credit_vouchers": "0",
  "total_remaining_payments": "116.6500",
  "total": "116.65",
  "mwst_type": 0,
  "mwst_is_net": true,
  "show_position_taxes": false,
  "is_valid_from": "2015-09-18",
  "is_valid_to": "2015-10-17",
  "contact_address": "Muster AG\nMüllerstrasse 22\n8004 Zürich",
  "kb_item_status_id": 7,
  "api_reference": "",
  "viewed_by_client_at": null,
  "updated_at": "2015-09-18 15:41:44",
  "esr_id": 2,
  "taxs": [
    {
      "percentage": "8.00",
      "value": "8.6400"
    }
  ],
  "positions": [
    {
      "id": 1,
      "type": "KbPositionExpense",
      "amount": "1",
      "unit_id": null,
      "account_id": null,
      "unit_name": null,
      "tax_id": 1,
      "tax_value": "8.00",
      "text": "Datum des Aufwands: 18.09.2015",
      "unit_price": "108",
      "discount_in_percent": null,
      "position_total": "108",
      "pos": "1",
      "internal_pos": 1,
      "parent_id": null,
      "is_optional": false
    }
  ],
  "network_link": ""
}

Overwrite expense

PUT /kb_expense/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "user_id": 1,
  "contact_id": 2,
  "account_id": 91,
  "logopaper_id": "1",
  "language_id": "1",
  "bank_account_id": "1",
  "currency_id": "1",
  "mwst_type": "0",
  "nb_decimals_amount": "2",
  "nb_decimals_price": "2",
  "is_valid_from": "2015-09-18",
  "is_compact_view": "false",
  "show_position_taxes": false,
  "payment_type_id": "1"
}
Name Required Type Description
callback optional string
Name Required Type Description
account_id required Resource account
bank_account_id required Resource bank_account
currency_id required Resource currency
is_compact_view required boolean
is_valid_from required date (Format yyyy-mm-dd)
language_id required Resource language
logopaper_id required Resource logopaper
mwst_is_net required boolean This value affects the total if the field mwst_type has been set to 0.
false = Taxes are included in the total
true = Taxes will be added to the total
mwst_type required integer Possible values
0 = including taxes
1 = excluding taxes
2 = exempt from taxes
nb_decimals_amount required integer
nb_decimals_price required integer
payment_type_id required Resource payment_type
show_position_taxes required boolean
user_id required Resource user
amount optional decimal
api_reference optional string (80) This field can only be read and edited by the api. It can be used to save references to other systems.
contact_address_id optional Resource contact_address
contact_address_manual optional string (500)
contact_id optional Resource contact
contact_sub_id optional Resource contact
footer optional string (4000)
header optional string (4000)
info optional string
pr_project_id optional Resource pr_project
tax_id optional Resource tax
terms_of_payment_text optional string (2000)
title optional string (80)
viewed_by_client_at optional datetime (Format yyyy-mm-dd hh:ii:ss)

The following scopes are needed:

  • kb_expense_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Etag: 3b3b822de029f6845a035d95736a64dd
Content-Length: 652
Content-Type: application/json
{
  "id": 2,
  "document_nr": "00002",
  "title": "",
  "contact_id": 2,
  "contact_sub_id": null,
  "user_id": 1,
  "pr_project_id": null,
  "logopaper_id": 1,
  "language_id": 1,
  "bank_account_id": 1,
  "currency_id": 1,
  "mwst_type": 0,
  "mwst_is_net": true,
  "show_position_taxes": false,
  "is_valid_from": "2015-09-18",
  "is_valid_to": "2015-09-18",
  "kb_item_status_id": 33,
  "api_reference": "",
  "total_gross": "0",
  "total_net": "0",
  "total_taxes": "0.0000",
  "total_paid_payments": "0",
  "total_remaining_payments": "0.0000",
  "viewed_by_client_at": null,
  "total": "0",
  "updated_at": "2015-09-18 15:41:43",
  "taxs": [
    {
      "percentage": "8.00",
      "value": "0.0000"
    }
  ],
  "info": "",
  "allowable_bill": null,
  "account_id": 91,
  "tax_id": 6,
  "amount": "0"
}

Edit expense

POST /kb_expense/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "user_id": 1,
  "contact_id": 2
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
account_id optional Resource account
amount optional decimal
api_reference optional string (80) This field can only be read and edited by the api. It can be used to save references to other systems.
bank_account_id optional Resource bank_account
contact_address_id optional Resource contact_address
contact_address_manual optional string (500)
contact_id optional Resource contact
contact_sub_id optional Resource contact
currency_id optional Resource currency
footer optional string (4000)
header optional string (4000)
info optional string
is_compact_view optional boolean
is_valid_from optional date (Format yyyy-mm-dd)
language_id optional Resource language
logopaper_id optional Resource logopaper
mwst_is_net optional boolean This value affects the total if the field mwst_type has been set to 0.
false = Taxes are included in the total
true = Taxes will be added to the total
mwst_type optional integer Possible values
0 = including taxes
1 = excluding taxes
2 = exempt from taxes
nb_decimals_amount optional integer
nb_decimals_price optional integer
payment_type_id optional Resource payment_type
pr_project_id optional Resource pr_project
show_position_taxes optional boolean
tax_id optional Resource tax
terms_of_payment_text optional string (2000)
title optional string (80)
user_id optional Resource user
viewed_by_client_at optional datetime (Format yyyy-mm-dd hh:ii:ss)

The following scopes are needed:

  • kb_expense_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Etag: 0519b39478c0d3695f9c843fb673cce9
Content-Length: 652
Content-Type: application/json
{
  "id": 2,
  "document_nr": "00002",
  "title": "",
  "contact_id": 2,
  "contact_sub_id": null,
  "user_id": 1,
  "pr_project_id": null,
  "logopaper_id": 1,
  "language_id": 1,
  "bank_account_id": 1,
  "currency_id": 1,
  "mwst_type": 0,
  "mwst_is_net": true,
  "show_position_taxes": false,
  "is_valid_from": "2015-09-18",
  "is_valid_to": "2015-09-18",
  "kb_item_status_id": 33,
  "api_reference": "",
  "total_gross": "0",
  "total_net": "0",
  "total_taxes": "0.0000",
  "total_paid_payments": "0",
  "total_remaining_payments": "0.0000",
  "viewed_by_client_at": null,
  "total": "0",
  "updated_at": "2015-09-18 15:41:44",
  "taxs": [
    {
      "percentage": "8.00",
      "value": "0.0000"
    }
  ],
  "info": "",
  "allowable_bill": null,
  "account_id": 91,
  "tax_id": 6,
  "amount": "0"
}

Delete expense

DELETE /kb_expense/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_expense_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 16
Content-Type: application/json
{
  "success": true
}

List expense files

GET /kb_expense/1/file
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • 0

The following scopes are needed:

  • general
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 248
Content-Type: application/json
[
  {
    "id": 1,
    "name": "test",
    "size_in_bytes": 1073,
    "ext": "png",
    "mime_type": "image/png",
    "user_id": 1,
    "is_archived": true,
    "source_id": 2,
    "uploaded_at": "2015-09-18 15:41:45",
    "fm_file_references": [
      {
        "id": 1,
        "ref_class": "KbExpense",
        "ref_id": 1,
        "is_public": false
      }
    ]
  }
]

Show expense file

GET /kb_expense/1/file/1
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • general
Status: 200 OK
X-Authenticated-User: apiextract_1
Etag: 1f651236cfaa433ab1077406167c2ef6
Content-Length: 1717
Content-Type: application/json
{
  "id": 1,
  "name": "test",
  "size_in_bytes": 1073,
  "ext": "png",
  "mime_type": "image/png",
  "user_id": 1,
  "is_archived": true,
  "source_id": 2,
  "uploaded_at": "2015-09-18 15:41:45",
  "fm_file_references": [
    {
      "id": 1,
      "ref_class": "KbExpense",
      "ref_id": 1,
      "is_public": false
    }
  ],
  "data": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAfVQTFRFAAAAJUykJk2lJk6nJ1GrKFKsKFOuJUujJUykKVaxKVeyJUykKlm1Klq2K1y5LF+9LWHALmTDMWzNMm/RM3HUNHXZNXjcNXfbK1y4LWG/OmC1OF+0Q2e4bo7UaozZW4HVVHzSVHvRSXDINF+6YYLLbI/bPWvRNGbQQXDTQXDUNGjSN2rSQG3SOGTHY4jZNGXQNGbR8vb8NWrTNmvUNmzUOG3VM2bKRGe4bY/bNGfR8/b8N27VN2/WOHDXOHHYMGTEb47VNWvTNm3VNnDXNnHYN3LZN3PaOHTaNm/Ta43ZNGnT////K2rXLm7ZMHHaMXLbMnLbOXLaO2G1XILVMmbRKGDQIlzPJGHSMXHbNHbdN3reOHzfOHzgRX/fNmzMOWC1Vn3TLmLPHVbMHljOI1/RKGXUNnneOn/hPoPjP4XlQIblUY3kOnLQUXnQGlHKHFXMIFvPJWLTPIDiQYflRY3oR5DqSJHqYp3pPmfEHVTKHVfNIl7QJ2XULm3YQIflRo/pTJbtT5vvVZ/wZZ/nL1u4L17LKWfVL3DaRIzoS5btUp/xV6b1e7v1TInfL1zCJ1vOJGDSKmjWTpnvVqX0fMH6bq3vKlvGJmDSN3rfPoTkU5zvebn0bKvuKl/CK2bRNnDaQnzeT4rjX5roYp3mS4jeNWvMOXHPnP8CIAAAABp0Uk5TACCPz8+PIBCPjxDPzxCPII/Pz48gj88Qj4/gL0PbAAAAAWJLR0RLaQuFUAAAAAlwSFlzAAAASAAAAEgARslrPgAAAQRJREFUGNNjYAACRiZmKWkWVjYGCGDnkJGVk1dQVFLm5ALzuVVU1dQ1NLW0dXR5eIECHCp6+uoGhoZGxiamZnxA/eYW+uqWWoZW1ja2dnb2/AxMDmpAvqOTjbOLq5u7hwADs6e+gZaXt7e3j6+ff0CgIENQsHpIaFi4t3dEZFR0TGwcQ3xCYlJySqq3d1p6RmZWdg4DS25efkGhj7d3UXFJaVm5EANrRWVVdU2tt3ddfUNjU7MwA1tLa3JKW7u3d0dnV3dPrwgDA2df/4SJQFu8J02eMlUU6FIunmnTJ/rNmFk/a/YcMXGQZ3gl5s6bv2DhosVLRMWh/uWXFFy6TEhYBMQGANnsQSO08zbqAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTA5LTE4VDEzOjQxOjQ1KzAwOjAwsqrVhwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wOS0xOFQxMzo0MTo0NSswMDowMMP3bTsAAAAASUVORK5CYII="
}

Create expense file

POST /kb_expense/1/file
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "file": {
    "data": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC5ElEQVR42l2TS0wTURSG/3vvPNrS\nYlEwRh5CFFoeJg0LjVEjRInxhRETTdyoaxcU48K4Iew0RltM1ISFG1FjfCSa4E5hpRIESiJQIwQT\nQS1QC8VhSls63rlTGnGSm8k59z/f/c+ZuQT/PZXHu8sJIa0gtKFwY74vYxiIxfUQz/XxXGf4Rcu3\nf/UkV3jsoRuEtJcVF/prPSVIZ2QsammspFYBDtE0HXOxODRdD3Jdx/jT5oUcIFvcu2+Xx5fncmNk\nYhl6yoDLwYRkKZEBo4CdhwldQ1z7HeL6xrHHRxdI1naAF/upko+RST2LJXgXrBXuDl4Z53oi8pS/\nUysaEsux4Gj34TZi9rytuHCq2rsdH8Y0q1iIOeB2jQgPXf0iYpLNm09iaR7p1EoFqTrxKHCk0ecf\nmkwL22vFhPFFKV8Exlou9wYyqRXo8WiQVDU/GW46UO/rD+tWMbVEA/fqcpOuuxQGkygosyCmBxV8\nsPFIiOy92GNUVJQjPJ1Chm8tJw0k0waozPD1wU4BqL88ASZTDiHCkdmnixlYjEZB9lzoMUpLyxCe\nSSP2Z1XYllUGWWEY77KGuPvaFCQeSxK12uKMAtVAZGYexHPq2XCNt5K3kATlAlMoqxIUm4TPd70C\nsL/ju4Cae5RZgK1OA8PD0yHibXke2Fy0xT8VVQDGrNM5QOWAkTseAWi8/kMAFZ43W1F4K27oGAzN\nBon39Mty1eaYAtuEWNICCLFdRihQKQBNtyJQHTJUuyTgO4qAkaFZ/PylVYiPWn3mVUBRCvwJw4lV\n2bI/er963R052bUAm1NGVYmC+LyG9x9ng59uetoswNnXbkJZL2iBLy07IQkHvA3uwjzZlifD5VJQ\nVSpjKZ5E/yD/lQ2jceBG5ULuMtWce8MhtN1gDj9RNyDPYYfTKcGVL8Ptlvl4MojMJRCJpoJc12EW\nr7uNuZ/m/NtyLmglTGpQVbvPnHwilQnxuI+77BwM1K27zn8B3nT5NJn+m7gAAAAASUVORK5CYII=",
    "mime": "image/png",
    "filename": "test.png"
  }
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
file required array
{
"data": string,
"mime": string,
"filename": string
}

The following scopes are needed:

  • general
Status: 201 Created
X-Authenticated-User: apiextract_1
Etag: 1f651236cfaa433ab1077406167c2ef6
Content-Length: 1717
Content-Type: application/json
{
  "id": 1,
  "name": "test",
  "size_in_bytes": 1073,
  "ext": "png",
  "mime_type": "image/png",
  "user_id": 1,
  "is_archived": true,
  "source_id": 2,
  "uploaded_at": "2015-09-18 15:41:45",
  "fm_file_references": [
    {
      "id": 1,
      "ref_class": "KbExpense",
      "ref_id": 1,
      "is_public": false
    }
  ],
  "data": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAfVQTFRFAAAAJUykJk2lJk6nJ1GrKFKsKFOuJUujJUykKVaxKVeyJUykKlm1Klq2K1y5LF+9LWHALmTDMWzNMm/RM3HUNHXZNXjcNXfbK1y4LWG/OmC1OF+0Q2e4bo7UaozZW4HVVHzSVHvRSXDINF+6YYLLbI/bPWvRNGbQQXDTQXDUNGjSN2rSQG3SOGTHY4jZNGXQNGbR8vb8NWrTNmvUNmzUOG3VM2bKRGe4bY/bNGfR8/b8N27VN2/WOHDXOHHYMGTEb47VNWvTNm3VNnDXNnHYN3LZN3PaOHTaNm/Ta43ZNGnT////K2rXLm7ZMHHaMXLbMnLbOXLaO2G1XILVMmbRKGDQIlzPJGHSMXHbNHbdN3reOHzfOHzgRX/fNmzMOWC1Vn3TLmLPHVbMHljOI1/RKGXUNnneOn/hPoPjP4XlQIblUY3kOnLQUXnQGlHKHFXMIFvPJWLTPIDiQYflRY3oR5DqSJHqYp3pPmfEHVTKHVfNIl7QJ2XULm3YQIflRo/pTJbtT5vvVZ/wZZ/nL1u4L17LKWfVL3DaRIzoS5btUp/xV6b1e7v1TInfL1zCJ1vOJGDSKmjWTpnvVqX0fMH6bq3vKlvGJmDSN3rfPoTkU5zvebn0bKvuKl/CK2bRNnDaQnzeT4rjX5roYp3mS4jeNWvMOXHPnP8CIAAAABp0Uk5TACCPz8+PIBCPjxDPzxCPII/Pz48gj88Qj4/gL0PbAAAAAWJLR0RLaQuFUAAAAAlwSFlzAAAASAAAAEgARslrPgAAAQRJREFUGNNjYAACRiZmKWkWVjYGCGDnkJGVk1dQVFLm5ALzuVVU1dQ1NLW0dXR5eIECHCp6+uoGhoZGxiamZnxA/eYW+uqWWoZW1ja2dnb2/AxMDmpAvqOTjbOLq5u7hwADs6e+gZaXt7e3j6+ff0CgIENQsHpIaFi4t3dEZFR0TGwcQ3xCYlJySqq3d1p6RmZWdg4DS25efkGhj7d3UXFJaVm5EANrRWVVdU2tt3ddfUNjU7MwA1tLa3JKW7u3d0dnV3dPrwgDA2df/4SJQFu8J02eMlUU6FIunmnTJ/rNmFk/a/YcMXGQZ3gl5s6bv2DhosVLRMWh/uWXFFy6TEhYBMQGANnsQSO08zbqAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTA5LTE4VDEzOjQxOjQ1KzAwOjAwsqrVhwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0wOS0xOFQxMzo0MTo0NSswMDowMMP3bTsAAAAASUVORK5CYII="
}

delete expense file

DELETE /kb_expense/1/file/1
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • general
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 16
Content-Type: application/json
{
  "success": true
}