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": "2022-10-07T00:26:24.4247417+03:00",
      "PaymentDetails": "sample string 2",
      "TotalPaid": 1.0,
      "PaymentMethodNumber": "sample string 3",
      "BankAccountId": "sample string 4",
      "DateCreated": "2022-10-07T00:26:24.4247417+03:00",
      "UserCreated": "sample string 5",
      "DateUpdated": "2022-10-07T00:26:24.4247417+03:00",
      "UserUpdated": "sample string 6"
    },
    {
      "ExpensePaymentId": "sample string 1",
      "PaymentDate": "2022-10-07T00:26:24.4247417+03:00",
      "PaymentDetails": "sample string 2",
      "TotalPaid": 1.0,
      "PaymentMethodNumber": "sample string 3",
      "BankAccountId": "sample string 4",
      "DateCreated": "2022-10-07T00:26:24.4247417+03:00",
      "UserCreated": "sample string 5",
      "DateUpdated": "2022-10-07T00:26:24.4247417+03:00",
      "UserUpdated": "sample string 6"
    }
  ],
  "ExpenseId": "sample string 1",
  "Number": 1,
  "PortionNumber": 2,
  "Date": "2022-10-07T00:26:24.4247417+03: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,
  "DateCreated": "2022-10-07T00:26:24.4247417+03:00",
  "UserCreated": "sample string 18",
  "DateUpdated": "2022-10-07T00:26:24.4247417+03:00",
  "UserUpdated": "sample string 19"
}

application/xml, text/xml

Sample:
<CaspitExpense xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.caspit.biz/2013/03">
  <DateCreated>2022-10-07T00:26:24.4247417+03:00</DateCreated>
  <DateUpdated>2022-10-07T00:26:24.4247417+03:00</DateUpdated>
  <UserCreated>sample string 18</UserCreated>
  <UserUpdated>sample string 19</UserUpdated>
  <Date>2022-10-07T00:26:24.4247417+03: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>2022-10-07T00:26:24.4247417+03:00</DateCreated>
      <DateUpdated>2022-10-07T00:26:24.4247417+03:00</DateUpdated>
      <UserCreated>sample string 5</UserCreated>
      <UserUpdated>sample string 6</UserUpdated>
      <BankAccountId>sample string 4</BankAccountId>
      <ExpensePaymentId>sample string 1</ExpensePaymentId>
      <PaymentDate>2022-10-07T00:26:24.4247417+03:00</PaymentDate>
      <PaymentDetails>sample string 2</PaymentDetails>
      <PaymentMethodNumber>sample string 3</PaymentMethodNumber>
      <TotalPaid>1</TotalPaid>
    </CaspitExpensePayment>
    <CaspitExpensePayment>
      <DateCreated>2022-10-07T00:26:24.4247417+03:00</DateCreated>
      <DateUpdated>2022-10-07T00:26:24.4247417+03:00</DateUpdated>
      <UserCreated>sample string 5</UserCreated>
      <UserUpdated>sample string 6</UserUpdated>
      <BankAccountId>sample string 4</BankAccountId>
      <ExpensePaymentId>sample string 1</ExpensePaymentId>
      <PaymentDate>2022-10-07T00:26:24.4247417+03: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