Crunch Expenses API Documentation

Overview

Version information

Version : 1

Tags

  • Attachments
  • ExpenseTypeController
  • ExpensesController
  • LedgerController
  • PaymentMethodController
  • PersonsController
  • SupplierController
  • VatTypeController

Paths

Create new expense

POST /

Parameters

Type Name Schema
Body body
optional
ExpenseDto

Responses

HTTP Code Description Schema
200 successful operation ExpenseDto
201 new expenses is created and put to the body of the response No Content

Tags

  • ExpensesController

Security

Type Name Scopes
Unknown oauth2-authorisation-code create:all

Example HTTP request

Request path
/
Request body
{
  "amount" : {
    "grossAmount" : 0.0,
    "netAmount" : 0.0,
    "vatAmount" : 0.0
  },
  "attachments" : [ {
    "fileContents" : "string",
    "fileName" : "string",
    "id" : 0
  } ],
  "createdBy" : "string",
  "createdByRecurringEvent" : true,
  "creditNotes" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "date" : "string",
    "id" : 0,
    "lineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "expenseLineItemIndex" : 0,
      "id" : 0
    } ],
    "refunds" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ]
  } ],
  "deletable" : true,
  "editable" : true,
  "expenseLedgerIsOpen" : true,
  "expenseLineItems" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "description" : "string",
    "employee" : {
      "displayableName" : "string",
      "forename" : "string",
      "id" : 0,
      "surname" : "string"
    },
    "expenseType" : "string",
    "id" : 0,
    "vatType" : "string"
  } ],
  "id" : 0,
  "note" : "string",
  "outstandingBalance" : 0.0,
  "postingDate" : "string",
  "recharged" : true,
  "rechargedClient" : {
    "id" : 0,
    "name" : "string"
  },
  "reconciled" : true,
  "recurringEvent" : {
    "description" : "string",
    "enabled" : true,
    "endDate" : "string",
    "frequencyOccurrence" : "string",
    "id" : 0,
    "nextOccurrenceDate" : "string",
    "occurrenceCount" : 0,
    "recurringEventEndType" : "string",
    "recurringEventFrequency" : "string"
  },
  "status" : "string",
  "supplier" : {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  },
  "supplierPayments" : [ {
    "amount" : 0.0,
    "date" : "string",
    "id" : 0,
    "paymentTarget" : {
      "bankAccount" : {
        "bankName" : "string",
        "defaultBankAccount" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "creditCard" : {
        "defaultCreditCard" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "paymentMethod" : {
        "paymentMethodDisplayableName" : "string",
        "paymentMethodName" : "string"
      },
      "person" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      }
    },
    "reconciled" : true
  } ],
  "supplierReference" : "string",
  "totalCreditsAmount" : 0.0,
  "totalRefundsAmount" : 0.0
}

Example HTTP response

Response 200
{
  "amount" : {
    "grossAmount" : 0.0,
    "netAmount" : 0.0,
    "vatAmount" : 0.0
  },
  "attachments" : [ {
    "fileContents" : "string",
    "fileName" : "string",
    "id" : 0
  } ],
  "createdBy" : "string",
  "createdByRecurringEvent" : true,
  "creditNotes" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "date" : "string",
    "id" : 0,
    "lineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "expenseLineItemIndex" : 0,
      "id" : 0
    } ],
    "refunds" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ]
  } ],
  "deletable" : true,
  "editable" : true,
  "expenseLedgerIsOpen" : true,
  "expenseLineItems" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "description" : "string",
    "employee" : {
      "displayableName" : "string",
      "forename" : "string",
      "id" : 0,
      "surname" : "string"
    },
    "expenseType" : "string",
    "id" : 0,
    "vatType" : "string"
  } ],
  "id" : 0,
  "note" : "string",
  "outstandingBalance" : 0.0,
  "postingDate" : "string",
  "recharged" : true,
  "rechargedClient" : {
    "id" : 0,
    "name" : "string"
  },
  "reconciled" : true,
  "recurringEvent" : {
    "description" : "string",
    "enabled" : true,
    "endDate" : "string",
    "frequencyOccurrence" : "string",
    "id" : 0,
    "nextOccurrenceDate" : "string",
    "occurrenceCount" : 0,
    "recurringEventEndType" : "string",
    "recurringEventFrequency" : "string"
  },
  "status" : "string",
  "supplier" : {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  },
  "supplierPayments" : [ {
    "amount" : 0.0,
    "date" : "string",
    "id" : 0,
    "paymentTarget" : {
      "bankAccount" : {
        "bankName" : "string",
        "defaultBankAccount" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "creditCard" : {
        "defaultCreditCard" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "paymentMethod" : {
        "paymentMethodDisplayableName" : "string",
        "paymentMethodName" : "string"
      },
      "person" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      }
    },
    "reconciled" : true
  } ],
  "supplierReference" : "string",
  "totalCreditsAmount" : 0.0,
  "totalRefundsAmount" : 0.0
}

