Issuing Promo Codes
Method Description
Invoked with a POST request. Operation name and input fields can be set up via Maestra framework. Details of method invocation can be found here.
POST https://api.maestra.io/v3/operations/{synch/asynch operation}?endpoint={unique ID of site/mobile app/etc.}&operation={operation name}&deviceUUID={unique device ID}&{transactiondId}={your transaction ID}
Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key, check with the manager if it's mandatory}
<operation>
<customer>
<ids>
<webSiteUserId>{customer ID}</webSiteUserId>
</ids>
</customer>
<promoCode>
<ids>
<value>{promo code value}</value>
</ids>
<pool>
<ids>
<externalId>{external ID}</externalId>
</ids>
</pool>
<availableFromDateTimeUtc>{promo code availability start date as YYYY-MM-DD hh:mm:ss.fff}</availableFromDateTimeUtc>
<availableTillDateTimeUtc>{promo code availability end date as YYYY-MM-DD hh:mm:ss.fff }</availableTillDateTimeUtc>
</promoCode>
<executionDateTimeUtc>{date and time of promo code execution (for backdated requests)}</executionDateTimeUtc>
</operation>
The promoCode/ids and promoCode/pool nodes can be mandatory, depending on the operation step settings:
Getting promo code | promoCode/ids | promoCode/pool |
---|---|---|
By value, creation disabled | Mandatory | Disallowed |
By value, creation enabled | Mandatory | Mandatory if not specified in operation step settings, otherwise disallowed. |
Get available from pool | Disallowed | Mandatory if not specified in operation step settings, otherwise disallowed. |
<result>
<status>{Request result: 'Success' on success, 'ValidationError' on customer error, 'ProtocolError' on integration error, 'InternalServerError' if server is unavailable.}</status>
<promoCode>
<issueStatus>{issuance status}</issueStatus>
<ids>
<mindboxId>{promo code ID}</mindboxId>
<value>{promo code value}</value>
</ids>
<pool>
<ids>
<externalId>{external ID}</externalId>
</ids>
<name>{name}</name>
<description>{description}</description>
</pool>
<availableFromDateTimeUtc>{promo code availability start date as YYYY-MM-DD hh:mm:ss.fff}</availableFromDateTimeUtc>
<availableTillDateTimeUtc>{promo code availability end date as YYYY-MM-DD hh:mm:ss.fff }</availableTillDateTimeUtc>
<isUsed>{is promo code redeemed, true or false}</isUsed>
<usedPointOfContact>
<ids>
<externalId>{external ID}</externalId>
</ids>
<name>{point of contact name}</name>
</usedPointOfContact>
<usedDateTimeUtc>{code redemption date as YYYY-MM-DD hh:mm:ss.fff}</usedDateTimeUtc>
<issuedPointOfContact>
<ids>
<externalId>{external ID}</externalId>
</ids>
<name>{point of contact name}</name>
</issuedPointOfContact>
<issuedDateTimeUtc>{promo code issuance date as YYYY-MM-DD hh:mm:ss.fff}</issuedDateTimeUtc>
<blockedDateTimeUtc>{promo code blocking date as YYYY-MM-DD hh:mm:ss.fff}</blockedDateTimeUtc>
</promoCode>
</result>
Issuance status | Description |
---|---|
PromoCodeNotFound | Promo code not found |
PromoCodePoolNotFound | Promo code pool not found |
NoAvailablePromoCodesInPool | No available promo codes in pool |
NotAvailableForIssue | Can’t be issued |
Issued | Issued |
NotInIssueDateTimeRange | Issue date not in promo code issuance date range |
Updated about 1 month ago