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

Create a new document

Request Information

URI Parameters

NameDescriptionType/Additional information
token

The login token. You can pass the token in the query string or in a header called Caspit-Token

string
inCaseOfErrorReturnHttpCode

קוד ה-HTTP שיוחזר במקרה של שגיאה. ברירת המחדל היא 400 אבל אתה יכול לשלוח קוד אחר אם יש לך צורך כזה.

HttpStatusCode

Default value is BadRequest

Body Parameters

הנתונים של המסמך החדש

CaspitDocument

Represents a Caspit document (e.g. חשבונית מס, חש/קבלה, קבלה, תעודת משלוח) An invoice will only have DocumentLines, a receipt will only have ReceiptLines, a חש/קבלה will have both

Request Formats

application/json, text/json

Sample:
{
  "DocumentId": "sample string 1",
  "DocumentNumberBranch": 1,
  "TrxTypeId": 1,
  "Number": "sample string 2",
  "Date": "2024-11-18T11:51:02.5159496+02:00",
  "CustomerId": "sample string 5",
  "CustomerBusinessName": "sample string 6",
  "CustomerOsekMorshe": "sample string 7",
  "CustomerContactName": "sample string 8",
  "CustomerAddress1": "sample string 9",
  "CustomerAddress2": "sample string 10",
  "CustomerCity": "sample string 11",
  "CustomerPostalCode": "sample string 12",
  "CustomerCountry": "sample string 13",
  "CustomerEmail": "sample string 14",
  "MobilePhone": "sample string 15",
  "Details": "sample string 16",
  "Comments": "sample string 17",
  "TotalLinesChargeVAT": 18.0,
  "Rebate": 1.0,
  "RebatePercent": 1.0,
  "RountTotal": true,
  "RebateRounding": 1.0,
  "TotalBeforeVAT": 1.0,
  "TotalBeforeVATChargeVAT": 1.0,
  "TotalNoChargeVat": 1.0,
  "Vat": 19.0,
  "Total": 1.0,
  "EffectiveTotal": 1.0,
  "VatRate": 1.0,
  "Payment": 1.0,
  "TaxDeduction": 1.0,
  "TotalPayment": 2.0,
  "ReceiptCurrencySymbol": "sample string 20",
  "ReceiptRate": 1.0,
  "TaxDeductionNIS": 1.0,
  "PaymentNIS": 1.0,
  "TotalPaymentNIS": 2.0,
  "DocumentLines": [
    {
      "Number": 1,
      "ProductId": "sample string 2",
      "ProductCatalogNumber": "sample string 3",
      "ProductName": "sample string 4",
      "Details": "sample string 5",
      "UnitPrice": 6.0,
      "Qty": 7.0,
      "CurrencySymbol": "sample string 8",
      "Rate": 1.0,
      "Rebate": 9.0,
      "ExtendedPrice": 33.0,
      "ChargeVAT": true,
      "VATRate": 1.0,
      "VAT": 1.0
    },
    {
      "Number": 1,
      "ProductId": "sample string 2",
      "ProductCatalogNumber": "sample string 3",
      "ProductName": "sample string 4",
      "Details": "sample string 5",
      "UnitPrice": 6.0,
      "Qty": 7.0,
      "CurrencySymbol": "sample string 8",
      "Rate": 1.0,
      "Rebate": 9.0,
      "ExtendedPrice": 33.0,
      "ChargeVAT": true,
      "VATRate": 1.0,
      "VAT": 1.0
    }
  ],
  "ReceiptLines": [
    {
      "Number": 1,
      "PaymentTypeId": 2,
      "AccountNumber": "sample string 3",
      "BranchOrValidTo": "sample string 4",
      "BankId": 1,
      "CheckNumber": "sample string 5",
      "PaymentDate": "2024-11-18T11:51:02.5159496+02:00",
      "Payment": 1.0,
      "Rate": 1.0,
      "CanBeChanged": true,
      "DateCreated": "2024-11-18T11:51:02.5159496+02:00",
      "UserCreated": "sample string 6",
      "DateUpdated": "2024-11-18T11:51:02.5159496+02:00",
      "UserUpdated": "sample string 7"
    },
    {
      "Number": 1,
      "PaymentTypeId": 2,
      "AccountNumber": "sample string 3",
      "BranchOrValidTo": "sample string 4",
      "BankId": 1,
      "CheckNumber": "sample string 5",
      "PaymentDate": "2024-11-18T11:51:02.5159496+02:00",
      "Payment": 1.0,
      "Rate": 1.0,
      "CanBeChanged": true,
      "DateCreated": "2024-11-18T11:51:02.5159496+02:00",
      "UserCreated": "sample string 6",
      "DateUpdated": "2024-11-18T11:51:02.5159496+02:00",
      "UserUpdated": "sample string 7"
    }
  ],
  "TrxCode": "sample string 21",
  "TrxCodeNumber": 1,
  "Status": 1,
  "DueDate": "2024-11-18T11:51:02.5159496+02:00",
  "RowVersion": "QEA=",
  "LinkToPdf": "sample string 22",
  "ViewUrl": "sample string 23",
  "PaymentUrl": "sample string 24",
  "RelatedDocuments": [
    {
      "DocumentId": "sample string 1",
      "TrxTypeId": 2,
      "Date": "2024-11-18T11:51:02.5159496+02:00",
      "DocumentNumber": "sample string 4",
      "DocumentSum": 5.0,
      "DocumentRelation": 6
    },
    {
      "DocumentId": "sample string 1",
      "TrxTypeId": 2,
      "Date": "2024-11-18T11:51:02.5159496+02:00",
      "DocumentNumber": "sample string 4",
      "DocumentSum": 5.0,
      "DocumentRelation": 6
    }
  ],
  "AllocationNumber": "sample string 25",
  "DateCreated": "2024-11-18T11:51:02.5159496+02:00",
  "UserCreated": "sample string 26",
  "DateUpdated": "2024-11-18T11:51:02.5159496+02:00",
  "UserUpdated": "sample string 27"
}