Fetch all expenses

GET /

Description

The default sorting criteria is date,desc,id,desc.

Parameters

Type Name Description Schema Default
Query attachment
optional
enum (WITH_ATTACHMENTS, WITHOUT_ATTACHMENTS)
Query endDate
optional
string (date)
Query expenseType
optional
string
Query page
optional
The index of the page to retrieve, based at 0. integer (int32)
Query paymentEndDate
optional
string (date)
Query paymentMethod
optional
< enum (EFT, PPA, DEBIT_CARD, CREDIT_CARD, CHEQUE, CASH, DIRECTORS_EXPENSES) > array(multi)
Query paymentStartDate
optional
string (date)
Query size
optional
Number of records returned per page. Maximum value allowed is 20. integer (int32) 20
Query sort
optional
Sorting criteria by a given field. < string (<field>[,asc|desc]) > array(multi)
Query startDate
optional
string (date)
Query supplierId
optional
integer (int64)

Responses

HTTP Code Description Schema
200 expenses are gathered and put to the body of the response PageExpenseDto

Produces

  • application/json

Tags

  • ExpensesController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/

Example HTTP response

Response 200
{
  "content" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "attachments" : [ {
      "fileContents" : "string",
      "fileName" : "string",
      "id" : 0
    } ],
    "createdBy" : "string",
    "createdByRecurringEvent" : true,
    "creditNotes" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "date" : "string",
      "id" : 0,
      "lineItems" : [ {
        "amount" : {
          "grossAmount" : 0.0,
          "netAmount" : 0.0,
          "vatAmount" : 0.0
        },
        "description" : "string",
        "expenseLineItemIndex" : 0,
        "id" : 0
      } ],
      "refunds" : [ {
        "amount" : 0.0,
        "date" : "string",
        "id" : 0,
        "paymentTarget" : {
          "bankAccount" : {
            "bankName" : "string",
            "defaultBankAccount" : true,
            "displayableName" : "string",
            "id" : 0
          },
          "creditCard" : {
            "defaultCreditCard" : true,
            "displayableName" : "string",
            "id" : 0
          },
          "paymentMethod" : {
            "paymentMethodDisplayableName" : "string",
            "paymentMethodName" : "string"
          },
          "person" : {
            "displayableName" : "string",
            "forename" : "string",
            "id" : 0,
            "surname" : "string"
          }
        },
        "reconciled" : true
      } ]
    } ],
    "deletable" : true,
    "editable" : true,
    "expenseLedgerIsOpen" : true,
    "expenseLineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "employee" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      },
      "expenseType" : "string",
      "id" : 0,
      "vatType" : "string"
    } ],
    "id" : 0,
    "note" : "string",
    "outstandingBalance" : 0.0,
    "postingDate" : "string",
    "recharged" : true,
    "rechargedClient" : {
      "id" : 0,
      "name" : "string"
    },
    "reconciled" : true,
    "recurringEvent" : {
      "description" : "string",
      "enabled" : true,
      "endDate" : "string",
      "frequencyOccurrence" : "string",
      "id" : 0,
      "nextOccurrenceDate" : "string",
      "occurrenceCount" : 0,
      "recurringEventEndType" : "string",
      "recurringEventFrequency" : "string"
    },
    "status" : "string",
    "supplier" : {
      "companyName" : "string",
      "contactName" : "string",
      "country" : "string",
      "deletable" : true,
      "expenseType" : {
        "assignable" : true,
        "defaultVatType" : "string",
        "deprecated" : true,
        "dormantAllowable" : true,
        "expenseTypeDisplayableName" : "string",
        "expenseTypeName" : "string"
      },
      "id" : 0,
      "vatRegistrationNumber" : "string"
    },
    "supplierPayments" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ],
    "supplierReference" : "string",
    "totalCreditsAmount" : 0.0,
    "totalRefundsAmount" : 0.0
  } ],
  "empty" : true,
  "first" : true,
  "last" : true,
  "number" : 0,
  "numberOfElements" : 0,
  "pageable" : {
    "offset" : 0,
    "pageNumber" : 0,
    "pageSize" : 0,
    "paged" : true,
    "sort" : {
      "empty" : true,
      "sorted" : true,
      "unsorted" : true
    },
    "unpaged" : true
  },
  "size" : 0,
  "sort" : {
    "empty" : true,
    "sorted" : true,
    "unsorted" : true
  },
  "totalElements" : 0,
  "totalPages" : 0
}

