pixiReport_GrossProfit
API call exposes report "Gross Profit"
Since pixi version: 19.04 (9.0.2.38390) Additional notes: This report/API calculates the gross profit per item in a defined time frame. Applicable for Sales and Returns (Avg.): The selling price is an average of all selling prices during this time frame - same with supplier prices and VAT.
Calculation:
Single Gross Profit = Selling Price (Sales) - VAT (Sales) - Supp. Price (Sales)
Total Gross Profit = Single Gross Profit * Sales - ( Selling Price (Returns) - VAT (Returns) - Supp. Price (Returns) ) * Returns
Values:
Selling prices include VAT, supplier prices do not include VAT.
The sums for columns Selling Price, VAT and Supplier Price below Sales & Returns (Avg.) are already multiplied with item quantities for Sales or Returns.
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
ShopID | string | false | Filter: Shop Id Type: varchar(3) Default value: NULL Example: MAD Available from: 19.04 (9.0.2.38390) |
ToDate | string | true | Range: End of date range (End of day time is added) Type: datetime Default value: Example: YYYY-MM-DD Available from: 19.04 (9.0.2.38390) |
SupplNr | string | false | Filter: Supplier code Type: varchar(10) Default value: NULL Example: MGS Available from: 19.04 (9.0.2.38390) |
TagKey1 | integer | false | Filter: Item tag Id (1) Type: int Default value: NULL Example: 111 Available from: 19.04 (9.0.2.38390) |
TagKey2 | integer | false | Filter: Item tag Id (2) Type: int Default value: NULL Example: 222 Available from: 19.04 (9.0.2.38390) |
TagKey3 | integer | false | Filter: Item tag Id (3) Type: int Default value: NULL Example: 333 Available from: 19.04 (9.0.2.38390) |
Category | string | false | Filter: Category code Type: varchar(10) Default value: NULL Example: Clothes Available from: 19.04 (9.0.2.38390) |
FromDate | string | true | Range: Start of date range (Start of day time is added) Type: datetime Default value: Example: YYYY-MM-DD Available from: 19.04 (9.0.2.38390) |
PaymentType | string | false | Filter: Payment code Type: char Default value: NULL Example: Single character : "C" Available from: 19.04 (9.0.2.38390) |
ExcludePaymentType | string | false | Filter: Payment code to exclude Type: char Default value: NULL Example: Single character : "C" Available from: 19.04 (9.0.2.38390) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiReport_GrossProfit>
<FromDate>string</FromDate>
<ToDate>string</ToDate>
<ShopID>string</ShopID>
<Category>string</Category>
<SupplNr>string</SupplNr>
<PaymentType>string</PaymentType>
<ExcludePaymentType>string</ExcludePaymentType>
<TagKey1>0</TagKey1>
<TagKey2>0</TagKey2>
<TagKey3>0</TagKey3>
</pixiReport_GrossProfit>
</Body>
</Envelope>
Response
1. Report "Gross Profit" output columns
Name | Type | Description |
---|---|---|
Barcode | string | Item barcode Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
Currency | string | Currency Type: varchar (3) Available from: 25.06 (25.6.0.58802) |
ItemName | string | Item name Type: varchar (120) Available from: 25.06 (25.6.0.58802) |
Supplier | string | Supplier name Type: varchar (60) Available from: 25.06 (25.6.0.58802) |
Sales_VAT | number | Average item (sales) VAT Type: money Available from: 25.06 (25.6.0.58802) |
Returns_VAT | number | Average item (returns) VAT Type: money Available from: 25.06 (25.6.0.58802) |
ItemNrSupplier | string | Item number supplier Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
Sales_Quantity | integer | Item quantity sold Type: int Available from: 25.06 (25.6.0.58802) |
Returns_Quantity | integer | Average item (returns) selling price Type: int Available from: 25.06 (25.6.0.58802) |
TotalGrossProfit | number | Total Gross Profit = Single Gross Profit * Sales - ( Selling Price (Returns) - VAT (Returns) - Supp. Price (Returns) ) * Returns Type: money Available from: 25.06 (25.6.0.58802) |
SingleGrossProfit | number | Single Gross Profit = Selling Price (Sales) - VAT (Sales) - Supp. Price (Sales) Type: money Available from: 25.06 (25.6.0.58802) |
Sales_SellingPrice | number | Average item (sales) selling price Type: money Available from: 25.06 (25.6.0.58802) |
Sales_SupplierPrice | number | Average item (sales) supplier price Type: money Available from: 25.06 (25.6.0.58802) |
Returns_SellingPrice | number | Item quantity returned Type: money Available from: 25.06 (25.6.0.58802) |
Returns_SupplierPrice | number | Average item (returns) supplier price Type: money Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiReport_GrossProfitPost200TextXmlResponse>
<ItemNrSupplier>string</ItemNrSupplier>
<Barcode>string</Barcode>
<ItemName>string</ItemName>
<Supplier>string</Supplier>
<Sales_Quantity>0</Sales_Quantity>
<Sales_SellingPrice>0</Sales_SellingPrice>
<Sales_VAT>0</Sales_VAT>
<Sales_SupplierPrice>0</Sales_SupplierPrice>
<Returns_SellingPrice>0</Returns_SellingPrice>
<Returns_Quantity>0</Returns_Quantity>
<Returns_VAT>0</Returns_VAT>
<Returns_SupplierPrice>0</Returns_SupplierPrice>
<SingleGrossProfit>0</SingleGrossProfit>
<TotalGrossProfit>0</TotalGrossProfit>
<Currency>string</Currency>
</PixiReport_GrossProfitPost200TextXmlResponse>
2. Error
Name | Type | Description |
---|---|---|
Status | string | Status Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
Message | string | Status message details Type: varchar (MAX) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiReport_GrossProfitPost200TextXmlResponse>
<ItemNrSupplier>string</ItemNrSupplier>
<Barcode>string</Barcode>
<ItemName>string</ItemName>
<Supplier>string</Supplier>
<Sales_Quantity>0</Sales_Quantity>
<Sales_SellingPrice>0</Sales_SellingPrice>
<Sales_VAT>0</Sales_VAT>
<Sales_SupplierPrice>0</Sales_SupplierPrice>
<Returns_SellingPrice>0</Returns_SellingPrice>
<Returns_Quantity>0</Returns_Quantity>
<Returns_VAT>0</Returns_VAT>
<Returns_SupplierPrice>0</Returns_SupplierPrice>
<SingleGrossProfit>0</SingleGrossProfit>
<TotalGrossProfit>0</TotalGrossProfit>
<Currency>string</Currency>
</PixiReport_GrossProfitPost200TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://apigateway.descartes.com/tms/pixi/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiReport_GrossProfit>
<ShopID xsi:type="xsd:string">MAD</ShopID>
<ToDate xsi:type="xsd:string">YYYY-MM-DD</ToDate> <!-- required -->
<SupplNr xsi:type="xsd:string">MGS</SupplNr>
<TagKey1 xsi:type="xsd:integer">111</TagKey1>
<TagKey2 xsi:type="xsd:integer">222</TagKey2>
<TagKey3 xsi:type="xsd:integer">333</TagKey3>
<Category xsi:type="xsd:string">Clothes</Category>
<FromDate xsi:type="xsd:string">YYYY-MM-DD</FromDate> <!-- required -->
<PaymentType xsi:type="xsd:string">Single character : "C"</PaymentType>
<ExcludePaymentType xsi:type="xsd:string">Single character : "C"</ExcludePaymentType>
</ns1:pixiReport_GrossProfit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiReport_GrossProfit', [
'ShopID' => 'MAD', // string
'ToDate' => 'YYYY-MM-DD', // string (required)
'SupplNr' => 'MGS', // string
'TagKey1' => '111', // integer
'TagKey2' => '222', // integer
'TagKey3' => '333', // integer
'Category' => 'Clothes', // string
'FromDate' => 'YYYY-MM-DD', // string (required)
'PaymentType' => 'Single character : "C"', // string
'ExcludePaymentType' => 'Single character : "C"', // string
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}