| POST | /create-customer |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class CreateSubscribeCustomer implements IPost
{
public String email = null;
public String getEmail() { return email; }
public CreateSubscribeCustomer setEmail(String value) { this.email = value; return this; }
}
public static class StripeCustomer extends StripeId
{
public Integer accountBalance = null;
public String businessVatId = null;
public Date created = null;
public String defaultSource = null;
public Boolean delinquent = null;
public String description = null;
public StripeDiscount discount = null;
public String email = null;
public String invoicePrefix = null;
public Boolean livemode = null;
public HashMap<String,String> metadata = null;
public StripeShipping shipping = null;
public StripeCollection<StripeCard> sources = null;
public StripeCollection<StripeSubscription> subscriptions = null;
public Boolean deleted = null;
public String currency = null;
public Integer getAccountBalance() { return accountBalance; }
public StripeCustomer setAccountBalance(Integer value) { this.accountBalance = value; return this; }
public String getBusinessVatId() { return businessVatId; }
public StripeCustomer setBusinessVatId(String value) { this.businessVatId = value; return this; }
public Date getCreated() { return created; }
public StripeCustomer setCreated(Date value) { this.created = value; return this; }
public String getDefaultSource() { return defaultSource; }
public StripeCustomer setDefaultSource(String value) { this.defaultSource = value; return this; }
public Boolean isDelinquent() { return delinquent; }
public StripeCustomer setDelinquent(Boolean value) { this.delinquent = value; return this; }
public String getDescription() { return description; }
public StripeCustomer setDescription(String value) { this.description = value; return this; }
public StripeDiscount getDiscount() { return discount; }
public StripeCustomer setDiscount(StripeDiscount value) { this.discount = value; return this; }
public String getEmail() { return email; }
public StripeCustomer setEmail(String value) { this.email = value; return this; }
public String getInvoicePrefix() { return invoicePrefix; }
public StripeCustomer setInvoicePrefix(String value) { this.invoicePrefix = value; return this; }
public Boolean isLivemode() { return livemode; }
public StripeCustomer setLivemode(Boolean value) { this.livemode = value; return this; }
public HashMap<String,String> getMetadata() { return metadata; }
public StripeCustomer setMetadata(HashMap<String,String> value) { this.metadata = value; return this; }
public StripeShipping getShipping() { return shipping; }
public StripeCustomer setShipping(StripeShipping value) { this.shipping = value; return this; }
public StripeCollection<StripeCard> getSources() { return sources; }
public StripeCustomer setSources(StripeCollection<StripeCard> value) { this.sources = value; return this; }
public StripeCollection<StripeSubscription> getSubscriptions() { return subscriptions; }
public StripeCustomer setSubscriptions(StripeCollection<StripeSubscription> value) { this.subscriptions = value; return this; }
public Boolean isDeleted() { return deleted; }
public StripeCustomer setDeleted(Boolean value) { this.deleted = value; return this; }
public String getCurrency() { return currency; }
public StripeCustomer setCurrency(String value) { this.currency = value; return this; }
}
public static class StripeId extends StripeObject
{
public String id = null;
public String getId() { return id; }
public StripeId setId(String value) { this.id = value; return this; }
}
public static class StripeObject
{
public StripeType object = null;
public StripeType getObject() { return object; }
public StripeObject setObject(StripeType value) { this.object = value; return this; }
}
public static enum StripeType
{
Unknown,
Account,
Card,
Charge,
Coupon,
Customer,
Discount,
Dispute,
Event,
Invoiceitem,
Invoice,
LineItem,
Plan,
Subscription,
Token,
Transfer,
List,
Product;
}
public static class StripeDiscount extends StripeId
{
public String customer = null;
public StripeCoupon coupon = null;
public Date start = null;
public Date end = null;
public String getCustomer() { return customer; }
public StripeDiscount setCustomer(String value) { this.customer = value; return this; }
public StripeCoupon getCoupon() { return coupon; }
public StripeDiscount setCoupon(StripeCoupon value) { this.coupon = value; return this; }
public Date getStart() { return start; }
public StripeDiscount setStart(Date value) { this.start = value; return this; }
public Date getEnd() { return end; }
public StripeDiscount setEnd(Date value) { this.end = value; return this; }
}
public static class StripeCoupon extends StripeId
{
public Integer amountOff = null;
public Date created = null;
public String currency = null;
public StripeCouponDuration duration = null;
public Integer durationInMonths = null;
public Boolean livemode = null;
public Integer maxRedemptions = null;
public HashMap<String,String> metadata = null;
public Integer percentOff = null;
public Date redeemBy = null;
public Integer timesRedeemed = null;
public Boolean valid = null;
public Integer getAmountOff() { return amountOff; }
public StripeCoupon setAmountOff(Integer value) { this.amountOff = value; return this; }
public Date getCreated() { return created; }
public StripeCoupon setCreated(Date value) { this.created = value; return this; }
public String getCurrency() { return currency; }
public StripeCoupon setCurrency(String value) { this.currency = value; return this; }
public StripeCouponDuration getDuration() { return duration; }
public StripeCoupon setDuration(StripeCouponDuration value) { this.duration = value; return this; }
public Integer getDurationInMonths() { return durationInMonths; }
public StripeCoupon setDurationInMonths(Integer value) { this.durationInMonths = value; return this; }
public Boolean isLivemode() { return livemode; }
public StripeCoupon setLivemode(Boolean value) { this.livemode = value; return this; }
public Integer getMaxRedemptions() { return maxRedemptions; }
public StripeCoupon setMaxRedemptions(Integer value) { this.maxRedemptions = value; return this; }
public HashMap<String,String> getMetadata() { return metadata; }
public StripeCoupon setMetadata(HashMap<String,String> value) { this.metadata = value; return this; }
public Integer getPercentOff() { return percentOff; }
public StripeCoupon setPercentOff(Integer value) { this.percentOff = value; return this; }
public Date getRedeemBy() { return redeemBy; }
public StripeCoupon setRedeemBy(Date value) { this.redeemBy = value; return this; }
public Integer getTimesRedeemed() { return timesRedeemed; }
public StripeCoupon setTimesRedeemed(Integer value) { this.timesRedeemed = value; return this; }
public Boolean isValid() { return valid; }
public StripeCoupon setValid(Boolean value) { this.valid = value; return this; }
}
public static enum StripeCouponDuration
{
Forever,
Once,
Repeating;
}
public static class StripeShipping
{
public StripeAddress address = null;
public String name = null;
public String phone = null;
public StripeAddress getAddress() { return address; }
public StripeShipping setAddress(StripeAddress value) { this.address = value; return this; }
public String getName() { return name; }
public StripeShipping setName(String value) { this.name = value; return this; }
public String getPhone() { return phone; }
public StripeShipping setPhone(String value) { this.phone = value; return this; }
}
public static class StripeAddress
{
public String city = null;
public String country = null;
public String line1 = null;
public String line2 = null;
public String postalCode = null;
public String state = null;
public String getCity() { return city; }
public StripeAddress setCity(String value) { this.city = value; return this; }
public String getCountry() { return country; }
public StripeAddress setCountry(String value) { this.country = value; return this; }
public String getLine1() { return line1; }
public StripeAddress setLine1(String value) { this.line1 = value; return this; }
public String getLine2() { return line2; }
public StripeAddress setLine2(String value) { this.line2 = value; return this; }
public String getPostalCode() { return postalCode; }
public StripeAddress setPostalCode(String value) { this.postalCode = value; return this; }
public String getState() { return state; }
public StripeAddress setState(String value) { this.state = value; return this; }
}
public static class StripeCollection<T> extends StripeId
{
public String url = null;
public Integer totalCount = null;
public Boolean hasMore = null;
public ArrayList<T> data = null;
public String getUrl() { return url; }
public StripeCollection<T> setUrl(String value) { this.url = value; return this; }
public Integer getTotalCount() { return totalCount; }
public StripeCollection<T> setTotalCount(Integer value) { this.totalCount = value; return this; }
public Boolean isHasMore() { return hasMore; }
public StripeCollection<T> setHasMore(Boolean value) { this.hasMore = value; return this; }
public ArrayList<T> getData() { return data; }
public StripeCollection<T> setData(ArrayList<T> value) { this.data = value; return this; }
}
public static class StripeCard extends StripeId
{
public String brand = null;
public String number = null;
public String last4 = null;
public String dynamicLast4 = null;
public Integer expMonth = null;
public Integer expYear = null;
public String cvc = null;
public String name = null;
public String addressCity = null;
public String addressCountry = null;
public String addressLine1 = null;
public String addressLine2 = null;
public String addressState = null;
public String addressZip = null;
public StripeCvcCheck cvcCheck = null;
public String addressLine1Check = null;
public String addressZipCheck = null;
public String funding = null;
public String fingerprint = null;
public String customer = null;
public String country = null;
public String getBrand() { return brand; }
public StripeCard setBrand(String value) { this.brand = value; return this; }
public String getNumber() { return number; }
public StripeCard setNumber(String value) { this.number = value; return this; }
public String getLast4() { return last4; }
public StripeCard setLast4(String value) { this.last4 = value; return this; }
public String getDynamicLast4() { return dynamicLast4; }
public StripeCard setDynamicLast4(String value) { this.dynamicLast4 = value; return this; }
public Integer getExpMonth() { return expMonth; }
public StripeCard setExpMonth(Integer value) { this.expMonth = value; return this; }
public Integer getExpYear() { return expYear; }
public StripeCard setExpYear(Integer value) { this.expYear = value; return this; }
public String getCvc() { return cvc; }
public StripeCard setCvc(String value) { this.cvc = value; return this; }
public String getName() { return name; }
public StripeCard setName(String value) { this.name = value; return this; }
public String getAddressCity() { return addressCity; }
public StripeCard setAddressCity(String value) { this.addressCity = value; return this; }
public String getAddressCountry() { return addressCountry; }
public StripeCard setAddressCountry(String value) { this.addressCountry = value; return this; }
public String getAddressLine1() { return addressLine1; }
public StripeCard setAddressLine1(String value) { this.addressLine1 = value; return this; }
public String getAddressLine2() { return addressLine2; }
public StripeCard setAddressLine2(String value) { this.addressLine2 = value; return this; }
public String getAddressState() { return addressState; }
public StripeCard setAddressState(String value) { this.addressState = value; return this; }
public String getAddressZip() { return addressZip; }
public StripeCard setAddressZip(String value) { this.addressZip = value; return this; }
public StripeCvcCheck getCvcCheck() { return cvcCheck; }
public StripeCard setCvcCheck(StripeCvcCheck value) { this.cvcCheck = value; return this; }
public String getAddressLine1Check() { return addressLine1Check; }
public StripeCard setAddressLine1Check(String value) { this.addressLine1Check = value; return this; }
public String getAddressZipCheck() { return addressZipCheck; }
public StripeCard setAddressZipCheck(String value) { this.addressZipCheck = value; return this; }
public String getFunding() { return funding; }
public StripeCard setFunding(String value) { this.funding = value; return this; }
public String getFingerprint() { return fingerprint; }
public StripeCard setFingerprint(String value) { this.fingerprint = value; return this; }
public String getCustomer() { return customer; }
public StripeCard setCustomer(String value) { this.customer = value; return this; }
public String getCountry() { return country; }
public StripeCard setCountry(String value) { this.country = value; return this; }
}
public static enum StripeCvcCheck
{
Unknown,
Pass,
Fail,
Unchecked;
}
public static class StripeSubscription extends StripeId
{
public Date currentPeriodEnd = null;
public StripeSubscriptionStatus status = null;
public StripePlan plan = null;
public Date currentPeriodStart = null;
public Date start = null;
public Date trialStart = null;
public Boolean cancelAtPeriodEnd = null;
public Date trialEnd = null;
public Date canceledAt = null;
public Date endedAt = null;
public String customer = null;
public Integer quantity = null;
public Date getCurrentPeriodEnd() { return currentPeriodEnd; }
public StripeSubscription setCurrentPeriodEnd(Date value) { this.currentPeriodEnd = value; return this; }
public StripeSubscriptionStatus getStatus() { return status; }
public StripeSubscription setStatus(StripeSubscriptionStatus value) { this.status = value; return this; }
public StripePlan getPlan() { return plan; }
public StripeSubscription setPlan(StripePlan value) { this.plan = value; return this; }
public Date getCurrentPeriodStart() { return currentPeriodStart; }
public StripeSubscription setCurrentPeriodStart(Date value) { this.currentPeriodStart = value; return this; }
public Date getStart() { return start; }
public StripeSubscription setStart(Date value) { this.start = value; return this; }
public Date getTrialStart() { return trialStart; }
public StripeSubscription setTrialStart(Date value) { this.trialStart = value; return this; }
public Boolean isCancelAtPeriodEnd() { return cancelAtPeriodEnd; }
public StripeSubscription setCancelAtPeriodEnd(Boolean value) { this.cancelAtPeriodEnd = value; return this; }
public Date getTrialEnd() { return trialEnd; }
public StripeSubscription setTrialEnd(Date value) { this.trialEnd = value; return this; }
public Date getCanceledAt() { return canceledAt; }
public StripeSubscription setCanceledAt(Date value) { this.canceledAt = value; return this; }
public Date getEndedAt() { return endedAt; }
public StripeSubscription setEndedAt(Date value) { this.endedAt = value; return this; }
public String getCustomer() { return customer; }
public StripeSubscription setCustomer(String value) { this.customer = value; return this; }
public Integer getQuantity() { return quantity; }
public StripeSubscription setQuantity(Integer value) { this.quantity = value; return this; }
}
public static enum StripeSubscriptionStatus
{
Unknown,
Trialing,
Active,
PastDue,
Canceled,
Unpaid;
}
public static class StripePlan extends StripeId
{
public Integer amount = null;
public Date created = null;
public String currency = null;
public StripePlanInterval interval = null;
public Integer intervalCount = null;
public Boolean livemode = null;
public HashMap<String,String> metadata = null;
public String nickname = null;
public String product = null;
public Integer trialPeriodDays = null;
public Integer getAmount() { return amount; }
public StripePlan setAmount(Integer value) { this.amount = value; return this; }
public Date getCreated() { return created; }
public StripePlan setCreated(Date value) { this.created = value; return this; }
public String getCurrency() { return currency; }
public StripePlan setCurrency(String value) { this.currency = value; return this; }
public StripePlanInterval getInterval() { return interval; }
public StripePlan setInterval(StripePlanInterval value) { this.interval = value; return this; }
public Integer getIntervalCount() { return intervalCount; }
public StripePlan setIntervalCount(Integer value) { this.intervalCount = value; return this; }
public Boolean isLivemode() { return livemode; }
public StripePlan setLivemode(Boolean value) { this.livemode = value; return this; }
public HashMap<String,String> getMetadata() { return metadata; }
public StripePlan setMetadata(HashMap<String,String> value) { this.metadata = value; return this; }
public String getNickname() { return nickname; }
public StripePlan setNickname(String value) { this.nickname = value; return this; }
public String getProduct() { return product; }
public StripePlan setProduct(String value) { this.product = value; return this; }
public Integer getTrialPeriodDays() { return trialPeriodDays; }
public StripePlan setTrialPeriodDays(Integer value) { this.trialPeriodDays = value; return this; }
}
public static enum StripePlanInterval
{
Month,
Year;
}
}
Java CreateSubscribeCustomer 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 /create-customer HTTP/1.1
Host: sfgboxapi.dev.scadsoftware.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateSubscribeCustomer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/sfgboxapi.ServiceModel">
<Email>String</Email>
</CreateSubscribeCustomer>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<StripeCustomer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ServiceStack.Stripe.Types">
<Object>unknown</Object>
<Id>String</Id>
<AccountBalance>0</AccountBalance>
<BusinessVatId>String</BusinessVatId>
<Created>0001-01-01T00:00:00</Created>
<Currency>String</Currency>
<DefaultSource>String</DefaultSource>
<Deleted>false</Deleted>
<Delinquent>false</Delinquent>
<Description>String</Description>
<Discount>
<Object>unknown</Object>
<Id>String</Id>
<Coupon>
<Object>unknown</Object>
<Id>String</Id>
<AmountOff>0</AmountOff>
<Created>0001-01-01T00:00:00</Created>
<Currency>String</Currency>
<Duration>forever</Duration>
<DurationInMonths>0</DurationInMonths>
<Livemode>false</Livemode>
<MaxRedemptions>0</MaxRedemptions>
<Metadata xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</Metadata>
<PercentOff>0</PercentOff>
<RedeemBy>0001-01-01T00:00:00</RedeemBy>
<TimesRedeemed>0</TimesRedeemed>
<Valid>false</Valid>
</Coupon>
<Customer>String</Customer>
<End>0001-01-01T00:00:00</End>
<Start>0001-01-01T00:00:00</Start>
</Discount>
<Email>String</Email>
<InvoicePrefix>String</InvoicePrefix>
<Livemode>false</Livemode>
<Metadata xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Metadata>
<Shipping>
<Address xmlns:d3p1="http://schemas.datacontract.org/2004/07/ServiceStack.Stripe">
<d3p1:City>String</d3p1:City>
<d3p1:Country>String</d3p1:Country>
<d3p1:Line1>String</d3p1:Line1>
<d3p1:Line2>String</d3p1:Line2>
<d3p1:PostalCode>String</d3p1:PostalCode>
<d3p1:State>String</d3p1:State>
</Address>
<Name>String</Name>
<Phone>String</Phone>
</Shipping>
<Sources>
<Object>unknown</Object>
<Id>String</Id>
<Data>
<StripeCard>
<Object>unknown</Object>
<Id>String</Id>
<AddressCity>String</AddressCity>
<AddressCountry>String</AddressCountry>
<AddressLine1>String</AddressLine1>
<AddressLine1Check>String</AddressLine1Check>
<AddressLine2>String</AddressLine2>
<AddressState>String</AddressState>
<AddressZip>String</AddressZip>
<AddressZipCheck>String</AddressZipCheck>
<Brand>String</Brand>
<Country>String</Country>
<Customer>String</Customer>
<Cvc>String</Cvc>
<CvcCheck>Unknown</CvcCheck>
<DynamicLast4>String</DynamicLast4>
<ExpMonth>0</ExpMonth>
<ExpYear>0</ExpYear>
<Fingerprint>String</Fingerprint>
<Funding>String</Funding>
<Last4>String</Last4>
<Name>String</Name>
<Number>String</Number>
</StripeCard>
</Data>
<HasMore>false</HasMore>
<TotalCount>0</TotalCount>
<Url>String</Url>
</Sources>
<Subscriptions>
<Object>unknown</Object>
<Id>String</Id>
<Data>
<StripeSubscription>
<Object>unknown</Object>
<Id>String</Id>
<CancelAtPeriodEnd>false</CancelAtPeriodEnd>
<CanceledAt>0001-01-01T00:00:00</CanceledAt>
<CurrentPeriodEnd>0001-01-01T00:00:00</CurrentPeriodEnd>
<CurrentPeriodStart>0001-01-01T00:00:00</CurrentPeriodStart>
<Customer>String</Customer>
<EndedAt>0001-01-01T00:00:00</EndedAt>
<Plan>
<Object>unknown</Object>
<Id>String</Id>
<Amount>0</Amount>
<Created>0001-01-01T00:00:00</Created>
<Currency>String</Currency>
<Interval>month</Interval>
<IntervalCount>0</IntervalCount>
<Livemode>false</Livemode>
<Metadata xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:KeyValueOfstringstring>
<d6p1:Key>String</d6p1:Key>
<d6p1:Value>String</d6p1:Value>
</d6p1:KeyValueOfstringstring>
</Metadata>
<Nickname>String</Nickname>
<Product>String</Product>
<TrialPeriodDays>0</TrialPeriodDays>
</Plan>
<Quantity>0</Quantity>
<Start>0001-01-01T00:00:00</Start>
<Status>Unknown</Status>
<TrialEnd>0001-01-01T00:00:00</TrialEnd>
<TrialStart>0001-01-01T00:00:00</TrialStart>
</StripeSubscription>
</Data>
<HasMore>false</HasMore>
<TotalCount>0</TotalCount>
<Url>String</Url>
</Subscriptions>
</StripeCustomer>