application/xml, text/xml

Sample:
<CaspitDocument xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.caspit.biz/2013/03">
  <DateCreated>2024-11-18T11:51:02.5159496+02:00</DateCreated>
  <DateUpdated>2024-11-18T11:51:02.5159496+02:00</DateUpdated>
  <UserCreated>sample string 26</UserCreated>
  <UserUpdated>sample string 27</UserUpdated>
  <AllocationNumber>sample string 25</AllocationNumber>
  <Comments>sample string 17</Comments>
  <CustomerAddress1>sample string 9</CustomerAddress1>
  <CustomerAddress2>sample string 10</CustomerAddress2>
  <CustomerBusinessName>sample string 6</CustomerBusinessName>
  <CustomerCity>sample string 11</CustomerCity>
  <CustomerContactName>sample string 8</CustomerContactName>
  <CustomerCountry>sample string 13</CustomerCountry>
  <CustomerEmail>sample string 14</CustomerEmail>
  <CustomerId>sample string 5</CustomerId>
  <CustomerOsekMorshe>sample string 7</CustomerOsekMorshe>
  <CustomerPostalCode>sample string 12</CustomerPostalCode>
  <Date>2024-11-18T11:51:02.5159496+02:00</Date>
  <Details>sample string 16</Details>
  <DocumentId>sample string 1</DocumentId>
  <DocumentLines>
    <CaspitDocumentLine>
      <ChargeVAT>true</ChargeVAT>
      <CurrencySymbol>sample string 8</CurrencySymbol>
      <Details>sample string 5</Details>
      <ExtendedPrice>33</ExtendedPrice>
      <Number>1</Number>
      <ProductCatalogNumber>sample string 3</ProductCatalogNumber>
      <ProductId>sample string 2</ProductId>
      <ProductName>sample string 4</ProductName>
      <Qty>7</Qty>
      <Rate>1</Rate>
      <Rebate>9</Rebate>
      <UnitPrice>6</UnitPrice>
      <VAT>1</VAT>
      <VATRate>1</VATRate>
    </CaspitDocumentLine>
    <CaspitDocumentLine>
      <ChargeVAT>true</ChargeVAT>
      <CurrencySymbol>sample string 8</CurrencySymbol>
      <Details>sample string 5</Details>
      <ExtendedPrice>33</ExtendedPrice>
      <Number>1</Number>
      <ProductCatalogNumber>sample string 3</ProductCatalogNumber>
      <ProductId>sample string 2</ProductId>
      <ProductName>sample string 4</ProductName>
      <Qty>7</Qty>
      <Rate>1</Rate>
      <Rebate>9</Rebate>
      <UnitPrice>6</UnitPrice>
      <VAT>1</VAT>
      <VATRate>1</VATRate>
    </CaspitDocumentLine>
  </DocumentLines>
  <DocumentNumberBranch>1</DocumentNumberBranch>
  <DueDate>2024-11-18T11:51:02.5159496+02:00</DueDate>
  <EffectiveTotal>1</EffectiveTotal>
  <LinkToPdf>sample string 22</LinkToPdf>
  <MobilePhone>sample string 15</MobilePhone>
  <Number>sample string 2</Number>
  <Payment>1</Payment>
  <PaymentNIS>1</PaymentNIS>
  <PaymentUrl>sample string 24</PaymentUrl>
  <Rebate>1</Rebate>
  <RebatePercent>1</RebatePercent>
  <RebateRounding>1</RebateRounding>
  <ReceiptCurrencySymbol>sample string 20</ReceiptCurrencySymbol>
  <ReceiptLines>
    <CaspitReceiptLine>
      <DateCreated>2024-11-18T11:51:02.5159496+02:00</DateCreated>
      <DateUpdated>2024-11-18T11:51:02.5159496+02:00</DateUpdated>
      <UserCreated>sample string 6</UserCreated>
      <UserUpdated>sample string 7</UserUpdated>
      <AccountNumber>sample string 3</AccountNumber>
      <BankId>1</BankId>
      <BranchOrValidTo>sample string 4</BranchOrValidTo>
      <CanBeChanged>true</CanBeChanged>
      <CheckNumber>sample string 5</CheckNumber>
      <Number>1</Number>
      <Payment>1</Payment>
      <PaymentDate>2024-11-18T11:51:02.5159496+02:00</PaymentDate>
      <PaymentTypeId>2</PaymentTypeId>
      <Rate>1</Rate>
    </CaspitReceiptLine>
    <CaspitReceiptLine>
      <DateCreated>2024-11-18T11:51:02.5159496+02:00</DateCreated>
      <DateUpdated>2024-11-18T11:51:02.5159496+02:00</DateUpdated>
      <UserCreated>sample string 6</UserCreated>
      <UserUpdated>sample string 7</UserUpdated>
      <AccountNumber>sample string 3</AccountNumber>
      <BankId>1</BankId>
      <BranchOrValidTo>sample string 4</BranchOrValidTo>
      <CanBeChanged>true</CanBeChanged>
      <CheckNumber>sample string 5</CheckNumber>
      <Number>1</Number>
      <Payment>1</Payment>
      <PaymentDate>2024-11-18T11:51:02.5159496+02:00</PaymentDate>
      <PaymentTypeId>2</PaymentTypeId>
      <Rate>1</Rate>
    </CaspitReceiptLine>
  </ReceiptLines>
  <ReceiptRate>1</ReceiptRate>
  <RelatedDocuments>
    <RelatedDocument>
      <Date>2024-11-18T11:51:02.5159496+02:00</Date>
      <DocumentId>sample string 1</DocumentId>
      <DocumentNumber>sample string 4</DocumentNumber>
      <DocumentRelation>6</DocumentRelation>
      <DocumentSum>5</DocumentSum>
      <TrxTypeId>2</TrxTypeId>
    </RelatedDocument>
    <RelatedDocument>
      <Date>2024-11-18T11:51:02.5159496+02:00</Date>
      <DocumentId>sample string 1</DocumentId>
      <DocumentNumber>sample string 4</DocumentNumber>
      <DocumentRelation>6</DocumentRelation>
      <DocumentSum>5</DocumentSum>
      <TrxTypeId>2</TrxTypeId>
    </RelatedDocument>
  </RelatedDocuments>
  <RountTotal>true</RountTotal>
  <RowVersion>QEA=</RowVersion>
  <Status>1</Status>
  <TaxDeduction>1</TaxDeduction>
  <TaxDeductionNIS>1</TaxDeductionNIS>
  <Total>1</Total>
  <TotalBeforeVAT>1</TotalBeforeVAT>
  <TotalBeforeVATChargeVAT>1</TotalBeforeVATChargeVAT>
  <TotalLinesChargeVAT>18</TotalLinesChargeVAT>
  <TotalNoChargeVat>1</TotalNoChargeVat>
  <TotalPayment>2</TotalPayment>
  <TotalPaymentNIS>2</TotalPaymentNIS>
  <TrxCode>sample string 21</TrxCode>
  <TrxCodeNumber>1</TrxCodeNumber>
  <TrxTypeId>1</TrxTypeId>
  <Vat>19</Vat>
  <VatRate>1</VatRate>
  <ViewUrl>sample string 23</ViewUrl>
</CaspitDocument>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Description

HttpResponseMessage