Download expense attachment

GET /attachments

Parameters

Type Name Schema
Query attachmentId
required
integer (int64)
Query expenseId
required
integer (int64)
Query fileName
required
string

Responses

HTTP Code Description Schema
200 returns the raw content of an attachment attached to an expense < string (byte) > array

Tags

  • Attachments

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/attachments?attachmentId=0&expenseId=0&fileName=string

Example HTTP response

Response 200
[ "string" ]

Fetch all expense types

GET /expense-types/all

Responses

HTTP Code Description Schema
200 Fetch all expense types ExpenseTypesDto

Tags

  • ExpenseTypeController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/expense-types/all

Example HTTP response

Response 200
{
  "count" : 0,
  "expenseGroups" : [ {
    "count" : 0,
    "expenseTypes" : [ {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    } ],
    "groupName" : "string"
  } ]
}

Fetch open accounting periods

GET /ledgers

Responses

HTTP Code Description Schema
200 opened accounting periods are gathered and put to the body of the response < AccountingPeriodDto > array

Tags

  • LedgerController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/ledgers

Example HTTP response

Response 200
[ null ]

Fetch all payment methods

GET /payment-methods

Responses

HTTP Code Description Schema
200 Fetch all payment methods PaymentMethodsDto

Tags

  • PaymentMethodController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/payment-methods

Example HTTP response

Response 200
{
  "paymentMethods" : [ {
    "paymentMethodDisplayableName" : "string",
    "paymentMethodName" : "string"
  } ]
}

GET /persons

Parameters

Type Name Schema
Query date
required
string (date)
Query role
optional
string

Responses

HTTP Code Description Schema
200 persons related to current client id < PersonDto > array

Tags

  • PersonsController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/persons?date=string

Example HTTP response

Response 200
[ {
  "displayableName" : "string",
  "forename" : "string",
  "id" : 0,
  "surname" : "string"
} ]

Create new supplier

POST /suppliers

Parameters

Type Name Schema
Body body
optional
SupplierDto

Responses

HTTP Code Description Schema
200 successful operation SupplierDto
201 new supplier is created and put to the body of the response No Content

Tags

  • SupplierController

Security

Type Name Scopes
Unknown oauth2-authorisation-code create:all

Example HTTP request

Request path
/suppliers
Request body
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Example HTTP response

Response 200
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Get list of suppliers.

GET /suppliers

Description

The default sorting criterion is companyName,asc.

Parameters

Type Name Description Schema Default
Query page
optional
The index of the page to retrieve, based at 0. integer (int32)
Query size
optional
Number of records returned per page. Maximum value allowed is 20. integer (int32) 20
Query sort
optional
Sorting criteria by a given field. < string (<field>[,asc|desc]) > array(multi)
Query supplierName
optional
If provided, only the supplier with the given company name is returned string

