| Requires any of the roles: | Admin, TeamAdmin | Required permission: | Tickets.Add |
| POST | /GiftCard/Issue |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class GiftCardIssueRequest
{
public Integer giftCardTypeId = null;
public Integer amountMinor = null;
public String code = null;
public Boolean activate = null;
public String buyerName = null;
public String buyerEmail = null;
public String buyerPhone = null;
public String recipientName = null;
public String idempotencyKey = null;
public String note = null;
public Integer getGiftCardTypeId() { return giftCardTypeId; }
public GiftCardIssueRequest setGiftCardTypeId(Integer value) { this.giftCardTypeId = value; return this; }
public Integer getAmountMinor() { return amountMinor; }
public GiftCardIssueRequest setAmountMinor(Integer value) { this.amountMinor = value; return this; }
public String getCode() { return code; }
public GiftCardIssueRequest setCode(String value) { this.code = value; return this; }
public Boolean isActivate() { return activate; }
public GiftCardIssueRequest setActivate(Boolean value) { this.activate = value; return this; }
public String getBuyerName() { return buyerName; }
public GiftCardIssueRequest setBuyerName(String value) { this.buyerName = value; return this; }
public String getBuyerEmail() { return buyerEmail; }
public GiftCardIssueRequest setBuyerEmail(String value) { this.buyerEmail = value; return this; }
public String getBuyerPhone() { return buyerPhone; }
public GiftCardIssueRequest setBuyerPhone(String value) { this.buyerPhone = value; return this; }
public String getRecipientName() { return recipientName; }
public GiftCardIssueRequest setRecipientName(String value) { this.recipientName = value; return this; }
public String getIdempotencyKey() { return idempotencyKey; }
public GiftCardIssueRequest setIdempotencyKey(String value) { this.idempotencyKey = value; return this; }
public String getNote() { return note; }
public GiftCardIssueRequest setNote(String value) { this.note = value; return this; }
}
public static class GiftCardIssueResult
{
public Boolean success = null;
public Integer giftCardId = null;
public String code = null;
public String codeLast4 = null;
public String status = null;
public Date expiresAt = null;
public String paymentId = null;
public Integer statusCode = null;
public String message = null;
public Boolean isSuccess() { return success; }
public GiftCardIssueResult setSuccess(Boolean value) { this.success = value; return this; }
public Integer getGiftCardId() { return giftCardId; }
public GiftCardIssueResult setGiftCardId(Integer value) { this.giftCardId = value; return this; }
public String getCode() { return code; }
public GiftCardIssueResult setCode(String value) { this.code = value; return this; }
public String getCodeLast4() { return codeLast4; }
public GiftCardIssueResult setCodeLast4(String value) { this.codeLast4 = value; return this; }
public String getStatus() { return status; }
public GiftCardIssueResult setStatus(String value) { this.status = value; return this; }
public Date getExpiresAt() { return expiresAt; }
public GiftCardIssueResult setExpiresAt(Date value) { this.expiresAt = value; return this; }
public String getPaymentId() { return paymentId; }
public GiftCardIssueResult setPaymentId(String value) { this.paymentId = value; return this; }
public Integer getStatusCode() { return statusCode; }
public GiftCardIssueResult setStatusCode(Integer value) { this.statusCode = value; return this; }
public String getMessage() { return message; }
public GiftCardIssueResult setMessage(String value) { this.message = value; return this; }
}
}
Java GiftCardIssueRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /GiftCard/Issue HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GiftCardIssueRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Activate>false</Activate>
<AmountMinor>0</AmountMinor>
<BuyerEmail>String</BuyerEmail>
<BuyerName>String</BuyerName>
<BuyerPhone>String</BuyerPhone>
<Code>String</Code>
<GiftCardTypeId>0</GiftCardTypeId>
<IdempotencyKey>String</IdempotencyKey>
<Note>String</Note>
<RecipientName>String</RecipientName>
</GiftCardIssueRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GiftCardIssueResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel"> <Code>String</Code> <CodeLast4>String</CodeLast4> <ExpiresAt>0001-01-01T00:00:00</ExpiresAt> <GiftCardId>0</GiftCardId> <Message>String</Message> <PaymentId>String</PaymentId> <Status>String</Status> <StatusCode>0</StatusCode> <Success>false</Success> </GiftCardIssueResult>