Treazure API Documentation 1.18.0
Treazure API Documentation 1.18.0
© Copyright
Cow Hills Retail B.V. KvK 30218521 BTW NL 8169.90.499.B01 IBAN NL03ABNA0453746330 BIC
ABNANL2A
Name Date Change Document
version
P. Vermeulen April 6th 2016 Added PRD endpoints, added new Wsdl urls 0.52
P. Vermeulen Mar 13th 2018 1. Adds paragraph about local time and 1.9.3
zonal information in time values
2. Minor additions in paragraph regarding
ActivateGiftcard
R. Groeneveld Jan 16th 2019 Expanded Giftcard API with new properties 1.9.7
P. Vermeulen Apr 18th 2019 Add information about Http response codes of 1.9.8
Treazure responses.
P. Vermeulen Jul 12th 2019 Adds locking of coupons to specific customers. 1.12.0
Adds employee discount percentage on sale
level.
P. Vermeulen Jul 1st 2020 Added sale count limit of 999. 1.16.0
P. Vermeulen Aug 26th 2022 Added sale max discount percentage 1.17.0
API Commentary
Authentication This is a general API used for starting and ending sessions. Session are used to
access the different API’s hosted on the platform.
Coupon The coupon API offers couponing functionality, personal/unique codes can be
generated, issued, redeemed and maintained.
PemCalculation The PemCalculation API is used to calculate promotional discounts and benefits.
A basket1) is offered to the API and a directly applicable formatted response is
returned.
PemConfiguration The PemConfiguration API is used to configure and maintain promotional events.
This is only used in stand-alone environtments, i.e. this is not used in situations
where the ROS (Retail Online Suite) software is installed.
Giftcard (backoffice) For managing giftcard products and creating individual giftcards.
1) A basket contains the articles, used customer/employee cards and any other relevant information regarding
discounts and benefits.
Glossary
The following terms are specific to this document:
Term Commentary
Account Information used to log into the platform and identify oneself.
API key A code passed in by computer programs calling an API to identify the calling
program. It is used, for example to prevent malicious use or abuse of the API.
Consuming system The system using the service/API (i.e. the e-commerce platform).
Contract A binding agreement which allows the use of the Treazure platform.
License A specific permit, bound to any number of API’s. All contracts have at least one
license, which allows the use of a part of the Treazure platform.
Promotion filter A filter to set the conditions for a promotion, limiting it to specific situations.
These can consist of pre-defined sets of articles, but also for example the use of
customer cards or (specific) coupons.
Promotion The combination of all defined promotions. These are maintained by the retailer,
configuration either within Treazure or an external system.
Promotion The service needs promotions, these can be supplied in various ways:
configuration-type • From a POS environment (e.g. ROS)
• From the internal management module and the designated API
(PemConfiguration API)
A single retailer can have multiple Treazure accounts, each account is used for authentication on the web
service. For all actions performed on/in Treazure authentication is necessary, only valid accounts can
authorize. Valid accounts have a login ID and a valid password.
On top of user authentication an API key can be released. Such a key can be used for specific read-only
functions to improve performance, thus eliminating the need to log in/out for each request.
Accessibility to the different API’s is defined in the main contract, access can be granted to any number of
accounts.
Globally access needs to be granted though the license, within the contract access must be granted to any
number of accounts in order to use the functionality.
Bear in mind that configurations cannot be synchronized between the two environments. Every configuration
has to be done twice in its entirety.
A session can be closed by calling the Logoff function in the Authentication API, the token will be annulled
instantly.
Sessions created have a limited validity; a session will expire ten (10) minutes after being idle. Idle in this case
means since the last activity, a sliding window applies. Since the timer will be reset after each activity within
ten minutes of the last activity.
Keep this in mind when implementing Treazure services. You can, for example, choose to limit requests to only
one session per request. A request can consist of multiple actions, if the actions are in the same request string,
authentication only needs to take place once.
Certain read-only operations don’t need session authentication, but can be done using the API key. An
example is the calculate function in the PemCalculation API. This API is focussed on speed, this is achieved by
eliminating the need to authenticate with each request.
API URL
Authentication https://services-staging.treazure.nl/Authentication-1-0
Coupon https://services-staging.treazure.nl/Coupon-1-0
CustomerVoucher https://services-staging.treazure.nl/CustomerVoucher-1-0
PemCalculation https://services-staging.treazure.nl/PemCalculation-1-0
PemConfiguration https://services-staging.treazure.nl/PemConfiguration-1-0
RosConnector https://services-staging.treazure.nl/RosConnector-1-0
LoyaltyVault https://services-staging.treazure.nl/LoyaltyVault-1-0
API Commentary
Authentication https://services.treazure.nl/Authentication-1-0
Coupon https://services.treazure.nl/Coupon-1-0
CustomerVoucher https://services.treazure.nl/CustomerVoucher-1-0
PemCalculation https://services.treazure.nl/PemCalculation-1-0
PemConfiguration https://services.treazure.nl/PemConfiguration-1-0
RosConnector https://services.treazure.nl/RosConnector-1-0
LoyaltyVault https://services.treazure.nl/LoyaltyVault-1-0
Communicating with Treazure requires encryption using SSL\TLS, therefore the URI’s in the tables above all
show the HTTPS scheme. This allows for bidirectional encryption, ensuring safe(r) communications.
API URL
Authentication https://services-staging.treazure.nl/Authentication-1-0/wsdl
Coupon https://services-staging.treazure.nl/Coupon-1-0/wsdl
CustomerVoucher https://services-staging.treazure.nl/CustomerVoucher-1-0/wsdl
PemCalculation https://services-staging.treazure.nl/PemCalculation-1-0/wsdl
PemConfiguration https://services-staging.treazure.nl/PemConfiguration-1-0/wsdl
RosConnector https://services-staging.treazure.nl/RosConnector-1-0/wsdl
LoyaltyVault https://services-staging.treazure.nl/LoyaltyVault-1-0/wsdl
Please note: these URL’s can only be used on the staging environment. The production environment does not
serve Wsdl content.
Types used in the XML schemes in the WSDL can be found in the following namespaces:
Xml-namespace Commentary
Endpoints (Json)
Each service is accessible as a Json endpoint. These endpoints have the same Url as their Soap equivalent but
have the suffix /json.
For instance, the Json endpoint of the authentication service is available at https://services-
staging.treazure.nl/Authentication-1-0/json
Access this page by appending the suffix /help to the Json endpoint, for instance https://services-
staging.treazure.nl/Authentication-1-0/json
The scheme cannot be obtained from this page. The object structure is the same as the Soap endpoints so the
schema should be obtained from the Wsdl/schema of the Soap interface.
With the Xsd a Json request can be constructed. For instance the following Soap request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:Authenticate>
<eac:RetailerId>***</eac:RetailerId>
<eac:LoginId>***</eac:LoginId>
<eac:Password>***</eac:Password>
<eac:UtcOffset>05:00</eac:UtcOffset>
</eac:Authenticate>
</soapenv:Body>
</soapenv:Envelope>
The Authenticate-element is the method name and in the Json endpoint this is indicated in the Url. The
parameters can be converted from the Soap request and written als the following Json request:
{
"RetailerId" : "***",
"LoginId" : "***",
"Password" : "***",
"UtcOffset" : "05:00"
}
Error-feedback
This paragraph describes how errors will be fed back from Treazure, in order to handle these in a fashionable
manner.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult seqNr="14" code="Success">
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
And in Json:
{
"ConfigurationSequenceNumber": 6083,
"Code": "Success"
}
As you can see the value of the code attribute is Success, meaning the response has been handled correctly. In
the appendix you can find all response codes and what they imply. Note that these result codes are
implemented throughout the entire platform. Meaning that some codes will never occur for certain
operations.
If an unexpected error occurs, a specific error message will be sent. These messages will be sent if a request
could not be handled properly, see the below for example (Soap):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:LicenseRequired</faultcode>
<faultstring xml:lang="nl-NL">License 'Pem' required</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
{
"faultcode": "AuthenticationError",
"faultstring": "Need to be authenticated (unknown api key)"
}
• LicenseRequired
• AuthenticationError1)
• InternalError
TRZ-SRV The physical node on which the request was executed. String
TRZ-PROMO-SRV2) The name of the agent who handled the request. String
TRZ-PROMO-TIME2) The time that is used for calculating baskets. This header ISO 8601 time
is only provided when an explicit calculation moment is format,
provided. without time
zone.
These values can be used for troubleshooting and for trace purposes, because Treazure is balanced/scalable
and workload is divided.
1) Note: this could should not be used for authentication purposes. In the authentication operation of the Authentication API the result will
be returned using the generic status codes. This specific code will be return if for example a session expired while sending a new request.
<ValidUntill>2018-03-14T23:59:59+05:00</ValidUntill>
Because Treazure asumes all provided times in session bound calls are local it ignores the specified zonal
information (and the time will be converted to 18:59:59). It is advised to not specify zonal information in time
fields.
3.12.2 Sessions
Treazure supports usage in different time zones on a session level. When a session is started the Utc time offset
should be specified. All session based communication from and to Treazure will then take place in the local time,
Treazure will internally convert to Utc.
This means the client is responsible for determining the Utc offset based on time zone and daylight savings when
logging in. See for more information about providing the offset the Authenticate method in the Authentication
API.
Also, the Wsdl/schemas account for forward compatibilty. New added elements can appear in responses and
the schema will still validate (although the new elements will not be understoond unless a new Wsdl/Xsd is
loaded).
This is because the complex types in the schema contain the xs-any-element:
<xs:complexType name="CouponGenerationResult">
<xs:sequence>
<xs:element minOccurs="0" name="ReturnCode" type="tns:ReturnCode"/>
<xs:element minOccurs="0" name="CouponBatchId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="ErrorMessage" nillable="true" type="xs:string"/>
<xs:any minOccurs="0" processContents="lax"/>
</xs:sequence>
</xs:complexType>
Function: Authenticate
The function Authenticate must be used to start a new session.
Example of a request:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:Authenticate>
<eac:RetailerId>RETAILERID</eac:RetailerId>
<eac:LoginId>Web01</eac:LoginId>
<eac:Password>PWD</eac:Password>
</eac:Authenticate>
</soapenv:Body>
</soapenv:Envelope>
UtcOffset The Utc time offset to use for this session in HH:mm String
format.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<AuthenticateResponse xmlns="http://cowhills.nl/EAccount">
<AuthenticateResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<IsAdmin>false</IsAdmin>
<ReturnCode>Success</ReturnCode>
<Token>39f503da-174b-46d5-af53-9d9a7fa00c83</Token>
</AuthenticateResult>
</AuthenticateResponse>
</s:Body>
</s:Envelope>
Plain text The password is a static Little maintenance, one Vulnerable to replay
value. account can be used for attack.
multiple clients.
One time password The provided password is Password can only be Account cannot be shared
(OTP) encoded with an used once. between multiple clients.
incremented numerical
value.
Time based one time The provided password is Password can only be Clocks of Treazure and
password (TOTP) encoded with a time used for a short period of clients have to be in sync.
based component. time (30s). Account can be
shared between multiple
clients.
For the methods OTP and TOTP the password has to be encoded.
static string HashPwd_Otp(string retailerId, string userName, string pwd, long ticks)
{
using (var sha256 = SHA256.Create())
{
var bytes = Encoding.UTF8.GetBytes($"{retailerId.ToUpper()}.{userName.ToUpper()}.{pwd}");
var usernamePasswordHash = sha256.ComputeHash(bytes);
if (BitConverter.IsLittleEndian)
{
uniqueNumber = uniqueNumber.Reverse();
}
return pwdBase64;
}
}
T0 Time to start counting The Unix Epoch (1 jan 1970 00:00:00 UTC)
steps from
T1 Interval 30 seconds
N Token length 10
Function: Logoff
Calling the Logoff function ends the current session. The corresponding token must be supplied, which in turn,
is annulled instantly. The function is not used to log in.
Note: although a session will automatically expire after 10 minutes of inactivity, it is still strongly advised to
explicitly end sessions. Doing so prevents unwanted and unsanctioned operations on the system.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:Logoff>
<eac:AuthToken>6a7dc2b1-26d5-4ed6-a1df-7937a49a70be</eac:AuthToken>
</eac:Logoff>
</soapenv:Body>
</soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LogoffResponse xmlns="http://cowhills.nl/EAccount">
<LogoffResult>Success</LogoffResult>
</LogoffResponse>
</s:Body>
</s:Envelope>
Coupon status
The following coupon statusses exist:
Status Commentary
Created The coupon has been created, but not yet issued.
PartiallyRedeemed The coupon has been redeemed partially (this allows for multiple redeems),
meaning that it can be redeemed again.
Coupon strategy
A coupon can be created with status ‘created’ or ‘active’. When generating a batch of coupons the status can
be defined in the request (see paragraph GenerateCoupons). It depends on the situation which generation
strategy and status fits best.
Some examples:
Coupons for print work A batch of coupons needs to be generated with AutoActivate=True; this way
and/or e-mail the coupons can be redeemed instantly.
Coupons for print work, A batch of coupons needs to be generated with AutoActivate=False; coupon
explicit distribution IDs are generated but cannot be redeemed after generation.
Each coupon needs to be activated one by one. This can be integrated in the
checkout process for example.
Coupons for online on- This method can be used if the coupon barcode can be generated upon
demand distribution request, i.e. doesn’t have to be known in advance. A coupon batch can be
created to limit the number of coupons generated. In which case the
CreateAndActivateOnDemandCoupon function will generate the barcode at
the time needed.
Generate operations are dependant on a CouponRangeId, this range ID is an alpha-numeric value, which is
only used for identification of the series/batch. The consuming system must store which series/batches exist in
order to keep relevant meta-information (description, barcode type, logos etc.).
Coupons can be generated per run, you can run multiple generations within a batch. This can provide useful
when you need more coupons, or when an action is extended.
A batch is generated using a prefix and some digits from the serialnumber of the series. The system will then
generate unique barcodes based on this information. Pregenerated coupons are not generated on-the-fly, but
rather in the background, always taking already generated barcodes under consideration. This method ensures
performance on the Treazure server, guaranteeing on-the-fly generation for coupons upon request (non
pregenerated coupons).
Please note that it is not required to use an actual customer ID. Since the value is only used for comparision
purposes you can also specify a hashed value. It may be wise to consider this because there is no need to store
customer ID’s in Treazure.
Operations
The next few paragraphs will clarify the operations performed by the Coupon API. In the process some
complex types will be explained.
Issuing and redeeming coupons will most likely occur in POS (Point Of Sale) environments. Thence these
functions have shop and employee property fields to keep track of the coupons.
If the length restriction is not met, the status code InvalidParameterValue is returned.
RedeemCount The amount of times the coupon has been redeemed. Int
MaxRedeemCount The limit of how many times the coupon can and Int
can/may be redeemed.
CustomerReference The customer reference that this coupon is locked to. If String
this value is not available the coupon is not locked to a
specific customer.
Function: ActivateCoupon
The ActivateCoupon function facilitates the activation of coupons.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:ActivateCoupon>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:Parameters>
<eac:Barcode>9999459231533836726</eac:Barcode>
<eac:OperatorId>Server01</eac:OperatorId>
<eac:PosId>Web</eac:PosId>
<eac:ShopId>9999</eac:ShopId>
</eac:Parameters>
</eac:ActivateCoupon>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ActivateCouponResponse xmlns="http://cowhills.nl/EAccount">
<ActivateCouponResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ActivationId>5b87c54d-5f07-462e-8307-8b910f2cee8b</ActivationId>
<Coupon>
<Barcode>9999459231533836726</Barcode>
<CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</CouponRangeId>
<CreatedAt>2015-03-26T11:36:57</CreatedAt>
<MaxRedeemCount>3</MaxRedeemCount>
<RedeemCount>1</RedeemCount>
<SerialNumber>459231533836726</SerialNumber>
<Status>Active</Status>
<ValidFrom i:nil="true"/>
<ValidUntill>2015-04-09T00:00:00</ValidUntill>
</Coupon>
<ReturnCode>Success</ReturnCode>
</ActivateCouponResult>
</ActivateCouponResponse>
</s:Body>
</s:Envelope>
ActivationId The unique activation ID, this value can be used to String
reverse activation.
Function: CancelActivateCoupon
This function is used to reverse activation of one specific coupon. Activation can be either through the
ActivateCoupon or CreateAndActivateOnDemandCoupon functions.
Note: this function can only be used if the last operation was activation of the coupon. It is never possible to
reverse more than one step in the lifecycle of a coupon.
Example of a request:
Example of a result:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CancelActivateCouponResponse xmlns="http://cowhills.nl/EAccount">
<CancelActivateCouponResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</CancelActivateCouponResult>
</CancelActivateCouponResponse>
</s:Body>
</s:Envelope>
Function: RedeemCoupon
This function is used to redeem activated coupons. If configured, it is possible to redeem a coupon multiple
times, each redemption must be done separately by calling the RedeemCoupon function.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:RedeemCoupon>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:Parameters>
<eac:Barcode>9999459231533836726</eac:Barcode>
RedeemParameters. The customer reference for the redeem. If the coupon is Complex
CustomerReference locked to a customer this value must match. If the
coupon is not locked to a customer this value is ignored.
Example of a result:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<RedeemCouponResponse xmlns="http://cowhills.nl/EAccount">
<RedeemCouponResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Coupon>
<Barcode>9999459231533836726</Barcode>
<CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</CouponRangeId>
<CreatedAt>2015-03-26T11:36:57</CreatedAt>
<MaxRedeemCount>3</MaxRedeemCount>
<RedeemCount>1</RedeemCount>
<SerialNumber>459231533836726</SerialNumber>
<Status>PartiallyRedeemed</Status>
<ValidFrom i:nil="true"/>
<ValidUntill>2015-04-09T00:00:00</ValidUntill>
</Coupon>
<RedeemId>69feff1a-0ae2-4f7c-8189-c8c23cc81604</RedeemId>
<ReturnCode>Success</ReturnCode>
</RedeemCouponResult>
</RedeemCouponResponse>
</s:Body>
</s:Envelope>
Redeeming a coupon doesn’t necessarily mean the status changes to ‘redeemed’. As mentioned earlier a
coupon can be redeemed multiple times (if configured accordingly).
Note: you can use this function only if the last action on the specified coupon was a redemption. It is never
possible to reverse more than one step in the lifecycle of a coupon.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:CancelRedeemCoupon>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:Parameters>
<eac:Barcode>9999459231533836726</eac:Barcode>
<eac:OperatorId>Server01</eac:OperatorId>
<eac:PosId>Web</eac:PosId>
<eac:ShopId>9999</eac:ShopId>
</eac:Parameters>
<eac:CancelRedeemParameters>
<eac:RedeemId>69feff1a-0ae2-4f7c-8189-c8c23cc81604</eac:RedeemId>
</eac:CancelRedeemParameters>
</eac:CancelRedeemCoupon>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CancelRedeemCouponResponse xmlns="http://cowhills.nl/EAccount">
<CancelRedeemCouponResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</CancelRedeemCouponResult>
</CancelRedeemCouponResponse>
</s:Body>
</s:Envelope>
Function: CreateAndActivateOnDemandCoupon
This function is used for creating a coupon on-demand. For example if the result of a promotional event
requires the generation of a coupon as opposed to immediate financial benefit. This eliminates the need for
Coupons generated this way are automatically activated, this is by design. It is not possible to generate on-
demand coupons with different statuses. Also, generation is only allowed if the series is contained in a batch of
type OnDemand. If the batch is not configured correctly the error code NotFound will be returned, this means
the consuming system (POS) needs to take this into account. This code is also returned when a batch is full, i.e.
the predefined maximum number of coupons has been reached.
It’s recommended to check coupon settings in the management system prior to using them. This way you can
verify if a batch is missing or almost at its max, enabling you to take proper action.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:CreateAndActivateOnDemandCoupon>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</eac:CouponRangeId>
<eac:CreateAndActivateCouponParameters>
<eac:ValidFrom>2015-04-01T00:00:00</eac:ValidFrom>
<eac:ValidUntill>2015-04-30T23:59:59</eac:ValidUntill>
</eac:CreateAndActivateCouponParameters>
<eac:Parameters>
<eac:OperatorId>Server01</eac:OperatorId>
<eac:PosId>Web</eac:PosId>
<eac:ShopId>9999</eac:ShopId>
</eac:Parameters>
</eac:CreateAndActivateOnDemandCoupon>
</soapenv:Body>
</soapenv:Envelope>
CouponRangeId The coupon series for which the coupon is generated. String
CreateAndActivateCoupon- The optional parameter to set the expiration date for a DateTime
Parameters.ValidUntill coupon.
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateAndActivateOnDemandCouponResponse xmlns="http://cowhills.nl/EAccount">
<CreateAndActivateOnDemandCouponResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
ActivationId The unique ID assigned to the activation. This value can String
be used to cancel activation.
Function: GenerateCoupons
This function is used to trigger coupon generation. A batch ID will be returned to identify the newly created
batch. The actual generation of the coupon batch will be delegated to the background process to balance the
load on the platform. It can take up to a few minutes before the new batch can be used by/in other systems.
Status updates of the batches can be requested using the GetCouponBatches function. The GetCoupons
function can be used to request information on specific coupons.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GenerateCoupons>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:RangeInfo>
<eac:AutoActivate>false</eac:AutoActivate>
<eac:BatchMode>OnDemand</eac:BatchMode>
<eac:CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</eac:CouponRangeId>
<eac:MaxRedeemCount>1</eac:MaxRedeemCount>
<eac:NumberOfCoupons>500</eac:NumberOfCoupons>
<eac:OperatorId>Server01</eac:OperatorId>
<eac:Prefix>99999</eac:Prefix>
<eac:SerialNumberDigits>10</eac:SerialNumberDigits>
<eac:ValidUntill>2015-04-30T23:59:59</eac:ValidUntill>
</eac:RangeInfo>
</eac:GenerateCoupons>
</soapenv:Body>
</soapenv:Envelope>
NumberOfCoupons The number of coupons in the batch; this value must be Int
absolute and cannot exceed 1.000.000.
Prefix The prefix for the coupon, this value is mandatory. String
SerialNumberDigits The number of digits the serial number must consist of. Int
The value needs to be between 5 and 25.
ValidUntill The mandatory expiration date, after this date the DateTime
coupons cannot be redeemed anymore.
The value must be between 00:00 the next day and five
years from now (start of day).
CouponRangeId The generic coupon identifier for the generated coupons. String
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GenerateCouponsResponse xmlns="http://cowhills.nl/EAccount">
<GenerateCouponsResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CouponBatchId>a91f99f5-fd92-43ef-ac20-9d45b19c624d</CouponBatchId>
<ReturnCode>Success</ReturnCode>
</GenerateCouponsResult>
</GenerateCouponsResponse>
</s:Body>
</s:Envelope>
Function: GetCouponBatches
The GetCouponBatches function provides functionality to query which batches exist for coupon series.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetCouponBatches>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</eac:CouponRangeId>
</eac:GetCouponBatches>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetCouponBatchesResponse xmlns="http://cowhills.nl/EAccount">
<GetCouponBatchesResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CouponBatchInfo>
<BatchId>1d141121-f220-4bc3-857f-478999912639</BatchId>
<BatchMode>PreGenerated</BatchMode>
<BatchStatus>Ready</BatchStatus>
<CouponCount>50</CouponCount>
<CouponCreatedCount>50</CouponCreatedCount>
<CreatedAt>2015-03-26T11:36:55</CreatedAt>
<OperatorId>PV2</OperatorId>
<ValidUntill>2015-04-09T00:00:00</ValidUntill>
</CouponBatchInfo>
<CouponBatchInfo>
<BatchId>b2fc83fa-e1d5-42c5-8a97-a55860852f14</BatchId>
<BatchMode>OnDemand</BatchMode>
<BatchStatus>Pending</BatchStatus>
<CouponCount>1000</CouponCount>
<CouponCreatedCount>1</CouponCreatedCount>
<CreatedAt>2015-04-01T08:35:14</CreatedAt>
<OperatorId>PV2</OperatorId>
<ValidUntill>2015-04-15T00:00:00</ValidUntill>
</CouponBatchInfo>
The result message contains a collection of CouponBatchInfo entities. The following properties will be returned
per batch:
CouponCount The number of coupons in the batch, this represents the Int
theoretical maximum size of the batch.
Function: GetCouponCount
This function can be used to request information regarding the number of coupons within a batch.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetCouponCount>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</eac:CouponRangeId>
<eac:BatchId>1d141121-f220-4bc3-857f-478999912639</eac:BatchId>
<eac:Status>Active</eac:Status>
</eac:GetCouponCount>
</soapenv:Body>
</soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetCouponCountResponse xmlns="http://cowhills.nl/EAccount">
<GetCouponCountResult>50</GetCouponCountResult>
</GetCouponCountResponse>
</s:Body>
</s:Envelope>
Function: GetCouponInfo
The GetCouponInfo function is used for requesting information of a single coupon.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetCouponInfo>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:Parameters>
<eac:Barcode>9999459231533836726</eac:Barcode>
<eac:OperatorId>Server01</eac:OperatorId>
<eac:PosId>Web</eac:PosId>
<eac:ShopId>9999</eac:ShopId>
</eac:Parameters>
</eac:GetCouponInfo>
Example of a result:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetCouponInfoResponse xmlns="http://cowhills.nl/EAccount">
<GetCouponInfoResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Coupon>
<Barcode>9999459231533836726</Barcode>
<CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</CouponRangeId>
<CreatedAt>2015-03-26T11:36:57</CreatedAt>
<MaxRedeemCount>3</MaxRedeemCount>
<RedeemCount>0</RedeemCount>
<SerialNumber>459231533836726</SerialNumber>
<Status>Active</Status>
<ValidFrom i:nil="true"/>
<ValidUntill>2015-04-09T00:00:00</ValidUntill>
</Coupon>
<CouponHistory>
<CouponHistoryEvent>
<Comment i:nil="true"/>
<OperatorId>PV2</OperatorId>
<PosId i:nil="true"/>
<ReceiptNr i:nil="true"/>
<ShopId i:nil="true"/>
<Stamp>2015-03-26T11:36:57</Stamp>
<StatusNew>Created</StatusNew>
<StatusOld>Created</StatusOld>
</CouponHistoryEvent>
<CouponHistoryEvent>
<Comment>Test comment</Comment>
<OperatorId>Server01</OperatorId>
<PosId>Web</PosId>
<ReceiptNr i:nil="true"/>
<ShopId>9999</ShopId>
<Stamp>2015-04-01T09:17:32</Stamp>
<StatusNew>Active</StatusNew>
<StatusOld>Active</StatusOld>
</CouponHistoryEvent>
</CouponHistory>
<ReturnCode>Success</ReturnCode>
</GetCouponInfoResult>
</GetCouponInfoResponse>
</s:Body>
</s:Envelope>
Function: GetCoupons
This function can be used to query multiple coupons in a series/batch.
CouponRangeId The series for which coupons are being requested. String
BatchId The batch for which coupons are being requested. String
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetCoupons>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:CouponRangeId>ca6b4b57-eb89-4528-82bb-51f43e91770d</eac:CouponRangeId>
<eac:BatchId>1d141121-f220-4bc3-857f-478999912639</eac:BatchId>
<eac:Status>Active</eac:Status>
</eac:GetCoupons>
</soapenv:Body>
</soapenv:Envelope>
Depending on how many coupons match the predicate, a result message will be sent. The result can contain
zero, one or multiple CouponInfo elements. The CouponInfo complex type is explained in the corresponding
paragraph.
Example of a response:
Function: ResetRedeemCount
This function is used to reset the registered number of redemptions for a single coupon. It can be embedded in
the coupon management.
▪ Active
▪ Redeemed
▪ PartiallyRedeemed
Voided coupons (status: Void) cannot be reset, in this case WrongStatus will be returned.
ResetRedeemCount- Any comments provided for the operation. This is saved String
Parameters.Comment in the coupon history and will be shown when
GetCouponInfo is called.
Example of a request:
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ResetRedeemCountResponse xmlns="http://cowhills.nl/EAccount">
<ResetRedeemCountResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</ResetRedeemCountResult>
</ResetRedeemCountResponse>
</s:Body>
</s:Envelope>
Function: VoidCouponBatch
This function is used to void a batch of coupons.
Function: UploadCoupons
This function is used to upload coupons in the Treazure system. It requires a batch with mode = manual to be
present for a specific coupon batch ID.
ValidUntill The date/time untill the coupon is valid. If not supplied DateTime
the validity of the batch is used.
ValidFrom The date/time untill the coupon is valid. If not supplied DateTime
the validity of the batch is used.
The coupon upload is executed in full: all coupons are either succesfully uploaded or all coupons fail the upload.
If one coupon fail the upload validations (for instance: barcode already present in system) all coupons fail the
upload.
You can only upload up to 100 coupons at one time. If more coupons should be uploaded the upload-function
should be executed multiple times.
Function: VoidCoupons
This function is used for voiding individual coupons. A coupon is identified by it’s serial number. Up to 100
coupons can be voided at once.
The void is executed in full: all coupons are either succesfully voided or all coupons fail the void. If one coupon
fail the void validations (for instance: coupon already void) all coupons fail the void.
The API doesn’t store promotional events, responsibility lies with the POS (consuming) system for that matter.
It is also no apprised of any redeem limitations, this is also the responsibility of the consuming (POS) system.
If the PemCalculation API is used, information available there can be hooked up to the CustomerVoucher API
directly. Each customer voucher has a limited validity, this validity is returned upon registration as the
previously specified expiration date/time.
Please note: this API is not meant to issue unique codes to customer, this should be done using the Coupon
API.
Function: RedeemCustomerVoucher
This function is used to redeem customer vouchers, it can be integrated in a check-out process.
RedeemCount The number to redeem, this cannot be lower than -1000, Int
exactly 0 or exceed 1000.
VoucherId The unique ID of the voucher for which the number String
needs to be registered.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:RedeemCustomerVoucher>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:RedeemRequest>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<RedeemCustomerVoucherResponse xmlns="http://cowhills.nl/EAccount">
<RedeemCustomerVoucherResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<RedeemCount>6</RedeemCount>
<ReturnCode>Success</ReturnCode>
</RedeemCustomerVoucherResult>
</RedeemCustomerVoucherResponse>
</s:Body>
</s:Envelope>
Function: GetCustomerVouchers
The GetCustomerVoucher function is used to query all known and valid (i.e. not expired) customer vouchers for
a single customer.
Multiple vouchers can be queried at once, they are selected using the voucher ID’s. The ID’s can be requested
via the PemCalculation API using the operation GetPemEntryCodesForCustomerCardLimit. For more
information please check the user case concerning promotion limitations and customer cards.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount"
xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<soapenv:Header/>
<soapenv:Body>
<eac:GetCustomerVouchers>
<eac:Auth>dcbc9f3c-c136-47ab-a6d6-23592f865f52</eac:Auth>
<eac:CustomerId>Customer0000001</eac:CustomerId>
<eac:VoucherIds>
<arr:string>Promotion-001</arr:string>
<arr:string>Promotion-002</arr:string>
</eac:VoucherIds>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetCustomerVouchersResponse xmlns="http://cowhills.nl/EAccount">
<GetCustomerVouchersResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
<Vouchers>
<CustomerVoucher>
<ExpirationDate>2016-01-01T00:00:00</ExpirationDate>
<RedeemCount>6</RedeemCount>
<VoucherId>Promotion-001</VoucherId>
</CustomerVoucher>
</Vouchers>
</GetCustomerVouchersResult>
</GetCustomerVouchersResponse>
</s:Body>
</s:Envelope>
Vouchers Zero, one or more vouchers. Known and valid (i.e. not Complex
expired) vouchers will be returned. If a voucher is not
found, nothing will be returned regarding that voucher.
Therefore vouchers not in the response need to be
regarded as vouchers with a redemption count of 0.
Voucher.RedeemCount The number of times the voucher has been redeemed. Int
The result of the operation can be forwarded to (for example) the PemCalculcation API using the PriorUse
elements. This method returns any known limitation for the customer card and how many times it has been
used in calculation. This information must be used to call the redeem function.
PrePublish
Each request fort his API can be provided with a PrePublish parameter. This parameter defined whether the
Treazure pre-pubish environment is to be used or not. For more information please check the
PemConfiguration API.
Please note: if Treazure is populated from an external system (e.g. the Retail Online Suite) pre-publishing is not
available. In this case a license error will be returned, see the below example:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:LicenseRequired</faultcode>
<faultstring xml:lang="en-US">License 'Pem' required</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
Function: Calculate
The calculate function, as the name implies, takes care of calculcating the benefit for the customer. A basket is
offered to the API by the consuming system and the result consists of the same basket and the applied
promotional discounts (i.e. discounts and/or vouchers).
The calculate function is stateless; i.e. every request needs the whole basket and no information is kept in
memory on any basket.
Note: the calculcation function is the only one which does not require an active session, but can be performed
with an API key instead. Thus removing the need to log on and log off, deviating from the normal procedure
which all other functions use.
7.2.2 Timeout
A calculcation request has a configured maximum execution time, to prevent overloads. The internal timeout
has been set to 1s (one second), which, normally, is more than enough.
When a timeout occurs the status code InternalError will be returned. There are two possible responses:
• TRZ timeout; this is a client timeout, the Treazure environment did not receive a response in a timely
manner.
• Engine timeout; this indicates a backend timeout, for example if a calculation took too long causing
the engine to cancel the operation.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="InternalError">
<ErrorMessage>TRZ timeout</ErrorMessage>
CalculationRequest
The Calculate function is used to calculcate a result based on the contents of the sent basket. The input is
defined in the CalculationRequest structure.
The structure consists of several different components, we will be discussing these in the next few paragraphs.
LanCode The language code in which the result needs to String Yes
be given. The code needs to be configured in
Treazure, all other codes are not (yet)
supported.
1) this value is mandatory when promotions for all stores are uploaded, else the value is disregarded.
<pem:CustomerCards>
<pem:CustomerCard>
<pem:Uid>CustomerCard001</pem:Uid>
</pem:CustomerCard>
</pem:CustomerCards>
7.3.3 AirmilesCards
It is possible to add Airmiles cards to the calculation. The interface offers to possibilities to add any (absolute)
number of cards. However at this point only the first registered card will be used.
<pem:AirmilesCards>
<pem:AirmilesCard>
<pem:Uid>Air_01</pem:Uid>
<pem:Balance>5900</pem:Balance>
<pem:ValuePerUnit>1</pem:ValuePerUnit>
<pem:PointsPerUnit>100</pem:PointsPerUnit>
</pem:AirmilesCard>
</pem:AirmilesCards>
For example:
7.3.4 EmployeeCards
It is possible to submit multiple employee cards (i.e. EmployeeCard elements) to the calculation.
<pem:EmployeeCards>
<pem:EmployeeCard>
<pem:Uid>EMP001</pem:Uid>
<pem:DiscountPercentage>6000</pem:DiscountPercentage>
<pem:EmployeeDiscountType>Regular</pem:EmployeeDiscountType>
</pem:EmployeeCard>
</pem:EmployeeCards>
7.3.5 Sales
The Sales element allows for submission of sale lines. Normally promotions will be assigned to these elements.
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale_001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>12500</pem:Amount>
<pem:Count>1</pem:Count>
<pem:Flags>
<pem:Flag>AirmilesLoyalty</pem:Flag>
</pem:Flags>
<pem:AirmilesPayment>
<pem:MaxPercentage>1000</pem:MaxPercentage>
</pem:AirmilesPayment>
</pem:Sale>
<pem:Sale>
<pem:Uid>Sale_002</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>5999</pem:Amount>
<pem:Count>1</pem:Count>
<pem:Flags>
<pem:Flag>AirmilesLoyalty</pem:Flag>
</pem:Flags>
<pem:AirmilesPayment>
<pem:MaxPercentage>2500</pem:MaxPercentage>
</pem:AirmilesPayment>
</pem:Sale>
</pem:Sales>
GroupId The ID of the article group (lowest level in the String Yes
hierarchy) of the article as known in the master
data. It must be the lowest level, because the API
is unaware of the assortment (hierarchy and
otherwise).
Amount The gross amount of the sale line in centimes. Int Yes
Count The number of articles (with the same article ID). Int Yes
This value is limited to 999. Any higher number
will result in a response code
InvalidParameterValue.
7.3.5.1 Attribs
A Sale element can have certain sale attributes; Attribs. These are predefined on retailer level.
<pem:Attribs>
<pem:Attrib>
<pem:Type>ProductieMaand</pem:Type>
<pem:Value>Jan</pem:Value>
</pem:Attrib>
</pem:Attribs>
Type The type of the attribute, this value is case sensitive. String Yes
Value The value of the attribute, this value is also case String Yes
sensitive.
7.3.5.2 Flags
A Sale element can be supplemented with certain flags, these flags allow for the submission of specific
discount rules (whether or not specific discounts are allowed):
<pem:Sale>
<pem:Uid>Sale_001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>12500</pem:Amount>
<pem:Count>1</pem:Count>
<pem:Flags>
<pem:Flag>AirmilesLoyalty</pem:Flag>
</pem:Flags>
</pem:Sale>
AirmilesLoyalty Whether or not Airmiles can be saved on the sale By default no Airmiles will
line. be saved.
DenyDiscount Whether or not any discount is allowed on the By default discounts are
sale line. allowed.
7.3.5.3 AirmilesPayment
This element makes it possible to add optional control values for calculating Airmiles payments/discount
calculations.
<pem:AirmilesPayment>
<pem:AirMilesToRedeem>100</pem:AirMilesToRedeem>
</pem:AirmilesPayment>
AirMilesToRedeem The number or Airmiles that will be used to calculate the actual Int
Airmiles discount/payment
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>3000</pem:Amount>
<pem:Count>3</pem:Count>
<pem:Discounts>
In this example three articles of 10,- are in the basket. These articles have markdown prices of 7,50 per article
and the new price of the set is 22,50. This value needs to take the amount of articles in account.
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="750" Count="3" Type="Plu">
<Ref Uid="Sale001" Tier="-500"/>
</Result>
</FinancialResults>
</CalculateResult>
As seen in the above result the total amount for the sale line is 7,50, divided over three lines, of the type Plu.
7.3.5.4.2 NewPrice
With a NewPrice line discount it is possible to specify a new price on line level and get the difference as a
discount.
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>3000</pem:Amount>
<pem:Count>3</pem:Count>
<pem:Discounts>
<pem:Discount>
<pem:Type>NewPrice</pem:Type>
<pem:Uid>PLU001</pem:Uid>
<pem:NewPrice>2250</pem:NewPrice>
<pem:DiscountId>MyDiscountId</pem:DiscountId>
</pem:Discount>
</pem:Discounts>
</pem:Sale>
</pem:Sales>
7.3.5.4.3 EmployeeDiscount
It’s possible to specify an employee discount percentage on line level. This requires an employee card to be
present in that basket.
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>3000</pem:Amount>
<pem:Count>3</pem:Count>
<pem:Discounts>
<pem:Discount>
<pem:Type>EmployeeDiscount</pem:Type>
<pem:Uid>PLU001</pem:Uid>
<pem:Percentage>1250</pem:Percentage>
<pem:DiscountId>MyDiscountId</pem:DiscountId>
</pem:Discount>
</pem:Discounts>
</pem:Sale>
7.3.6 Discounts
The Discounts element allows for definition of explicit discounts for the whole receipt. I.e. if a pre-set amount
of discount applies to a single transaction. The element has the following properties:
DiscountId The discount code, this code is returned in the response for String
registrational purposes. The value is optional.
ValuePerUnit The value in centimes for the number of Airmiles defined in the Int No
PointsPerUnit element valid for airmiles discount/payment for receipt
discounts
PointsPerUnit The number of Airmiles in centimes used to define the ValuePerUnit Int No
for receipt discounts
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="true">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:GroupId>GROUP001</pem:GroupId>
<pem:Amount>10000</pem:Amount>
<pem:Count>1</pem:Count>
</pem:Sale>
</pem:Sales>
<pem:Discounts>
<pem:Discount>
<pem:Type>Amount</pem:Type>
<pem:DiscountId>CustomDiscount-1</pem:DiscountId>
<pem:Uid>Discount001</pem:Uid>
<pem:Amount>1500</pem:Amount>
</pem:Discount>
<pem:Discount>
<pem:Type>Percentage</pem:Type>
<pem:DiscountId>CustomDiscount-2</pem:DiscountId>
<pem:Uid>Discount002</pem:Uid>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="1500" Count="1" Type="ReceiptAmount" DiscountId="CustomDiscount-1">
<Ref Uid="Sale001" Tier="150"/>
</Result>
<Result Amount="850" Count="1" Type="ReceiptPercentage" DiscountId="CustomDiscount-2">
<Ref Uid="Sale001" Tier="160"/>
</Result>
<Result Amount="956" Desc="Bonus op 10187055003" Count="1" Type="Promotion">
<Ref Uid="Sale001" Tier="200" Code="Bonus_10187055003"/>
</Result>
</FinancialResults>
<Summary>
<PerPemEntry>
<Entry Code="Bonus_10187055003" QtyThis="1" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
• 8,50; 10% on the remaining 85,- (100,- minus the 15,- amount discount)
• Promotional discount of 9,56; 12,5% discount on the remaining 76,50 (85,- minus 8,50; the previously
applied 10% discount)
7.3.7 Coupons
It is possible to add coupons to a calculation request.
<pem:Coupons>
<pem:Coupon>
<pem:Uid>COUPON_0001</pem:Uid>
<pem:CouponId>25%MetCoupon</pem:CouponId>
</pem:Coupon>
</pem:Coupons>
Promotion can be configured in a way that they trigger on a specific coupon being used. In the example a
coupon of the type ‘25%MetCoupon’ is used, in this example the coupon is already known in the configuration.
In order to process the coupon in the calculation the following steps will be taken:
The coupons used are returned in the response using the value TriggerCouponIds. This can be used to validate
if a coupon is actually used, this way the used coupons can be collected by the supplier (either Treazure or a
third party). For more information on the matter see the paragraph regarding CalculationResponse.
7.3.8 TransactionAttributes
It is possible to have promotions trigger on certain (customer) characteristics provided by the consuming
system. For example, having a promotion trigger on the birthday of a customer. The service does not keep
track of any of these events, they have to be provided (in a TransactionAttribute) and configured in order to
trigger correctly.
1) In the Treazure promotion configuration an event has been configured to trigger if the transaction
attribute ‘VANDAAG_JARIG’ exists.
3) The consuming system knows today is the birthday of the customer and adds the transaction
attribute ‘VANDAAG_JARIG’ to the transaction and thus the request to Treazure.
In this case the promotion will trigger, because the needed attribute has been supplied.
Value The trigger value of the transaction attribute (e.g. VANDAAG_JARIG). String
7.3.9 PriorUses
A promotion can be limited to a fixed number of times it can trigger per customer. Treazure, being stateless,
does not keep track of this. Meaning that the consuming system must keep track of how many times a
promotion is used by a certain customer.
In the configuration it is possible to take prior uses and limitations into account.
2) For each previously used promotion a PemPriorUse element is registered in the request.
In the result promotions limited on how many times they may be triggered are clearly identified. It is therefore
of the utmost importance that the consuming system unambiguously communicates the prior uses of each
promotion, if applicable. For more information see the corresponding paragraph; PromotionSummary results.
7.3.10 ShippingCosts
This element allows for specification of shipping costs, it is for example, possible for a retailer to configure
specific shipping costs promotions.
<pem:ShippingCosts>
<pem:ShippingCost>
<pem:Uid>Ship001</pem:Uid>
<pem:Amount>1500</pem:Amount>
</pem:ShippingCost>
</pem:ShippingCosts>
It’s possible to submit multiple ShippingCost elements, discounts however will always be combined into one
discount element.
An example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult seqNr="14" code="Success">
<FinancialResults>
<Result Amount="1499" Desc="Laag 4, Coupon geeft 25%!!!" Count="1"
DiscountType="Promotion">
<Ref uid="Sale001" tier="50000" code="013"/>
<TriggerCouponIds>
<CouponId>123654789</CouponId>
</TriggerCouponIds>
</Result>
</FinancialResults>
<DiscountVoucherResults>
<Result Amount="300">
<Ref uid="Sale001" tier="0" code="LoyaltyNLAV"/>
</Result>
</DiscountVoucherResults>
<Summary>
<PerPemEntry>
<Entry code="013" qtyThis="1" type="Financial"/>
<Entry code="LoyaltyNLAV" qtyThis="1" type="DiscountVoucher"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
ErrorMessage If an error occurred this field will contain additional information. String
The result will contain assigned promotion line, we will be attending to those in the next few paragraphs.
<FinancialResults>
The Ref element is used to communicatie generic information regarding an assiged promotion.
Uid The identifier of the element in the request to which the assigned String
promotion belongs.
Tier The tier on which the promotion has been applied. This can be used to Int
trace back the order in which promotional discounts have been
assigned. The higher the value, the lower in the chain the promotion was
applied.
Code The promotion code of the result. This value can be empty if the String
discount was supplied; for example in the case of a markdown price.
Gid Grouping identifier. This field is to be used for splitting up the items Int
based on assigned discounts.
BaseAmt The base amount in cents for this result. This value is conditional and is Int
for instance returned with an employeecard-discount.
7.4.2 Warnings
Upon calculation it is possible that warnings are generated. For example if an unused language code is
submitted, since calculation can actually continue a warning instead of an error is generated. Note that this is
only one possibility, the example shows another one.
Example of a warning:
<Warnings>
<Err Msg="No sales"/>
</Warnings>
Msg The warning in tekst, this is a technical message and always in English. It String
is not meant as a textual representation for the end-user.
To summarize:
<FinancialResults>
<Result Amount="1499" Desc="Coupon geeft 25%!!!" Count="1" Type="Promotion">
<Ref Uid="Sale001" Tier="50000" Code="013"/>
<TriggerCouponIds>
<CouponId>123654789</CouponId>
</TriggerCouponIds>
</Result>
</FinancialResults>
Desc The description of the discount, in the language selected in the String
request (i.e. matching the language code provided).
• Promotion
• EmployeeCard
• CustomerCard
• Plu (markdown)
• ReceiptAmount
• LoyaltyManualAmount (a.o. Airmiles product discounts)
• AirMilesReceiptAmount
TriggerCouponIds If the promotion was triggered by coupons, this element shows String[]
which coupons were ‘used’. It is a reliable indication of which
coupons need to be redeemed.
DiscountId If a discount has been submitted the explicit code is shows in this String
element.
TransactionAttributes The transaction attributes that were used by this financial Complex[]
promotion.
Display The display level of the financial promotion, if specified in the Enum
promotion configuration.
• OnHeader
Please note that this does not affect the way the discounts are
specified: discounts will always be specified on detail level; this
setting merely indicates that these discounts should be
summarized and displayed to the customer on header level.
BookingType The booking type the promotion is setup for. This determines String
how the discount should be booked logically.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="false">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>999</pem:ArticleId>
<pem:Amount>9900</pem:Amount>
<pem:Count>1</pem:Count>
</pem:Sale>
</pem:Sales>
<pem:ShippingCosts>
<pem:ShippingCost>
<pem:Uid>Ship001</pem:Uid>
<pem:Amount>1000</pem:Amount>
</pem:ShippingCost>
</pem:ShippingCosts>
</pem:Request>
</pem:Calculate>
</soapenv:Body>
</soapenv:Envelope>
If a discount on shipping costs has been applied this is applied to the Uid of the shipping costs in a
FinancialResult element. For example:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult SeqNr="6" Code="Success">
<FinancialResults>
<Result Amount="500" Count="1" Type="Promotion">
<Ref Uid="Ship001" Tier="0" Code="50%verzendkosten"/>
</Result>
</FinancialResults>
<Summary>
<PerPemEntry>
<Entry Code="50%verzendkosten" QtyThis="1" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
<LoyaltyResults>
<Result Desc="Airmiles (Diamant)" Amount="4485" Type="Regular" Program="Airmiles">
<Ref Uid="Sale_002" Tier="-75000" Code="AIRDMT"/>
</Result>
<Result Desc="Airmiles (Diamant)" Amount="11215" Type="Regular" Program="Airmiles">
<Ref Uid="Sale_001" Tier="-75000" Code="AIRDMT"/>
</Result>
</LoyaltyResults>
Some examples:
Some examples:
Count The number of items this loyalty result applies to. Int
7.4.5 IssuedCouponResult
If a calculation results in the issuance of one or more coupons, it is found in this element. A coupon element
has the following properties:
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="true">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>10000</pem:Amount>
<pem:Count>1</pem:Count>
</pem:Sale>
</pem:Sales>
</pem:Request>
</pem:Calculate>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="1250" Desc="Bonus op 10187055003" Count="1" Type="Promotion">
<Ref Uid="Sale001" Tier="200" Code="Bonus_10187055003"/>
</Result>
</FinancialResults>
<IssuedCouponResults>
<Result CouponId="KoffieCouponCode0064">
<Ref Uid="Sale001" Tier="250" Code="CouponVoorGratisKoffie"/>
</Result>
</IssuedCouponResults>
<DiscountVoucherResults>
<Result Amount="875">
<Ref Uid="Sale001" Tier="260" Code="10%KortingsVoucher"/>
</Result>
</DiscountVoucherResults>
<Summary>
<PerPemEntry>
<Entry Code="CouponVoorGratisKoffie" QtyThis="1" Type="IssueCoupon"/>
<Entry Code="10%KortingsVoucher" QtyThis="1" Type="DiscountVoucher"/>
<Entry Code="Bonus_10187055003" QtyThis="1" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
• A financial promotion
• A coupon
• A discount voucher with a value of 8,75; 10% over 87,50 (100,- minus 12,50)
7.4.7 TypeValueResult
This type indicates a generic type value promotion has been allotted. This type of promotion (result) can be
used to define an own result in de the Pem API. For example if the customer qualifies for a specific news letter.
<TypeValueResults>
<Result Type="T" Value="01">
<Ref Uid="Sale_001" Tier="0" Code="TypeValueTest01"/>
</Result>
</TypeValueResults>
7.4.8 ExtraArticleResult
This type indicates the client has been assigned a promotion for an additional article to be bought for a reduced
amount or to receive it for free.
Example:
<ExtraArticleResults>
<Result Price="0" Desc="Give-Away">
<Ref Uid="Sale001" Tier="-65000" Code="GA" Gid="0"/>
<Options>
<Option ArticleId="014467" ColorId="*" SizeId="*"/>
<Option ArticleId="014468" ColorId="*" SizeId="*"/>
<Option ArticleId="015461" ColorId="*" SizeId="*"/>
</Options>
</Result>
</ExtraArticleResults>
Price The price in cents the extra article can be bought for. Can be zero for free Int
articles.
Options- The articles to pick from. ColorId and SizeId can be wildcards (‘*’) or String
>ArticleId, target a specific article variant.
ColorId and
SizeId
7.4.9 MessageResult
This type indicates a configured message has been triggered by the system.
Example:
<MessageResults>
<Result Desc="Melding alcohol" Msg="Let op: je hebt een alcoholisch artikel aangeslagen. De klant is
verplicht zich te legitimeren, indien je niet zeker bent of de klant ouder is dan 18 jaar.">
<Ref Uid="Sale001" Tier="-100156" Code="Melding"/>
</Result>
</MessageResults>
7.4.10 Summary
The calculation result also provides a total overview of the discounts applied in the form of a summary.
<Summary>
<PerPemEntry>
<Entry Code="AIRDMT" QtyThis="1" Type="Loyalty"/>
</PerPemEntry>
<AirmilesPayment>2750</AirmilesPayment>
</Summary>
Keep in mind that the value of the airmiles payment is returned in the
local/configured currency; the consuming system needs to convert these
to the actual amount of airmiles used.
• Financial
• TypeValue
• Loyalty
• IssueCoupon
• DiscountVoucher
The type matches the structure of the result.
QtyThis The number of times this promotion has been used in the calculation. Int
QtyLimit The maximum number of times this promotion can be used. This value Int
can only be returned if a limit has been defined for customer card
holders.
QtyPrior The number of times this promotion has been used prior to the current Int
calculation. This information is submitted in PriorUse elements in the
calculation request. If this information is not submitted, it will not be
included in the result.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>***</pem:Auth>
<pem:Request LanCode="nl-NL" UsePrePublish="false">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10370</pem:ArticleId>
<pem:Amount>20000</pem:Amount>
<pem:Count>4</pem:Count>
</pem:Sale>
</pem:Sales>
</pem:Request>
</pem:Calculate>
</soapenv:Body>
</soapenv:Envelope>
The Gid-values indicate that the original order sale should be split up on the order. This result should be
interpreted and processed as follows:
Function: GetInfo
This function allows for functionality to retrieve promotional information on an article. It is an informative
function and can thus be used independently from the basket functions.
This function has the same environmental parameters as the calculcate function. Therefore UsePrePublish,
LanCode, SiteId and CalculationMoment can be used to suit your needs.
The article for which the information is requested must be submitted in the Article element. This element is
identical to the Sale element in terms of structure.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:GetInfo>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request UsePrePublish="true" LanCode="nl">
<pem:Article>
<pem:Uid>Sale_001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:GroupId>GROUP001</pem:GroupId>
<pem:Amount>5999</pem:Amount>
<pem:Count>1</pem:Count>
</pem:Article>
</pem:Request>
</pem:GetInfo>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetInfoResponse xmlns="http://cowhills.nl/EAccount/PEM">
<GetInfoResult Code="Success">
<AvailablePemEntries>
<PemEntry Code="20%metcoupon" Desc="20% korting op laarzen met coupon"
Type="Financial"/>
<PemEntry Code="5EuroKortingOpArtikel10187055003" Desc="Korting op art no 10187055003"
Type="Financial"/>
<PemEntry Code="Bonus_10187055003" Desc="Bonus op 10187055003" LongDesc="Dit is de
lange omschrijving" Type="Financial"/>
</AvailablePemEntries>
</GetInfoResult>
</GetInfoResponse>
</s:Body>
</s:Envelope>
As shown above a collection of PemEntry elements is returned. The following properties exist for each of those
elements:
LongDesc The long (more verbal) description of the promotion. The contents of this String
field will never be returned in the Calculate function, it is purely
informational.
This value will typically be used to provide the cashier more extensive
information regarding the promotion.
Type The type of the promotion. See paragraph CalculationResponse for Enum
possible return values.
Function: GetPemEntryCodesForCustomerCardLimit
This operation is used to request promotion codes which are limited for customer card holders. The result can
be used to retrieve prior uses if a customer is registered in the consuming system.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:GetPemEntryCodesForCustomerCardLimit>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request UsePrePublish="true"/>
</pem:GetPemEntryCodesForCustomerCardLimit>
</soapenv:Body>
</soapenv:Envelope>
It is possible to use the UsePrePublish attribute in the request, usage is the same a in the Calculate operation.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetPemEntryCodesForCustomerCardLimitResponse xmlns="http://cowhills.nl/EAccount/PEM">
<GetPemEntryCodesForCustomerCardLimitResult Code="Success">
<PemEntryCodes>
<Code>10xperklant</Code>
</PemEntryCodes>
</GetPemEntryCodesForCustomerCardLimitResult>
</GetPemEntryCodesForCustomerCardLimitResponse>
</s:Body>
</s:Envelope>
Function: CouponExists
This operation can be used to verify whether a coupon code is currently in the active promotion configuration.
This function can be used by web apps to verify that the used coupon is actually known in a running promotion.
Please note this function has no relation with the coupon API.
Example of a request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:CouponExists>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request UsePrePublish="false" Code="CouponRangeId" />
</pem:CouponExists>
</soapenv:Body>
</soapenv:Envelope>
Example of a response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CouponExistsResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CouponExistsResult Code="Success" Exists="true" CouponId="CouponRangeId"
"CouponType"="Generic"/>
</CouponExistsResponse>
</s:Body>
</s:Envelope>
Note: this means you can verify generic coupons by filling in the barcode, unique coupons require you to query
the CouponRangeIdsee GetCouponInfo and use that string instead.
The result will indicate whether the specified coupon ID is a generic or a unique coupon. If the type of coupon is
unknown this field is omitted.
Please note that this API is only used if the PemCalculation API is not directly connected to a maintenance
system, like the Retail Online Suite (ROS). In that case the promotions can be maintained using the rCos client,
which is a user-friendly system designed to maintain any task performed at head-office.
Structure
The API uses so called Pem entries. A Pem entry can best be described as a promotion/benefit/campaign which
is triggered by the contents of/elements in the basket submitted to the web service. For example a discount
which is triggered only is a customer card is used.
Name Commentary
The filter structure is quite elaborate as it allows for AND- and OR-
constructions (logical con- and disjunction). See the Filter paragraph for
more information.
Tier The tier can be translated to a layer to which a promotion applies. Layer
being the abstract desciption of the concept. It influences priority and
exclusivity; promotions configured to the same tier can exclude one
another. In every calculation the best price for the customer is determined
and returned per tier.
This inevitably means that every tier will validate against the new prices
from the previous one, thus affecting the outcome of the following tier.
General settings Generic Pem settings configured per retailer. These settings include
parameters beyond the scope of a single promotion.
General settings
Beside the individual promotions, some settings can be maintained on a global scale. These settings can be
maintained using the GetPemConfiguration and PushPemConfiguration API’s.
Name Commentary
Sale attribute Attributes used in sales, these can, in turn, be used in promotion filters.
Filters
Filters are configured on entry level, requirements for each filter need to be met before a promotion can be
applied. For each configured filter a logical conjunction applies.
Within each filter details can be configured using so-called rules. Rules are the embodiment of the filter, they
contain the defined restrictions. Rules are applied using a logical disjunction.
There are many different rule types, all of which can be added to a filter without restrictions. If a rule type is
not specified, it means no limitation exists; for example if no customer card rule has been set, there will be no
filtering on customer cards.
Name Commentary
Coupon Limitation based on the fact if a certain coupon has been added to the
transaction.
Additionally each filter has the following properties which can be set:
Active Defines whether the filter is actually active. If not it Boolean Yes
will be ignored.
Name The name of the filter, this is only used for String Yes
registrational purposes and has no function on how
the filter operates. It is not found in any calculation
response.
For example:
• If the promotion must trigger on each article
(e.g. when applying a 1,- discount on each
article) both settings need to be set to 1;
MinOccurs=1, MaxOccurs=1
• If the promotion may only trigger once (e.g.
when issuing coupons) they must be set to:
MinOccurs=1, MaxOccurs=999. Assuming no
more than 999 articles will be added to a
transaction.
Identical Defines whether the occurances in the article filter Boolean No, default
only apply to identical articles. = false
For example:
• A promotion is configured for tins of paint,
buy two get one free. This applies to five
individual articles, they have been added tot
he filter. The filter has the Boolean value of
Identical set to true.
• A customer buys three different tins of paint
(all three articles exist in the rules); but since
they are not identical the promotion will not
trigger.
• A customer buys three tins of paint, all three
are the same article and exist as an article
rule; the promotion will trigger because they
are identical.
Article rules
An article rule has the following properties:
PluRequirement Defines how the rule deals with markdown prices Enum Yes
(PLU discounts).
GroupId The ID of the group from the hierarchy to which the String Yes
rule applies.
ArticleId The ID of the article for which the rule applies. String Yes
SizeId Specific limitation based on size codes. If not supplied String Yes
the wildcard character ‘*’ needs to be filled in.
It’s also possible to add SaleAttribute restrictions to a rule. The following properties apply to such an attribute:
Type The type of sale attribute, this type needs to be String Yes
configured in the general Pem settings.
Value The value to which the sale attribute has to comply. String Yes
It’s possible to use the wildcard character ‘*’ at the
start or end of the value. Evaluation of the value will
check if the value starts or ends with the supplied
value.
CustomerLevelIds The customer levels for which limitations apply. If String array No
not supplied this property is ignored.
Site rule
The site rule allows for filtering on the dimension Site. This way geographical limitations can be imposed,
restricting the area in which the promotion is in effect. A Site can be configured as an alphanumeric value.
(Pre)publication
The maintenance API’s allow for configuration of the promotions. Any changes made are instantly available in
calculation requests which use the UsePrePublish=true flag.
The pre-publish mode can be used to test the effect of promotions for a retailer. This can be incorporated in
the maintenance functions of promotions.
If the configuration is satisfactory, publication can commence. The PemPublish function is designed to do this.
PemPublish selects active promotions and general settings, validates them and – if validation is successful –
publishes the new configuration to the Treazure platform. Each publication is identified using a unique
sequence number.
A published configuration is replicated to all calculcation agents known to the system. Treazure is designed to
do this autonomously, within minutes the PemCalculation API will be loaded with the new configuration. The
configuration version will be returned with each calculation result, the value SeqNr should correspond to the
unique sequence number of the publication.
• Created
• Active
• Redeemed
• Void
• Expired
• Refunded
Function: GetGiftcardInfo
This function allows for the querying of giftcard information, this function will not change any data.
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetGiftcardInfo>
<eac:Auth>f0eb4369-46ec-4143-a171-1f79888dacf3</eac:Auth>
<eac:Parameters LanCode="nl-NL">
<eac:Barcode>9761003001RWCDXTDQ8UBTEAE</eac:Barcode>
</eac:Parameters>
</eac:GetGiftcardInfo>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetGiftcardInfoResponse xmlns="http://cowhills.nl/EAccount">
<GetGiftcardInfoResult>
<Giftcard>
<SerialNumber>RWCDXTDQ8UBTEAE</SerialNumber>
<Barcode>9761003001RWCDXTDQ8UBTEAE</Barcode>
<Status>Active</Status>
<ValidUntill>2021-12-31T00:00:00</ValidUntill>
<Balance>5000</Balance>
<BrandName>RetourBetaling</BrandName>
<Ean>9999312345</Ean>
<Refundable>false</Refundable>
<LoadType>Loadable</LoadType>
</Giftcard>
<ReturnCode>Success</ReturnCode>
</GetGiftcardInfoResult>
</GetGiftcardInfoResponse>
</s:Body>
</s:Envelope>
Function: ActivateGiftcard
This enables the selling of giftcards. There are two types of giftcards which can be sold:
• Preloaded
• Loadable
o The ‘LoadAmount’ needs to be set to the amount the customer wants to load on the card.
For this function a giftcard reference is needed. Depending on the giftcard product settings (setting
ActivateWithCardId) this is done with a unique card reference (barcode or serial number) or just the product
number (Ean).
Name Commentary
EAN The international article number (formerly known as: European Article Number).
This is used to identify the product (this cross check prevents selling the wrong
physical product for the activated barcode)..
ValidUntill The date this giftcard expires. The provided date is included in the validity period
(it expires at 23:59:59). This value is optional and if not provided the validity rules
of the product are honored.
Currency The currency for the loaded amount. This value is required if the product is
configured as such. This value has to match the product currency.
This function returns an ‘ActivationId’, this can be registered to enable troubleshooting later on. This is also the
ID which needs to be submitted to cancel the activation/sale.
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:ActivateGiftCard>
<eac:Auth>f0eb4369-46ec-4143-a171-1f79888dacf3</eac:Auth>
<eac:Parameters LanCode="nl-NL">
<eac:Barcode>9761003001RWCDXTDQ8UBTEAE</eac:Barcode>
</eac:Parameters>
<eac:ActivateParameters>
<eac:LoadAmount>5000</eac:LoadAmount>
</eac:ActivateParameters>
</eac:ActivateGiftCard>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ActivateGiftCardResponse xmlns="http://cowhills.nl/EAccount">
<ActivateGiftCardResult>
<ReturnCode>Success</ReturnCode>
<Giftcard>
<SerialNumber>RWCDXTDQ8UBTEAE</SerialNumber>
<Barcode>9761003001RWCDXTDQ8UBTEAE</Barcode>
<Status>Active</Status>
Function: CancelActivateGiftcard
It is possible to cancel an activation, the CancelActivateGiftcard function only requires the returned
‘ActivationId’ (returned by the ActivateGiftcard function).
Function: RedeemGiftcard
This function is used to redeem a giftcard, a ‘RedeemId’ is returned.
Name Commentary
Currency The currency for the redeem amount. This value is required if the product is
configured as such. This value has to match the product currency.
Function: CancelRedeemGiftcard
Apart from activation, redemptions can also be cancelled. Just like the CancelActivateGiftcard, the
CancelRedeemGiftcard needs the Id from the opposing function. In this case that is the ‘RedeemId’.
Function: RefundGiftcard
This function allows for the return of previously sold giftcards.
Please note: this function differs from the CancelRedeemGiftcard. Because as opposed to the
CancelActivationGiftcard, this functions updates the status (to ‘Refunded’) rather than reverting to the
previous one. This results in the fact that a refunded giftcard cannot be sold anymore. It is advised this
function is only used when a customer has actually left the shop. If the activation has to be annulled in the
same transaction as activation took place, use CancelActivateGiftcard.
• Batch
• Giftcard
Function: CreateProduct
This function allows for the creation of products.
Name Commentary
BrandName n/a
Prefix n/a
SerialNumberDigits n/a
ScratchCodeDigits n/a
BarcodeType The type of barcode for this product. One of the following:
• Code128
• Itf2of5
MaxLoadAmount The max value a giftcard can be loaded with. This value is optional and
only expected with load type ‘Loadable’.
• empty
For specific use cases, more values can be added in the future.
ActivateWithCardId Whether the giftcard should be activated with the unique card id. If false,
the giftcard can be activated with the Ean only (and Treazure will return
the first elegible giftcard).
AutoGrowParameters Auto grow parameters for automatically creating new gift card batches
when certain thresholds are reached.
Threshold The threshold value that triggers the creation of the new batch. The
number of
Name Commentary
Function: GetGiftcardProducts
Returns all giftcard products.
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetGiftcardProducts>
<eac:Auth>f0eb4369-46ec-4143-a171-1f79888dacf3</eac:Auth>
<eac:Parameters/>
</eac:GetGiftcardProducts>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
Function: GenerateGiftcards
Creates a new giftcards batch, a batch ID will be returned.
Please note: giftcards, just like coupons, are generated using a background process. This function only creates
the batch, the actual unique numbers will be available a few minutes after, depening on server load.
Since giftcards are created in a batch process this will be verified in the background generation process. The
batch will yield an error status.
Function: GetGiftcardBatches
Returns all batches for a specific giftcard product.
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetGiftcardBatches>
<eac:Auth>f0eb4369-46ec-4143-a171-1f79888dacf3</eac:Auth>
<eac:Parameters>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetGiftcardBatchesResponse xmlns="http://cowhills.nl/EAccount">
<GetGiftcardBatchesResult>
<Batches>
<Batch Created="2017-07-04T16:02:17" ValidUntil="2021-12-31T00:00:00" Qty="10000"
QtyCreated="10000" Id="eb5be602-61d6-428f-a990-4523ba430762" OperatorId="Giftcard" Status="Ready”/>
</Batches>
<ReturnCode>Success</ReturnCode>
<Stats>
<Created>
<Quantity>9999</Quantity>
<TotalBalance>0</TotalBalance>
<TotalStartBalance>0</TotalStartBalance>
</Created>
<Active>
<Quantity>1</Quantity>
<TotalBalance>1500</TotalBalance>
<TotalStartBalance>0</TotalStartBalance>
</Active>
</Stats>
</GetGiftcardBatchesResult>
</GetGiftcardBatchesResponse>
</s:Body>
</s:Envelope>
Function: GetGiftcardBarcodes
Returns all giftcard barcodes from a single batch, this is same batch ID which was returned upon generation.
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetGiftcardBarcodes>
<eac:Auth>f0eb4369-46ec-4143-a171-1f79888dacf3</eac:Auth>
<eac:Parameters>
<eac:BatchId>eb5be602-61d6-428f-a990-4523ba430762</eac:BatchId>
<eac:ProductId>c022a4de-faa1-478d-b6a2-8ec877875945</eac:ProductId>
<eac:Status>Created</eac:Status>
</eac:Parameters>
</eac:GetGiftcardBarcodes>
</soapenv:Body>
</soapenv:Envelope>
Example response:
Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetGiftcardBarcodesResponse xmlns="http://cowhills.nl/EAccount">
<GetGiftcardBarcodesResult>
<Barcodes>
<Gc Bc="97610030012GLHAU8E2X7U3JL" Sn="2GLHAU8E2X7U3JL" St="Created" Sb="0" Ba="0"/>
<Gc Bc="9761003001RWCDXTDQ8UBTEAE" Sn="RWCDXTDQ8UBTEAE" St="Created" Sb="0" Ba="0"/>
</Barcodes>
<ReturnCode>Success</ReturnCode>
Function: UpdateGiftcard
Backend function to edit the status of a single giftcard. It also allows for the reloading of a card.
Function: GetGiftcardHistory
Returns the history of a single giftcard.
Function: UploadGiftcards
This function is used to upload giftcards in the Treazure system. The giftcards are uploaded for a specific product
and assigned to the most recent giftcard batch.
ValidUntill The date/time untill the giftcard is valid. If not supplied DateTime
the validity rules of the product are used.
ValidFrom The date/time untill the giftcard is valid. If not supplied DateTime
the validity rules of the product are used.
The giftcard upload is executed transactional: all giftcards are either succesfully uploaded or all giftcards fail the
upload. If one giftcard fail the upload validations (for instance: barcode already present in system or wrong
combination of parameters) all giftcards fail the upload.
You can only upload up to 100 giftcards at one time. If more giftcards should be uploaded the upload-function
should be executed multiple times.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<IssueAccountResponse xmlns="http://cowhills.nl/EAccount">
<IssueAccountResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Account i:nil="true"/>
<ActivationId i:nil="true"/>
<ErrorMessage>backing product missing</ErrorMessage>
<ReturnCode>NotFound</ReturnCode>
</IssueAccountResult>
</IssueAccountResponse>
</s:Body>
</s:Envelope>
Backing product missing can be interpreted as a missing product and/or batch of giftcards ready to activate, the
customer must define the product (type=LoyaltyVault) first, after which cards can be created (batch-wise) to be
used in transactions.
Name Commentary
Name Commentary
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:IssueAccount>
<eac:Auth>5f89bc79-4429-4604-b8ff-7e94c4676355</eac:Auth>
<eac:Parameters>
<eac:Context>
<eac:Comment>Initiate</eac:Comment>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<IssueAccountResponse xmlns="http://cowhills.nl/EAccount">
<IssueAccountResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Account>
<AccountNumber>2602C44YPMPL4</AccountNumber>
</Account>
<ActivationId>fad25169c3fe42219460eb4f29eea48f</ActivationId>
<ErrorMessage i:nil="true"/>
<ReturnCode>Success</ReturnCode>
</IssueAccountResult>
</IssueAccountResponse>
</s:Body>
</s:Envelope>
Function: CancelIssueAccount
Cancels a previously activated account.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:CancelIssueAccount>
<eac:Auth>207a08b6-9e9b-413a-870b-2eba7be9445c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602B3ZLUXH9P</eac:AccountNumber>
</eac:Account>
<eac:Parameters>
<eac:ActivationId>95918df5eca54a7bac123d1d402de349</eac:ActivationId>
</eac:Parameters>
</eac:CancelIssueAccount>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CancelIssueAccountResponse xmlns="http://cowhills.nl/EAccount">
<CancelIssueAccountResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</CancelIssueAccountResult>
</CancelIssueAccountResponse>
</s:Body>
</s:Envelope>
Function: LoadAccountBalance
Load balance on activated accounts.
Name Commentary
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:LoadAccountBalance>
<eac:Auth>207a08b6-9e9b-413a-870b-2eba7be9445c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602C44YPMPL4</eac:AccountNumber>
</eac:Account>
<eac:Parameters>
<eac:Amount>50</eac:Amount>
<eac:Context>
<eac:Comment>Initial load</eac:Comment>
<eac:OperatorId>654321</eac:OperatorId>
<eac:PosId>01</eac:PosId>
<eac:ReceiptNr>124</eac:ReceiptNr>
<eac:ShopId>0800</eac:ShopId>
</eac:Context>
</eac:Parameters>
</eac:LoadAccountBalance>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LoadAccountBalanceResponse xmlns="http://cowhills.nl/EAccount">
<LoadAccountBalanceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Balance>50</Balance>
<ErrorMessage i:nil="true"/>
<LoadId>38b5b1dcdb5448dd90cfd0630d4c7b62</LoadId>
<ReturnCode>Success</ReturnCode>
</LoadAccountBalanceResult>
</LoadAccountBalanceResponse>
Function: CancelLoadAccountBalance
Cancels a previous load by referencing the account number and LoadId.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:CancelLoadAccountBalance>
<eac:Auth>07167e14-0182-45fb-b29c-f191a59a894c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602C44YPMPL4</eac:AccountNumber>
</eac:Account>
<eac:Parameters>
<eac:LoadId>041102d8b4044fb7ad998cb8ce1a9a4f</eac:LoadId>
</eac:Parameters>
</eac:CancelLoadAccountBalance>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CancelLoadAccountBalanceResponse xmlns="http://cowhills.nl/EAccount">
<CancelLoadAccountBalanceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</CancelLoadAccountBalanceResult>
</CancelLoadAccountBalanceResponse>
</s:Body>
</s:Envelope>
Function: GetAccountBalance
Returns the balance for a specific loyalty account and all known historical changes.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:GetAccountBalance>
<eac:Auth>207a08b6-9e9b-413a-870b-2eba7be9445c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602C44YPMPL4</eac:AccountNumber>
</eac:Account>
</eac:GetAccountBalance>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetAccountBalanceResponse xmlns="http://cowhills.nl/EAccount">
<GetAccountBalanceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Active>true</Active>
<Balance>100</Balance>
<ErrorMessage i:nil="true"/>
<History>
<Events>
<GiftcardHistoryEvent>
<Comment>Initial load</Comment>
<OperatorId>654321</OperatorId>
<PosId>01</PosId>
Function: RedeemAccountBalance
Redeem balance from accounts.
Name Commentary
Name Commentary
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:RedeemAccountBalance>
<eac:Auth>07167e14-0182-45fb-b29c-f191a59a894c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602C44YPMPL4</eac:AccountNumber>
</eac:Account>
<eac:Parameters>
<eac:Amount>25</eac:Amount>
<eac:Context>
<eac:Comment>Enjoy benefits</eac:Comment>
<eac:OperatorId>654321</eac:OperatorId>
<eac:PosId>01</eac:PosId>
<eac:ReceiptNr>124</eac:ReceiptNr>
<eac:ShopId>0800</eac:ShopId>
</eac:Context>
</eac:Parameters>
</eac:RedeemAccountBalance>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<RedeemAccountBalanceResponse xmlns="http://cowhills.nl/EAccount">
<RedeemAccountBalanceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Balance>75</Balance>
<ErrorMessage i:nil="true"/>
<RedeemId>73dca4fb527f4516a93f4b064a1a4eee</RedeemId>
<ReturnCode>Success</ReturnCode>
</RedeemAccountBalanceResult>
</RedeemAccountBalanceResponse>
</s:Body>
</s:Envelope>
Function: CancelRedeemAccountBalance
Cancels a previous redeem by referencing the account number and RedeemId.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:eac="http://cowhills.nl/EAccount">
<soapenv:Header/>
<soapenv:Body>
<eac:CancelRedeemAccountBalance>
<eac:Auth>07167e14-0182-45fb-b29c-f191a59a894c</eac:Auth>
<eac:Account>
<eac:AccountNumber>2602C44YPMPL4</eac:AccountNumber>
Example response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CancelRedeemAccountBalanceResponse xmlns="http://cowhills.nl/EAccount">
<CancelRedeemAccountBalanceResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ReturnCode>Success</ReturnCode>
</CancelRedeemAccountBalanceResult>
</CancelRedeemAccountBalanceResponse>
</s:Body>
</s:Envelope>
• Currency: EMP
• Prefix: EMP
• Refund: NotPossible
• Reloadable: true
• Gift card types: this dimension is used as the booking periods. Multiple values are supported.
An open batch must be created for accounts to be stored in. This is default giftcard behavior.
Meta data
For all mutating operations the following info can be supplied:
• ShopId
• PosId
• OperatorId
• ReceiptNumber
• Comment
These values do not influence the behavior of the API, these are merely for registration.
Account identifier
An employee balance account is identified with an employee id and a booking period. The booking period must
be an existing value in the system.
Function: GetAccountBalance
Returns the balance for the specified account. Also, the load and redemption history is returned.
Function: LoadAccountBalance
Loads balance on the specified account.
Function: RedeemAccountBalance
Redeems balance from a specified account.
Function: CancelRedeemAccountBalance
Cancels the result of a RedeemAccountBalance operation.
Function: CreateNewAccounts
Creates one or more new accounts. Optionally, a starting balance can be provided. Up to 100 accounts can be
created in one batch.
Ping
This method allows for obtaining the service status. There are no input parameters, the function is generally
available.
The below result codes are used throughout the entire Treazure platform, some codes will never be returned
in certain functions. The most relevant result codes are mentioned with each function.
UnderlayingSystemOffline This result is returned if the request could not be relayed 503
internally.
InternalError This is an internal status code and will not be returned. In 500
the case of internal error an exception error message will
be returned instead.
SyntaxError If the provided syntax fails the schema this error will be 400
returned. For instance when an invalid datatype is
provided.
In the examples it is assumed the session token is available. The session token can be obtained using the login
function on the Authentication API.
Basic rule:
• The GetCustomerVouchers function (in the CustomerVoucher API) returns the previously registered
vouchers.
On basket mutation:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="true">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>AAAAA</pem:ArticleId>
<pem:GroupId>GROUP001</pem:GroupId>
<pem:Amount>25000</pem:Amount>
<pem:Count>2</pem:Count>
<pem:Attribs>
<pem:Attrib>
<pem:Type>ProductieMaand</pem:Type>
<pem:Value>Jan</pem:Value>
</pem:Attrib>
</pem:Attribs>
</pem:Sale>
</pem:Sales>
<pem:CustomerCards>
<pem:CustomerCard>
<pem:Uid>CustomerCard001</pem:Uid>
</pem:CustomerCard>
</pem:CustomerCards>
<pem:PriorUses>
<pem:PemPriorUse>
<pem:Uid>Prior001</pem:Uid>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="3750" Desc="Max 10x he" Count="2" Type="Promotion">
<Ref Uid="Sale001" Tier="5" Code="10xperklant"/>
</Result>
</FinancialResults>
<Summary>
<PerPemEntry>
<Entry Code="10xperklant" QtyThis="1" QtyLimit="10" QtyPrior="9" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
The summary shows that the promotion only triggered once, the limit was ten times and there were nine prior
uses. Meaning the next time it won’t trigger.
Upon payment:
• Determine the vouchers which need to be redeemed, these can be found in the result of the Calculate
operation. In the above example the Entry elements in the Summary which have the QtyLimit set.
• The RedeemCustomerVoucher operation (in the CustomerVoucher API) allows for the registration of
the vouchers.
Employee discount
This case describes the calculation of employee discounts on purchases.
2) The consuming system knows how much discount can be applied to employee purchases.
3) The consuming system know whether employee discounts can be applied to the articles in the basket
(master data).
a. For each article a flag is set whether employee discount is allowed (or disallowed for that
matter).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="true">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>3000</pem:Amount>
<pem:Count>3</pem:Count>
<pem:Flags>
<pem:Flag>EmployeeDiscount</pem:Flag>
</pem:Flags>
</pem:Sale>
</pem:Sales>
<pem:EmployeeCards>
<pem:EmployeeCard>
<pem:Uid>EmployeeCard001</pem:Uid>
<pem:EmployeeDiscountType>Regular</pem:EmployeeDiscountType>
<pem:DiscountPercentage>1000</pem:DiscountPercentage>
</pem:EmployeeCard>
</pem:EmployeeCards>
</pem:Request>
</pem:Calculate>
</soapenv:Body>
</soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="300" Count="3" Type="EmployeeCard">
<Ref Uid="Sale001" Tier="5000"/>
</Result>
</FinancialResults>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
Markdown prices
A markdown price needs to be identified as such, this way the discount will be visible and recognizable in the
result.
1) The prices before and after markdown are known in the consuming system.
a. Markdowned prices are added to the sale element as a Plu type discount.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
The above example shows that an article has been sold three times with a markdowned price of 7,50; which
brings the total to 22,50 as opposed to 30,-. This discount of 2,50 times the number of articles (three in this
particular case) makes a total markdown of 7,50 over 30,-. The new price (3 x 7,50 = 22,50) must be submitted
in a NewPrice element.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="281" Desc="Bonus op 10187055003" Count="3" Type="Promotion">
<Ref Uid="Sale001" Tier="0" Code="Bonus_10187055003"/>
</Result>
<Result Amount="750" Count="3" Type="Plu">
<Ref Uid="Sale001" Tier="-500"/>
</Result>
</FinancialResults>
<Summary>
<PerPemEntry>
<Entry Code="Bonus_10187055003" QtyThis="1" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
In the above result the markdown ‘discount’ is visible in the FinancialResults element, there is also another
discount visible, the type clarifies that one is the result of a promotion.
Pregenerating coupons
This case describes a situation in which coupons are generated and issued, for example using physical prints or
mailing.
1) To start coupon generation, the function GenerateCoupons in the Coupon API is available. Coupon
generation is background process, the result of the function returns a batch ID. The batch ID can be
used to check the result and progress of the previously started generation.
a. This function has to be called with batchmode PreGenerated, triggering the Treazure
platform to generate coupons.
b. If the parameter AutoActivate is not set to true, the system will return an errormessage.
2) The GetCouponBatches return all batches and their statusses, this makes it easy to check if
generations are complete.
3) If the generation is completed, the GetCoupons functions allows for the request of the generated
coupons. The result of this request can be sent to the printer, this way only generated coupons will be
printed. This functionality is always available and not limited to a one-time use.
a. The customer is informed the coupon has expired/is unknown in the system
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pem="http://cowhills.nl/EAccount/PEM">
<soapenv:Header/>
<soapenv:Body>
<pem:Calculate>
<pem:Auth>8376cd77-e40e-4b83-b915-024d4af9d5ad</pem:Auth>
<pem:Request LanCode="nl" UsePrePublish="true">
<pem:Sales>
<pem:Sale>
<pem:Uid>Sale001</pem:Uid>
<pem:ArticleId>10187055003</pem:ArticleId>
<pem:Amount>5995</pem:Amount>
<pem:Count>1</pem:Count>
</pem:Sale>
</pem:Sales>
<pem:Coupons>
<pem:Coupon>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalculateResponse xmlns="http://cowhills.nl/EAccount/PEM">
<CalculateResult Code="Success">
<FinancialResults>
<Result Amount="749" Desc="Bonus op 10187055003" Count="1" Type="Promotion">
<Ref Uid="Sale001" Tier="0" Code="Bonus_10187055003"/>
</Result>
<Result Amount="1049" Desc="20% korting op laarzen met coupon" Count="1"
Type="Promotion">
<Ref Uid="Sale001" Tier="250" Code="20%metcoupon"/>
<TriggerCouponIds>
<CouponId>CouponCodeVoor20%OpLaarzen</CouponId>
</TriggerCouponIds>
</Result>
</FinancialResults>
<Summary>
<PerPemEntry>
<Entry Code="Bonus_10187055003" QtyThis="1" Type="Financial"/>
<Entry Code="20%metcoupon" QtyThis="1" Type="Financial"/>
</PerPemEntry>
</Summary>
</CalculateResult>
</CalculateResponse>
</s:Body>
</s:Envelope>
As seen in the above response message two promotions have been applied; a promotion with description
‘Bonus op 10187055003’ (12,5% discount) and a promotion triggered by a coupon. The used coupon ID is also
visible, which relates to the CouponRangeId which was returned when generating the series.
o 7,49 discount (12,5% of 59,95) – first applied here, because the tier is the lowest (0)
o 10,49 discount (20% of 52,46 [the remained of 59,59 – 7,49]) – applied afterwards, because
it is the second tier (250)
1) The Calculate function returns which coupons have been used in the transaction (calculation).
3) The result defines whether a requested redeem succeeded or not. The ‘RedeemId’ needs to be saved
for registrational purposes and in case the redeem needs to be reversed.
5) If the payment fails, or the redeem needs to be cancelled for any other reason, they can be cancelled
by using the CancelRedeem function. In order to cancel a redemption, the ‘RedeemId’ needs to be
provided, as saved in step 3. This can happen if two coupons are to be redeemed, but the second
redemption fails.