Responses

HTTP Code Description Schema
200 a pageable list of suppliers PageSupplierDto

Produces

  • application/json

Tags

  • SupplierController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/suppliers

Example HTTP response

Response 200
{
  "content" : [ {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  } ],
  "empty" : true,
  "first" : true,
  "last" : true,
  "number" : 0,
  "numberOfElements" : 0,
  "pageable" : {
    "offset" : 0,
    "pageNumber" : 0,
    "pageSize" : 0,
    "paged" : true,
    "sort" : {
      "empty" : true,
      "sorted" : true,
      "unsorted" : true
    },
    "unpaged" : true
  },
  "size" : 0,
  "sort" : {
    "empty" : true,
    "sorted" : true,
    "unsorted" : true
  },
  "totalElements" : 0,
  "totalPages" : 0
}

Get supplier by id

GET /suppliers/{supplierId}

Parameters

Type Name Schema
Path supplierId
required
integer (int64)

Responses

HTTP Code Description Schema
200 The supplier is successfully fetched SupplierDto
400 Supplier cannot be received No Content
404 The supplier not found and cannot be received No Content

Tags

  • SupplierController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/suppliers/0

Example HTTP response

Response 200
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Update an existing supplier

PUT /suppliers/{supplierId}

Parameters

Type Name Schema
Path supplierId
required
integer (int64)
Body body
optional
SupplierDto

Responses

HTTP Code Description Schema
200 The supplier is successfully updated SupplierDto
404 The supplier not found and cannot be updated No Content

Tags

  • SupplierController

Security

Type Name Scopes
Unknown oauth2-authorisation-code update:all

Example HTTP request

Request path
/suppliers/0
Request body
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Example HTTP response

Response 200
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Delete supplier by its ID

DELETE /suppliers/{supplierId}

Parameters

Type Name Schema
Path supplierId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Supplier is successfully deleted SupplierDto

Tags

  • SupplierController

Security

Type Name Scopes
Unknown oauth2-authorisation-code delete:all

Example HTTP request

Request path
/suppliers/0

Example HTTP response

Response 200
{
  "companyName" : "string",
  "contactName" : "string",
  "country" : "string",
  "deletable" : true,
  "expenseType" : {
    "assignable" : true,
    "defaultVatType" : "string",
    "deprecated" : true,
    "dormantAllowable" : true,
    "expenseTypeDisplayableName" : "string",
    "expenseTypeName" : "string"
  },
  "id" : 0,
  "vatRegistrationNumber" : "string"
}

Fetch all VAT types

GET /vat-types

Responses

HTTP Code Description Schema
200 Fetch all VAT types VatTypesDto

Tags

  • VatTypeController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/vat-types

Example HTTP response

Response 200
{
  "vatTypes" : [ {
    "name" : "string",
    "vatPercent" : 0
  } ]
}

Get expense by id

GET /{expenseId}

Parameters

Type Name Schema
Path expenseId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Expense is successfully fetched ExpenseDto
400 Expense cannot be received No Content
404 Expense not found and cannot be received No Content

Tags

  • ExpensesController

Security

Type Name Scopes
Unknown oauth2-authorisation-code read:all

Example HTTP request

Request path
/0

Example HTTP response

