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.

SOAP API:

Action

http://shoxl.com/ShoxlService/CalculateOrder

circle-info

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

BaseUnit

s:string

0..1

The unit to be used for getting the correct price

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 V1:

URL: /Shoxl/v1/CalculateOrder Method: POST

Changes in ShoxlRestApiSwagger_v8

  • The vatCode field on OrderLine is replaced by a new taxPercentage field

Changes in ShoxlRestApiSwagger_v16

  • A new field "context" is introduced in the request body. When configured this object contains key value pairs (e.g. divisionCode).

Changes in ShoxlRestApiSwagger_v20

Changes in ShoxlRestApiSwagger_v21

Request body:

CalculateOrderRequest{

Parameter
Type

accountNumber

string required

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

externalOrderNumber

string

This the Shoxl Shop unique order number

orderLines

[OrderLineRequest]

The order needs to be calculated for.

shipmentMethodCode

integer($int32)

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

shippingCountry

string

The country where the order is shipped to. Must be a two-letter ISO country code.

context

object

A generic object designed to hold key-value pairs for the purpose of providing customer-specific fields.

}

OrderLineRequest{

parameter

type

isExternal

boolean

productNumber

string required

quantity

integer($int32)

baseUnit

string

}

Example:

Response body:

CalculateOrderResult{

errorCode

string nullable: true

errorDescription

string nullable: true

orderLines

[OrderLine]

totalAmount

integer($int32)

totalDiscountExclVat

number($double) nullable: true

totalPriceExclVat

number($double) nullable: true

totalPriceInclVat

number($double) nullable: true

totalVat

number($double) nullable: true

}

Orderline{

baseUnit

string nullable: true

carrier

string nullable: true

discountAmountExclVat

number($double) nullable: true

discountDescription

string nullable: true

discountPercentage

number($double) nullable: true

grossPriceExclVat

number($double) nullable: true

isExternal

boolean

nettoPriceExclVat

number($double) nullable: true

nettoPriceInclVat

number($double) nullable: true

orderLineStatus

integer($int32)

priceUnit

number($double)

productDescription

string nullable: true

productNumber

string nullable: true

quantity

number($double)

remainingQuantity

number($double)

subTotalPriceExclVat

number($double) nullable: true

subTotalPriceInclVat

number($double) nullable: true

trackAndTraceReference

string nullable: true

taxPercentage

number($double) nullable: true

type

integer($int32)

relatedProductNumber

string nullable: true

}

Types:

Type
Values

Type

None = 0

Product = 1

Shipping = 2

Payment = 3

Other = 4

Discount = 5

DisposalFee = 6 Deposit = 7

Example:

REST API V2:

URL: /Shoxl/v2/CalculateOrder Method: POST

Changes in ShoxlRestApiSwagger_v20

  • Added /v2/CalculateOrder which support decimals in the order line requests instead of integers.

Request body:

CalculateOrderRequestV2{

Parameter
Type

accountNumber

string required

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

externalOrderNumber

string

This the Shoxl Shop unique order number

orderLines

[OrderLineRequestV2]

The order needs to be calculated for.

shipmentMethodCode

integer($int32)

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

shippingCountry

string

The country where the order is shipped to. Must be a two-letter ISO country code.

context

object

A generic object designed to hold key-value pairs for the purpose of providing customer-specific fields.

}

OrderLineRequest{

parameter

type

isExternal

boolean

productNumber

string required

quantity

number($double)

baseUnit

string

}

Example:

Response body:

CalculateOrderResult{

errorCode

string nullable: true

errorDescription

string nullable: true

orderLines

[OrderLine]

totalAmount

integer($int32)

totalDiscountExclVat

number($double) nullable: true

totalPriceExclVat

number($double) nullable: true

totalPriceInclVat

number($double) nullable: true

totalVat

number($double) nullable: true

}

Orderline{

baseUnit

string nullable: true

carrier

string nullable: true

discountAmountExclVat

number($double) nullable: true

discountDescription

string nullable: true

discountPercentage

number($double) nullable: true

grossPriceExclVat

number($double) nullable: true

isExternal

boolean

nettoPriceExclVat

number($double) nullable: true

nettoPriceInclVat

number($double) nullable: true

orderLineStatus

integer($int32)

priceUnit

number($double)

productDescription

string nullable: true

productNumber

string nullable: true

quantity

number($double)

remainingQuantity

number($double)

subTotalPriceExclVat

number($double) nullable: true

subTotalPriceInclVat

number($double) nullable: true

trackAndTraceReference

string nullable: true

taxPercentage

number($double) nullable: true

type

integer($int32)

relatedProductNumber

string nullable: true

}

