POST api/v1/Expenses?token={token}&inCaseOfErrorReturnHttpCode={inCaseOfErrorReturnHttpCode}

Request Information

URI Parameters

NameDescriptionType/Additional information
token

Optional. You can semd the token in the URL or pass it in the Headers as "Caspit-Token"

string
inCaseOfErrorReturnHttpCode

Optional. In case of error caspit will return 400 - Bad Request,
but you can ask Caspit to return any valid HTTP code (e.g. 200 - OK) and handle the error.

HttpStatusCode

Default value is BadRequest

Body Parameters

The expense details

CaspitExpense

Represents an expense הוצאה

Request Formats

application/json, text/json

Sample:
{
  "Payments": [
    {
      "ExpensePaymentId": "sample string 1",
      "PaymentDate": "2024-11-21T15:02:32.4562253+02:00",
      "PaymentDetails": "sample string 2",
      "TotalPaid": 1.0,
      "PaymentMethodNumber": "sample string 3",
      "BankAccountId": "sample string 4",
      "DateCreated": "2024-11-21T15:02:32.4571695+02:00",
      "UserCreated": "sample string 5",
      "DateUpdated": "2024-11-21T15:02:32.4571695+02:00",
      "UserUpdated": "sample string 6"
    },
    {
      "ExpensePaymentId": "sample string 1",
      "PaymentDate": "2024-11-21T15:02:32.4562253+02:00",
      "PaymentDetails": "sample string 2",
      "TotalPaid": 1.0,
      "PaymentMethodNumber": "sample string 3",
      "BankAccountId": "sample string 4",
      "DateCreated": "2024-11-21T15:02:32.4571695+02:00",
      "UserCreated": "sample string 5",
      "DateUpdated": "2024-11-21T15:02:32.4571695+02:00",
      "UserUpdated": "sample string 6"
    }
  ],
  "ExpenseId": "sample string 1",
  "Number": 1,
  "PortionNumber": 2,
  "Date": "2024-11-21T15:02:32.4532238+02:00",
  "TrxCode": "sample string 4",
  "TrxCodeNumber": 5,
  "OsekMorshe": "sample string 6",
  "SupplierName": "sample string 7",
  "SupplierId": "sample string 8",
  "Details": "sample string 9",
  "Reference": "sample string 10",
  "Total": 11.0,
  "TotalNoVat": 12.0,
  "Vat": 13.0,
  "VatRate": 14.0,
  "Status": 15,
  "WorkingFromHomePercentageAllowed": 16.0,
  "ImageFileName": "sample string 17",
  "ImageFile": "QEA=",
  "Flag": 1,
  "AllocationNumber": "sample string 18",
  "DateCreated": "2024-11-21T15:02:32.4562253+02:00",
  "UserCreated": "sample string 19",
  "DateUpdated": "2024-11-21T15:02:32.4562253+02:00",
  "UserUpdated": "sample string 20"
}

application/xml, text/xml

Sample:
<CaspitExpense xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.caspit.biz/2013/03">
  <DateCreated>2024-11-21T15:02:32.4562253+02:00</DateCreated>
  <DateUpdated>2024-11-21T15:02:32.4562253+02:00</DateUpdated>
  <UserCreated>sample string 19</UserCreated>
  <UserUpdated>sample string 20</UserUpdated>
  <AllocationNumber>sample string 18</AllocationNumber>
  <Date>2024-11-21T15:02:32.4532238+02:00</Date>
  <Details>sample string 9</Details>
  <ExpenseId>sample string 1</ExpenseId>
  <Flag>1</Flag>
  <ImageFile>QEA=</ImageFile>
  <ImageFileName>sample string 17</ImageFileName>
  <Number>1</Number>
  <OsekMorshe>sample string 6</OsekMorshe>
  <Payments>
    <CaspitExpensePayment>
      <DateCreated>2024-11-21T15:02:32.4571695+02:00</DateCreated>
      <DateUpdated>2024-11-21T15:02:32.4571695+02:00</DateUpdated>
      <UserCreated>sample string 5</UserCreated>
      <UserUpdated>sample string 6</UserUpdated>
      <BankAccountId>sample string 4</BankAccountId>
      <ExpensePaymentId>sample string 1</ExpensePaymentId>
      <PaymentDate>2024-11-21T15:02:32.4562253+02:00</PaymentDate>
      <PaymentDetails>sample string 2</PaymentDetails>
      <PaymentMethodNumber>sample string 3</PaymentMethodNumber>
      <TotalPaid>1</TotalPaid>
    </CaspitExpensePayment>
    <CaspitExpensePayment>
      <DateCreated>2024-11-21T15:02:32.4571695+02:00</DateCreated>
      <DateUpdated>2024-11-21T15:02:32.4571695+02:00</DateUpdated>
      <UserCreated>sample string 5</UserCreated>
      <UserUpdated>sample string 6</UserUpdated>
      <BankAccountId>sample string 4</BankAccountId>
      <ExpensePaymentId>sample string 1</ExpensePaymentId>
      <PaymentDate>2024-11-21T15:02:32.4562253+02:00</PaymentDate>
      <PaymentDetails>sample string 2</PaymentDetails>
      <PaymentMethodNumber>sample string 3</PaymentMethodNumber>
      <TotalPaid>1</TotalPaid>
    </CaspitExpensePayment>
  </Payments>
  <PortionNumber>2</PortionNumber>
  <Reference>sample string 10</Reference>
  <Status>15</Status>
  <SupplierId>sample string 8</SupplierId>
  <SupplierName>sample string 7</SupplierName>
  <Total>11</Total>
  <TotalNoVat>12</TotalNoVat>
  <TrxCode>sample string 4</TrxCode>
  <TrxCodeNumber>5</TrxCodeNumber>
  <Vat>13</Vat>
  <VatRate>14</VatRate>
  <WorkingFromHomePercentageAllowed>16</WorkingFromHomePercentageAllowed>
</CaspitExpense>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Description

HttpResponseMessage