Response 200
{
  "amount" : {
    "grossAmount" : 0.0,
    "netAmount" : 0.0,
    "vatAmount" : 0.0
  },
  "attachments" : [ {
    "fileContents" : "string",
    "fileName" : "string",
    "id" : 0
  } ],
  "createdBy" : "string",
  "createdByRecurringEvent" : true,
  "creditNotes" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "date" : "string",
    "id" : 0,
    "lineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "expenseLineItemIndex" : 0,
      "id" : 0
    } ],
    "refunds" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ]
  } ],
  "deletable" : true,
  "editable" : true,
  "expenseLedgerIsOpen" : true,
  "expenseLineItems" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "description" : "string",
    "employee" : {
      "displayableName" : "string",
      "forename" : "string",
      "id" : 0,
      "surname" : "string"
    },
    "expenseType" : "string",
    "id" : 0,
    "vatType" : "string"
  } ],
  "id" : 0,
  "note" : "string",
  "outstandingBalance" : 0.0,
  "postingDate" : "string",
  "recharged" : true,
  "rechargedClient" : {
    "id" : 0,
    "name" : "string"
  },
  "reconciled" : true,
  "recurringEvent" : {
    "description" : "string",
    "enabled" : true,
    "endDate" : "string",
    "frequencyOccurrence" : "string",
    "id" : 0,
    "nextOccurrenceDate" : "string",
    "occurrenceCount" : 0,
    "recurringEventEndType" : "string",
    "recurringEventFrequency" : "string"
  },
  "status" : "string",
  "supplier" : {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  },
  "supplierPayments" : [ {
    "amount" : 0.0,
    "date" : "string",
    "id" : 0,
    "paymentTarget" : {
      "bankAccount" : {
        "bankName" : "string",
        "defaultBankAccount" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "creditCard" : {
        "defaultCreditCard" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "paymentMethod" : {
        "paymentMethodDisplayableName" : "string",
        "paymentMethodName" : "string"
      },
      "person" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      }
    },
    "reconciled" : true
  } ],
  "supplierReference" : "string",
  "totalCreditsAmount" : 0.0,
  "totalRefundsAmount" : 0.0
}

Update an existing expense

PUT /{expenseId}

Parameters

Type Name Schema
Path expenseId
required
integer (int64)
Body body
optional
ExpenseDto

Responses

HTTP Code Description Schema
200 Expense is successfully updated ExpenseDto
404 Expense not found and cannot be updated No Content

Tags

  • ExpensesController

Security

Type Name Scopes
Unknown oauth2-authorisation-code update:all

Example HTTP request

Request path
/0
Request body
{
  "amount" : {
    "grossAmount" : 0.0,
    "netAmount" : 0.0,
    "vatAmount" : 0.0
  },
  "attachments" : [ {
    "fileContents" : "string",
    "fileName" : "string",
    "id" : 0
  } ],
  "createdBy" : "string",
  "createdByRecurringEvent" : true,
  "creditNotes" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "date" : "string",
    "id" : 0,
    "lineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "expenseLineItemIndex" : 0,
      "id" : 0
    } ],
    "refunds" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ]
  } ],
  "deletable" : true,
  "editable" : true,
  "expenseLedgerIsOpen" : true,
  "expenseLineItems" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "description" : "string",
    "employee" : {
      "displayableName" : "string",
      "forename" : "string",
      "id" : 0,
      "surname" : "string"
    },
    "expenseType" : "string",
    "id" : 0,
    "vatType" : "string"
  } ],
  "id" : 0,
  "note" : "string",
  "outstandingBalance" : 0.0,
  "postingDate" : "string",
  "recharged" : true,
  "rechargedClient" : {
    "id" : 0,
    "name" : "string"
  },
  "reconciled" : true,
  "recurringEvent" : {
    "description" : "string",
    "enabled" : true,
    "endDate" : "string",
    "frequencyOccurrence" : "string",
    "id" : 0,
    "nextOccurrenceDate" : "string",
    "occurrenceCount" : 0,
    "recurringEventEndType" : "string",
    "recurringEventFrequency" : "string"
  },
  "status" : "string",
  "supplier" : {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  },
  "supplierPayments" : [ {
    "amount" : 0.0,
    "date" : "string",
    "id" : 0,
    "paymentTarget" : {
      "bankAccount" : {
        "bankName" : "string",
        "defaultBankAccount" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "creditCard" : {
        "defaultCreditCard" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "paymentMethod" : {
        "paymentMethodDisplayableName" : "string",
        "paymentMethodName" : "string"
      },
      "person" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      }
    },
    "reconciled" : true
  } ],
  "supplierReference" : "string",
  "totalCreditsAmount" : 0.0,
  "totalRefundsAmount" : 0.0
}

Example HTTP response

