POST api/orders/finalize

Finalize order as cash or as deliverynote.

Request Information

URI Parameters

None.

Body Parameters

FinalizeOrderRequest
NameDescriptionTypeAdditional information
OrderId

Id of the order

integer

None.

BranchId

Id of the branch

integer

None.

PointOfSaleId

Id of the point of sale

integer

None.

CloseOrderType

Valid values: 1 = Delivery note, 3 = Cash

CloseOrderType

None.

CreditCardAmount

Sum of credit card amount

decimal number

None.

CashAmount

Sum of cash amount

decimal number

None.

RoundingAmount

Rounding amount

decimal number

None.

ElectronicPaymentsAmount

Amount of electroic payment
E.g Swish for sweden

decimal number

None.

PaymentCardTypeId

Id of payment card type -

Use GET api/Orders/PaymentCardTypes
-

Required if CreditCardAmount != 0

integer

None.

Remarks

See FinalizeOrderErrorCode in FinalizeOrderResponse.FinalizeOrderError for error codes.

Example

//Finalize the order with id 1 on branch 75
http://localhost/api/orders/finalize/1/75

Request Formats

application/json, text/json

Sample:
{
  "OrderId": 1,
  "BranchId": 2,
  "PointOfSaleId": 1,
  "CloseOrderType": 1,
  "CreditCardAmount": 3.0,
  "CashAmount": 4.0,
  "RoundingAmount": 5.0,
  "ElectronicPaymentsAmount": 6.0,
  "PaymentCardTypeId": 1
}

application/xml, text/xml

Sample:
<FinalizeOrderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Order">
  <BranchId>2</BranchId>
  <CashAmount>4</CashAmount>
  <CloseOrderType>DeliveryNote</CloseOrderType>
  <CreditCardAmount>3</CreditCardAmount>
  <ElectronicPaymentsAmount>6</ElectronicPaymentsAmount>
  <OrderId>1</OrderId>
  <PaymentCardTypeId>1</PaymentCardTypeId>
  <PointOfSaleId>1</PointOfSaleId>
  <RoundingAmount>5</RoundingAmount>
</FinalizeOrderRequest>

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 'FinalizeOrderRequest'.

Response Information

Resource Description

Returns a FinalizeOrderResponse.

FinalizeOrderResponse
NameDescriptionTypeAdditional information
Success

boolean

None.

Errors

Collection of FinalizeOrderError

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Errors": [
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    },
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    }
  ]
}

application/xml, text/xml

Sample:
<FinalizeOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Order">
  <Errors>
    <FinalizeOrderError>
      <ErrorCode>OrderNotFound</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </FinalizeOrderError>
    <FinalizeOrderError>
      <ErrorCode>OrderNotFound</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </FinalizeOrderError>
  </Errors>
  <Success>true</Success>
</FinalizeOrderResponse>