CalculateOrder

Description

We use this method to calculate the order in real time against the business rules defined in the ERP system. Extra orderlines can be returned, for example service fees, shipping costs and/or administrative fees.

Action

http://shoxl.com/ShoxlService/CalculateOrder

Please note: this is not a working url, but a combination of namespace and method. Do not expect the url to return a result.

Style

Document

Input (Literal)

The input of this method is the document element tns:CalculateOrder having the structure defined by the following table.

Element

Type

Occurs

Description

Sequence

1..1

request

tns:CalculateOrderRequest

0..1

Complex Type: tns:CalculateOrderRequest

Description

The CalculateOrderRequest contains all the information needed to calculate the

Order in the ERP system.

Component

Type

Occurs

Description

Sequence

1..1

AccountNumber

s:string

1..1

This is the (project) account number of the customer.

ExternalOrderNumber

s:string

1..1

This the Shoxl Shop unique order number

OrderLines

tns:ArrayOfOrderLineRequest

0..1

A list of order lines. The order needs to be calculated for.

ShipmentMethodCode

s:int

1..1

A Shipment Method Code: 0 = pickup by customer, 1 = default delivery

Complex Type: tns:ArrayOfOrderLineRequest

Component

Type

Occurs

Description

Sequence

1..1

OrderLine

tns:OrderLineRequest

0..*

Complex Type: tns:OrderLineRequest

A orderline Request contains all the information needed to calculate.

Component

Type

Occurs

Description

Sequence

1..1

IsExternal

s:boolean

1..1

If the order line is added by the ERP system (for example when its an extra fee or shipping costs), this field must be set true. If Shoxl Shop adds an order line this field is set false.

ProductNumber

s:string

1..1

The product number for the requested product details, this can be a customer-specific product number

Quantity

s:int

1..1

The amount of products ordered

Output (Literal)

The output of this method is the document element tns:CalculateOrderResponse having the structure defined by the following table.

Element

Type

Occurs

Description

Sequence

1..1

CalculateOrderResult

tns:CalculateOrderResult

0..1

Complex Type: tns:CalculateOrderResult

Description

The CalculateOrderResult contains the update order line information from the

ERP system.

Component

Type

Occurs

Description

Sequence

1..1

ErrorCode

s:string

0..1

An error code returned by the ERP system

ErrorDescription

s:string

0..1

The error description related to the error code returned by the ERP system

OrderLines

tns:ArrayOfOrderLine

0..1

The calculated orderlines.

TotalAmount

s:int

1..1

The total amount of items in the order

TotalDiscountExclVat

s:decimal

1..1

The total amount of discount excluding VAT

TotalPriceExclVat

s:decimal

1..1

The total price of the order excluding VAT

TotalPriceInclVat

s:decimal

1..1

The total price of the order including VAT

TotalVat

s:decimal

1..1

The total amount of VAT

REST API:

URL: /Shoxl/v1/CalculateOrder Method: POST

Request body:

CalculateOrderRequest{

parameter

type

accountNumber

string required

externalOrderNumber

string required

orderLines

[OrderLineRequest]

shipmentMethodCode

integer($int32)

}

OrderLineRequest{

parameter

type

isExternal

boolean

productNumber

string required

quantity

integer($int32)

}

Example:

{
  "accountNumber": "string",
  "externalOrderNumber": "string",
  "orderLines": [
    {
      "isExternal": true,
      "productNumber": "string",
      "quantity": 0
    }
  ],
  "shipmentMethodCode": 0
}

Response body:

CalculateOrderResult{

errorCode

string nullable: true

errorDescription

string nullable: true

orderLines

[OrderLine]

totalAmount

integer($int32)

totalDiscountExclVat

number($double)

totalPriceExclVat

number($double)

totalPriceInclVat

number($double)

totalVat

number($double)

}

Example:

{
  "errorCode": "string",
  "errorDescription": "string",
  "orderLines": [
    {
      "baseUnit": "string",
      "carrier": "string",
      "discountAmountExclVat": 0,
      "discountDescription": "string",
      "discountPercentage": 0,
      "grossPriceExclVat": 0,
      "isExternal": true,
      "nettoPriceExclVat": 0,
      "nettoPriceInclVat": 0,
      "orderLineStatus": 0,
      "priceUnit": 0,
      "productDescription": "string",
      "productNumber": "string",
      "quantity": 0,
      "remainingQuantity": 0,
      "subTotalPriceExclVat": 0,
      "subTotalPriceInclVat": 0,
      "trackAndTraceReference": "string",
      "vatCode": 0
    }
  ],
  "totalAmount": 0,
  "totalDiscountExclVat": 0,
  "totalPriceExclVat": 0,
  "totalPriceInclVat": 0,
  "totalVat": 0
}

Last updated