Response 200
{
  "amount" : {
    "grossAmount" : 0.0,
    "netAmount" : 0.0,
    "vatAmount" : 0.0
  },
  "attachments" : [ {
    "fileContents" : "string",
    "fileName" : "string",
    "id" : 0
  } ],
  "createdBy" : "string",
  "createdByRecurringEvent" : true,
  "creditNotes" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "date" : "string",
    "id" : 0,
    "lineItems" : [ {
      "amount" : {
        "grossAmount" : 0.0,
        "netAmount" : 0.0,
        "vatAmount" : 0.0
      },
      "description" : "string",
      "expenseLineItemIndex" : 0,
      "id" : 0
    } ],
    "refunds" : [ {
      "amount" : 0.0,
      "date" : "string",
      "id" : 0,
      "paymentTarget" : {
        "bankAccount" : {
          "bankName" : "string",
          "defaultBankAccount" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "creditCard" : {
          "defaultCreditCard" : true,
          "displayableName" : "string",
          "id" : 0
        },
        "paymentMethod" : {
          "paymentMethodDisplayableName" : "string",
          "paymentMethodName" : "string"
        },
        "person" : {
          "displayableName" : "string",
          "forename" : "string",
          "id" : 0,
          "surname" : "string"
        }
      },
      "reconciled" : true
    } ]
  } ],
  "deletable" : true,
  "editable" : true,
  "expenseLedgerIsOpen" : true,
  "expenseLineItems" : [ {
    "amount" : {
      "grossAmount" : 0.0,
      "netAmount" : 0.0,
      "vatAmount" : 0.0
    },
    "description" : "string",
    "employee" : {
      "displayableName" : "string",
      "forename" : "string",
      "id" : 0,
      "surname" : "string"
    },
    "expenseType" : "string",
    "id" : 0,
    "vatType" : "string"
  } ],
  "id" : 0,
  "note" : "string",
  "outstandingBalance" : 0.0,
  "postingDate" : "string",
  "recharged" : true,
  "rechargedClient" : {
    "id" : 0,
    "name" : "string"
  },
  "reconciled" : true,
  "recurringEvent" : {
    "description" : "string",
    "enabled" : true,
    "endDate" : "string",
    "frequencyOccurrence" : "string",
    "id" : 0,
    "nextOccurrenceDate" : "string",
    "occurrenceCount" : 0,
    "recurringEventEndType" : "string",
    "recurringEventFrequency" : "string"
  },
  "status" : "string",
  "supplier" : {
    "companyName" : "string",
    "contactName" : "string",
    "country" : "string",
    "deletable" : true,
    "expenseType" : {
      "assignable" : true,
      "defaultVatType" : "string",
      "deprecated" : true,
      "dormantAllowable" : true,
      "expenseTypeDisplayableName" : "string",
      "expenseTypeName" : "string"
    },
    "id" : 0,
    "vatRegistrationNumber" : "string"
  },
  "supplierPayments" : [ {
    "amount" : 0.0,
    "date" : "string",
    "id" : 0,
    "paymentTarget" : {
      "bankAccount" : {
        "bankName" : "string",
        "defaultBankAccount" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "creditCard" : {
        "defaultCreditCard" : true,
        "displayableName" : "string",
        "id" : 0
      },
      "paymentMethod" : {
        "paymentMethodDisplayableName" : "string",
        "paymentMethodName" : "string"
      },
      "person" : {
        "displayableName" : "string",
        "forename" : "string",
        "id" : 0,
        "surname" : "string"
      }
    },
    "reconciled" : true
  } ],
  "supplierReference" : "string",
  "totalCreditsAmount" : 0.0,
  "totalRefundsAmount" : 0.0
}

Delete an expense

DELETE /{expenseId}

Parameters

Type Name Schema
Path expenseId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Expense is successfully deleted No Content
400 Expense cannot be deleted No Content

Tags

  • ExpensesController

Security

Type Name Scopes
Unknown oauth2-authorisation-code delete:all

Example HTTP request

Request path
/0

Definitions

AmountDto

Name Description Schema
grossAmount
optional
Example : 0.0 number
netAmount
optional
Example : 0.0 number
vatAmount
optional
Example : 0.0 number

