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 codepromoCode/idspromoCode/pool
By value, creation disabledMandatoryDisallowed
By value, creation enabledMandatoryMandatory if not specified in operation step settings, otherwise disallowed.
Get available from poolDisallowedMandatory 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 statusDescription
PromoCodeNotFoundPromo code not found
PromoCodePoolNotFoundPromo code pool not found
NoAvailablePromoCodesInPoolNo available promo codes in pool
NotAvailableForIssueCan’t be issued
IssuedIssued
NotInIssueDateTimeRangeIssue date not in promo code issuance date range