Types:

Type
Values

Type

None = 0

Product = 1

Shipping = 2

Payment = 3

Other = 4

Discount = 5

DisposalFee = 6 Deposit = 7

Example:

REST API V3:

URL: /Shoxl/v3/CalculateOrder Method: POST

Changes in ShoxlRestApiSwagger_v21

  • Added /v3/CalculateOrder which supports address information, shipment method code dropshipment and a new division code.

Request body:

CalculateOrderRequestV3

Parameter
Type
Description

salesOrder

OrderHeaderRequestV3 Required

The SalesOrder Request

OrderHeaderRequestV3

Parameter
Type
Description

accountNumber

string Required

This is the account number of the customer.

divisionCode

string

The division code belonging to the administration.

externalOrderNumber

string

This the Shoxl Shop unique order number.

shipmentMethodCode

integer($int32)

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

orderLines

The order lines.

InvoiceAddress

The invoice address.

deliveryAddress

The delivery address.

OrderLineRequestV3

Parameter
Type
Description

isExternal

boolean

Specifies whether the order line source is external to Shoxl.

productNumber

string required

The product number.

quantity

number($double) required

The quantity of the product.

baseUnit

string

The unit belonging to the product.

AddressRequest

Parameter
Type
Description

name1

string

The customer's first name.

name2

string

The customer's last name.

addressLine1

string

The first address line.

addressline2

string

The second address line.

street

string

The street.

houseNumber

string

The house number.

houseNumberAddition

string

The house number's addition.

postalCode

string

The postal code.

city

string

The city.

country

string

The country code. Must be a two-letter ISO code.

Example:

CalculateOrderResultV3

Parameter
Type
Description

accountNumber

string

The customer or account identifier associated with the order.

totalDiscountExclVat

number($decimal) nullable: true

The total discount amount applied to the order, excluding VAT.

totalAmount

number($decimal) nullable: true

The total calculated amount of the order after discounts, before VAT is applied.

totalQuantity

number($decimal) nullable: true

The sum of quantities for all order lines in the order.

totalVat

number($decimal) nullable: true

The total VAT amount calculated for the entire order.

totalAmountInclVat

number($decimal) nullable: true

The total order amount including VAT.

totalAmountExclVat

number($decimal) nullable: true

The total order amount excluding VAT.

orderLines

The collection of calculated order lines that make up the order, including pricing, quantities, and VAT details per line.

CalculateOrderLineV3

Parameter
Type
Description

baseUnit

string

The base unit of measure for the product (e.g. PCS, KG).

carrier

string

The carrier associated with the order line, if applicable.

discountAmountExclVat

number($decimal) nullable: true

The discount amount applied to this order line, excluding VAT.

discountDescription

string

A textual description explaining the applied discount.

discountPercentage

number($decimal) nullable: true

The discount percentage applied to this order line.

grossPriceExclVat

number($decimal) nullable: true

The gross price per unit before discounts, excluding VAT.

isExternal

boolean

Indicates whether the product originates from an external source or system.

netPriceExclVat

number($decimal) nullable: true

The net unit price after discounts, excluding VAT.

netPriceInclVat

number($decimal) nullable: true

The net unit price after discounts, including VAT.

productDescription

string

The descriptive name or text for the product.

productNumber

string

The unique identifier or SKU for the product.

priceUnit

number($decimal)

The number of base units that the price applies to.

quantity

number($decimal)

The ordered quantity for this order line.

relatedProductNumber

string

The product number of a related or bundled product, if applicable.

subTotalPriceExclVat

number($decimal) nullable: true

The subtotal amount for this order line excluding VAT.

subTotalPriceInclVat

number($decimal) nullable: true

The subtotal amount for this order line including VAT.

taxPercentage

number($decimal) nullable: true

The VAT or tax percentage applied to this order line.

type

integer($int32) Required

Indicates the type of order line (e.g. Product, Shipping, discount), typically represented as an enum.

vatCode

integer($int32)

The VAT code used to determine tax calculation rules for this order line.

Example

Was this helpful?