AttachmentDto

Name Description Schema
fileContents
optional
Example : "string" string
fileName
optional
Example : "string" string
id
optional
Example : 0 integer (int64)

BankAccountDto

Name Description Schema
bankName
optional
Length : 0 - 50
Example : "string"
string
defaultBankAccount
optional
Example : true boolean
displayableName
optional
Example : "string" string
id
optional
Example : 0 integer (int64)

CreditCardDto

Name Description Schema
defaultCreditCard
optional
Example : true boolean
displayableName
optional
Example : "string" string
id
optional
Example : 0 integer (int64)

CreditNoteDto

Name Description Schema
amount
optional
Example : "[amountdto](#amountdto)" AmountDto
date
optional
Example : "string" string (date)
id
optional
Example : 0 integer (int64)
lineItems
optional
Example : [ "[creditnotelineitemdto](#creditnotelineitemdto)" ] < CreditNoteLineItemDto > array
refunds
optional
Example : [ "[supplierpaymentdto](#supplierpaymentdto)" ] < SupplierPaymentDto > array

CreditNoteLineItemDto

Name Description Schema
amount
optional
Example : "[amountdto](#amountdto)" AmountDto
description
optional
Example : "string" string
expenseLineItemIndex
optional
Example : 0 integer (int32)
id
optional
Example : 0 integer (int64)

ExpenseDto

Name Description Schema
amount
optional
Example : "[amountdto](#amountdto)" AmountDto
attachments
optional
Example : [ "[attachmentdto](#attachmentdto)" ] < AttachmentDto > array
createdBy
optional
Example : "string" string
createdByRecurringEvent
optional
Example : true boolean
creditNotes
optional
Example : [ "[creditnotedto](#creditnotedto)" ] < CreditNoteDto > array
deletable
optional
Example : true boolean
editable
optional
Example : true boolean
expenseLedgerIsOpen
optional
Example : true boolean
expenseLineItems
optional
Example : [ "[expenselineitemdto](#expenselineitemdto)" ] < ExpenseLineItemDto > array
id
optional
Example : 0 integer (int64)
note
optional
Example : "string" string
outstandingBalance
optional
Example : 0.0 number
postingDate
optional
Example : "string" string (date)
recharged
optional
Example : true boolean
rechargedClient
optional
Example : "[rechargedclientdto](#rechargedclientdto)" RechargedClientDto
reconciled
optional
Example : true boolean
recurringEvent
optional
Example : "[recurringeventdto](#recurringeventdto)" RecurringEventDto
status
optional
Example : "string" string
supplier
optional
Example : "[supplierdto](#supplierdto)" SupplierDto
supplierPayments
optional
Example : [ "[supplierpaymentdto](#supplierpaymentdto)" ] < SupplierPaymentDto > array
supplierReference
optional
Example : "string" string
totalCreditsAmount
optional
Example : 0.0 number
totalRefundsAmount
optional
Example : 0.0 number

ExpenseLineItemDto

Name Description Schema
amount
optional
Example : "[amountdto](#amountdto)" AmountDto
description
optional
Example : "string" string
employee
optional
Example : "[persondto](#persondto)" PersonDto
expenseType
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
vatType
optional
Example : "string" string

ExpenseTypeDto

Name Description Schema
assignable
optional
Example : true boolean
defaultVatType
optional
Example : "string" string
deprecated
optional
Example : true boolean
dormantAllowable
optional
Example : true boolean
expenseTypeDisplayableName
optional
Example : "string" string
expenseTypeName
optional
Example : "string" string

ExpenseTypeGroupDto

Name Description Schema
count
optional
Example : 0 integer (int32)
expenseTypes
optional
Example : [ "[expensetypedto](#expensetypedto)" ] < ExpenseTypeDto > array
groupName
optional
Example : "string" string

ExpenseTypesDto

Name Description Schema
count
optional
Example : 0 integer (int32)
expenseGroups
optional
Example : [ "[expensetypegroupdto](#expensetypegroupdto)" ] < ExpenseTypeGroupDto > array

PageExpenseDto

