POST api/sale

Provides true/exception on post of sale.

Request Information

URI Parameters

None.

Body Parameters

PublicAPI.Models.SalePostDto
NameDescriptionTypeAdditional information
ShopId

Id of the shop.

integer

Required

Range: inclusive between 1001 and 999999

TerminalId

Id of the terminal.

integer

Required

Range: inclusive between 1 and 999

ClerkId

Id of the clerk.

integer

Required

Range: inclusive between 1 and 999999999

ReceiptId

Id of the receipt.

integer

Required

Range: inclusive between 1 and 99999999

CustomerNumber

Customer number for loyalty.

integer

Range: inclusive between 0 and 1E+19

AccountNumber

Account number for debtor.

integer

Range: inclusive between 0 and 1E+19

ItemLines

The item lines.

Collection of PublicAPI.Models.ItemLineSaleDto

None.

PaymentLines

The payment lines.

Collection of PublicAPI.Models.PaymentLineSaleDto

None.

Request Formats

application/json, text/json

Sample:
{
  "ShopId": 1,
  "TerminalId": 2,
  "ClerkId": 3,
  "ReceiptId": 4,
  "CustomerNumber": 5,
  "AccountNumber": 6,
  "ItemLines": [
    {
      "Type": "Sale",
      "ItemGroupId": 1,
      "VariantId": 2,
      "Quantity": 3,
      "GrossLineAmount": 4.0,
      "PriceAlteration": "Discount",
      "PriceAlterationCode": 5,
      "PriceAlterationAmount": 6.0,
      "ReturnCode": 7,
      "VoucherNumber": "sample string 8",
      "LoyaltyMoneyUsed": 9.0,
      "WebOrderOrderNo": "sample string 10",
      "CustomText": "sample string 11"
    },
    {
      "Type": "Sale",
      "ItemGroupId": 1,
      "VariantId": 2,
      "Quantity": 3,
      "GrossLineAmount": 4.0,
      "PriceAlteration": "Discount",
      "PriceAlterationCode": 5,
      "PriceAlterationAmount": 6.0,
      "ReturnCode": 7,
      "VoucherNumber": "sample string 8",
      "LoyaltyMoneyUsed": 9.0,
      "WebOrderOrderNo": "sample string 10",
      "CustomText": "sample string 11"
    }
  ],
  "PaymentLines": [
    {
      "Direction": "In",
      "TransactionType": 1,
      "LineAmount": 2.0,
      "VoucherNumber": "sample string 3"
    },
    {
      "Direction": "In",
      "TransactionType": 1,
      "LineAmount": 2.0,
      "VoucherNumber": "sample string 3"
    }
  ]
}

application/xml, text/xml

Sample:
<SalePostDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PublicAPI.Models">
  <AccountNumber>6</AccountNumber>
  <ClerkId>3</ClerkId>
  <CustomerNumber>5</CustomerNumber>
  <ItemLines>
    <ItemLineSaleDto>
      <CustomText>sample string 11</CustomText>
      <GrossLineAmount>4</GrossLineAmount>
      <ItemGroupId>1</ItemGroupId>
      <LoyaltyMoneyUsed>9</LoyaltyMoneyUsed>
      <PriceAlteration>Discount</PriceAlteration>
      <PriceAlterationAmount>6</PriceAlterationAmount>
      <PriceAlterationCode>5</PriceAlterationCode>
      <Quantity>3</Quantity>
      <ReturnCode>7</ReturnCode>
      <Type>Sale</Type>
      <VariantId>2</VariantId>
      <VoucherNumber>sample string 8</VoucherNumber>
      <WebOrderOrderNo>sample string 10</WebOrderOrderNo>
    </ItemLineSaleDto>
    <ItemLineSaleDto>
      <CustomText>sample string 11</CustomText>
      <GrossLineAmount>4</GrossLineAmount>
      <ItemGroupId>1</ItemGroupId>
      <LoyaltyMoneyUsed>9</LoyaltyMoneyUsed>
      <PriceAlteration>Discount</PriceAlteration>
      <PriceAlterationAmount>6</PriceAlterationAmount>
      <PriceAlterationCode>5</PriceAlterationCode>
      <Quantity>3</Quantity>
      <ReturnCode>7</ReturnCode>
      <Type>Sale</Type>
      <VariantId>2</VariantId>
      <VoucherNumber>sample string 8</VoucherNumber>
      <WebOrderOrderNo>sample string 10</WebOrderOrderNo>
    </ItemLineSaleDto>
  </ItemLines>
  <PaymentLines>
    <PaymentLineSaleDto>
      <Direction>In</Direction>
      <LineAmount>2</LineAmount>
      <TransactionType>1</TransactionType>
      <VoucherNumber>sample string 3</VoucherNumber>
    </PaymentLineSaleDto>
    <PaymentLineSaleDto>
      <Direction>In</Direction>
      <LineAmount>2</LineAmount>
      <TransactionType>1</TransactionType>
      <VoucherNumber>sample string 3</VoucherNumber>
    </PaymentLineSaleDto>
  </PaymentLines>
  <ReceiptId>4</ReceiptId>
  <ShopId>1</ShopId>
  <TerminalId>2</TerminalId>
</SalePostDto>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'SalePostDto'.

Response Information

Resource Description

boolean

Response Formats

application/json, text/json

Sample:
true

application/xml, text/xml

Sample:
<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>