Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Data Structures‎ > ‎

Voucher

Data structure holding a voucher to be displayed to the user.  Both the Get Voucher and Get Voucher Preview method return the same object.  To get at data such as the voucher title, look into the Offer object and find the OfferOption that the voucher is for.

Fields:
Field Data Type Nulls Description
consumerMarkedRedeemedbool
Whether or not the consumer of this voucher has marked it as redeemed (not an official redemption - just for display purposes).
consumerNamestring
 The name of the person the voucher is registered to.
customerName string
The name of the person the voucher is registered to. deprecated. use consumerName
expirationDate
datetime
Y Will contain the expiration date.  Null implies expiration date might be found in the fine print.
merchantRedeemedbool
 Whether or not the merchant for this voucher has marked it as redeemed (an official redemption).
isRefunded
bool    Whether or not this voucher has been refunded. deprecated, use RefundDate
offer Offer

A full reference to the offer data structure.
offerId int
The offer id the voucher is for.
offerOptionId int
The offer option id the voucher is for.
redemptionUrl
string
Y
If the voucher is redeemable online, this will contain the url.
refundDate
datetimeY
Gets the date the item was refunded.  Null is not refunded.
segmentKey string
The segment key the offer was purchased on.
shippingProvider
string
 The carrier.  One of { None, USPS, DHL, FedEx }.
shippingTrackingNumber
string
Y
The tracking number issued by the shipping provider.
shippingTrackingUrl
string
Y
Returns the tracking url for this shipment order. Will be null if the item doesn't require shipping or has not shipped yet.
userKeystring Y
The userkey of the user making the purchase.  This can be used for additional security to ensure the correct user is looking at a voucher. Will only be null on a preview request.
voucherCode string Y
The code printed on the voucher.  Will be null if the voucher has been refunded.
voucherCodeImageDisplayFormat
string
Y
The voucher code format. Ex: Qr code, Code 128.  One of { QrCode, Barcode }
voucherPinstringYThe voucher pin used for pay-on-redemption vouchers.  Null if the voucher pin is not required on the merchant contract.
voucherPinRequiredbool Whether or not the voucher pin must be provided by the merchant when marking this voucher as redeemed.
voucherUrl
string
Y If the voucher can be printed, this will contain the url.
 

Sample JSON Response:
{
    "consumerMarkedRedeemed": true,
    "consumerName": "MattTesting",
    "customerName": "MattTesting",
    "expirationDate": "/Date(1353283200000)/",
    "isRefunded": false,
    "merchantRedeemed": false,
    "offer": {
        /*
see offer */
    },
    "offerId": 5734,
    "offerOptionId": 5640,
    "redemptionUrl": null,
    "refundDate": null,
    "segmentKey": "national",
    "shippingProvider": "None",
    "shippingTrackingNumber": null,
    "shippingTrackingUrl": null,
    "userKey": null,
    "voucherCode": "P-4118-131-AF0A2",
    "voucherCodeImageDisplayFormat": "Barcode",
    "voucherPin": null,
    "voucherPinRequired": false,
    "voucherUrl": "http: //dailyvoicetest.groupcommerce.com/voucher?SecretKey=r8PffrhdDLCyb6bpqUTJHo7WPIIpnei7PPZBIKryqDI%3d&Code=P-4118-131-AF0A2"
}



Sample XML Response:
<voucher>
    <consumerMarkedRedeemed>true</consumerMarkedRedeemed>
    <consumerName>Matt Testing</consumerName>
    <customerName>Matt Testing</customerName>
    <expirationDate>2012-11-19T00:00:00Z</expirationDate>
    <isRefunded>false</isRefunded>
    <merchantRedeemed>false</merchantRedeemed>
    <offer>
      <!--
see offer -->
    </offer>
    <offerId>5734</offerId>
    <offerOptionId>5640</offerOptionId>
    <redemptionUrl i:nil="true" />
    <refundDate i:nil="true" />
    <segmentKey>national</segmentKey>
    <shippingProvider>None</shippingProvider>
    <shippingTrackingNumber i:nil="true" />
    <shippingTrackingUrl i:nil="true" />
    <userKey i:nil="true" />
    <voucherCode>P-4118-131-AF0A2</voucherCode>
    <voucherCodeImageDisplayFormat>Barcode</voucherCodeImageDisplayFormat>
    <voucherPin i:nil="true" />
    <voucherPinRequired>false</voucherPinRequired>
    <voucherUrl>http://dailyvoicetest.groupcommerce.com/voucher?SecretKey=r8PffrhdDLCyb6bpqUTJHo7WPIIpnei7PPZBIKryqDI%3d&amp;Code=P-4118-131-AF0A2</voucherUrl>
</voucher>

Comments