Name Description Schema
content
optional
Example : [ "[expensedto](#expensedto)" ] < ExpenseDto > array
empty
optional
Example : true boolean
first
optional
Example : true boolean
last
optional
Example : true boolean
number
optional
Example : 0 integer (int32)
numberOfElements
optional
Example : 0 integer (int32)
pageable
optional
Example : "[pageable](#pageable)" Pageable
size
optional
Example : 0 integer (int32)
sort
optional
Example : "[sort](#sort)" Sort
totalElements
optional
Example : 0 integer (int64)
totalPages
optional
Example : 0 integer (int32)

PageSupplierDto

Name Description Schema
content
optional
Example : [ "[supplierdto](#supplierdto)" ] < SupplierDto > array
empty
optional
Example : true boolean
first
optional
Example : true boolean
last
optional
Example : true boolean
number
optional
Example : 0 integer (int32)
numberOfElements
optional
Example : 0 integer (int32)
pageable
optional
Example : "[pageable](#pageable)" Pageable
size
optional
Example : 0 integer (int32)
sort
optional
Example : "[sort](#sort)" Sort
totalElements
optional
Example : 0 integer (int64)
totalPages
optional
Example : 0 integer (int32)

Pageable

Name Description Schema
offset
optional
Example : 0 integer (int64)
pageNumber
optional
Example : 0 integer (int32)
pageSize
optional
Example : 0 integer (int32)
paged
optional
Example : true boolean
sort
optional
Example : "[sort](#sort)" Sort
unpaged
optional
Example : true boolean

PaymentMethodDto

Name Description Schema
paymentMethodDisplayableName
optional
Example : "string" string
paymentMethodName
optional
Example : "string" string

PaymentMethodsDto

Name Description Schema
paymentMethods
optional
Example : [ "[paymentmethoddto](#paymentmethoddto)" ] < PaymentMethodDto > array

PaymentTargetDto

Name Description Schema
bankAccount
optional
Example : "[bankaccountdto](#bankaccountdto)" BankAccountDto
creditCard
optional
Example : "[creditcarddto](#creditcarddto)" CreditCardDto
paymentMethod
optional
Example : "[paymentmethoddto](#paymentmethoddto)" PaymentMethodDto
person
optional
Example : "[persondto](#persondto)" PersonDto

PersonDto

Name Description Schema
displayableName
optional
Example : "string" string
forename
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
surname
optional
Example : "string" string

RechargedClientDto

Name Description Schema
id
optional
Example : 0 integer (int64)
name
optional
Example : "string" string

RecurringEventDto

Name Description Schema
description
optional
Example : "string" string
enabled
optional
Example : true boolean
endDate
optional
Example : "string" string (date)
frequencyOccurrence
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
nextOccurrenceDate
optional
Example : "string" string (date)
occurrenceCount
optional
Example : 0 integer (int32)
recurringEventEndType
optional
Example : "string" string
recurringEventFrequency
optional
Example : "string" string

Sort

Name Description Schema
empty
optional
Example : true boolean
sorted
optional
Example : true boolean
unsorted
optional
Example : true boolean

SupplierDto

Name Description Schema
companyName
optional
Example : "string" string
contactName
optional
Example : "string" string
country
optional
Example : "string" string
deletable
optional
Example : true boolean
expenseType
optional
Example : "[expensetypedto](#expensetypedto)" ExpenseTypeDto
id
optional
Example : 0 integer (int64)
vatRegistrationNumber
optional
Example : "string" string

SupplierPaymentDto

Name Description Schema
amount
optional
Example : 0.0 number
date
optional
Example : "string" string (date)
id
optional
Example : 0 integer (int64)
paymentTarget
optional
Example : "[paymenttargetdto](#paymenttargetdto)" PaymentTargetDto
reconciled
optional
Example : true boolean

VatTypeDto

Name Description Schema
name
optional
Example : "string" string
vatPercent
optional
Example : 0 integer (int32)

VatTypesDto

Name Description Schema
vatTypes
optional
Example : [ "[vattypedto](#vattypedto)" ] < VatTypeDto > array