Defines input parameters in a request to the CreateSubscription endpoint.
CreateSubscriptionRequest
Name | Type | Tags | Description | Getter |
---|---|---|---|---|
IdempotencyKey |
String |
Optional | A unique string that identifies this CreateSubscription request.If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see Idempotency keys. |
String getIdempotencyKey() |
LocationId |
String |
Required | The ID of the location the subscription is associated with. Constraints: Minimum Length: 1 |
String getLocationId() |
PlanVariationId |
String |
Optional | The ID of the subscription plan variation created using the Catalog API. | String getPlanVariationId() |
CustomerId |
String |
Required | The ID of the customer subscribing to the subscription plan variation. Constraints: Minimum Length: 1 |
String getCustomerId() |
StartDate |
String |
Optional | The YYYY-MM-DD -formatted date to start the subscription.If it is unspecified, the subscription starts immediately. |
String getStartDate() |
CanceledDate |
String |
Optional | The YYYY-MM-DD -formatted date when the newly created subscription is scheduled for cancellation.This date overrides the cancellation date set in the plan variation configuration. If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date occurs before the subscription plan expires, the specified canceled_date sets the date when the subscriptionstops through the end of the last cycle. |
String getCanceledDate() |
TaxPercentage |
String |
Optional | The tax to add when billing the subscription. The percentage is expressed in decimal form, using a '.' as the decimalseparator and without a '%' sign. For example, a value of 7.5corresponds to 7.5%. Constraints: Maximum Length: 10 |
String getTaxPercentage() |
PriceOverrideMoney |
Money |
Optional | Represents an amount of money. Money fields can be signed or unsigned.Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See Working with Monetary Amounts for more information. |
Money getPriceOverrideMoney() |
CardId |
String |
Optional | The ID of the subscriber's card to charge. If it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription. |
String getCardId() |
Timezone |
String |
Optional | The timezone that is used in date calculations for the subscription. If unset, defaults to the location timezone. If a timezone is not configured for the location, defaults to "America/New_York". Format: the IANA Timezone Database identifier for the location timezone. For a list of time zones, see List of tz database time zones. |
String getTimezone() |
Source |
SubscriptionSource |
Optional | The origination details of the subscription. | SubscriptionSource getSource() |
MonthlyBillingAnchorDate |
Integer |
Optional | The day-of-the-month to change the billing date to. Constraints: >= 1 , <= 31 |
Integer getMonthlyBillingAnchorDate() |
Phases |
List<Phase> |
Optional | array of phases for this subscription | List getPhases() |
{
"card_id": "ccof:qy5x8hHGYsgLrp4Q4GB",
"customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
"idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf",
"location_id": "S8GWD5R9QB376",
"phases": [
{
"order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY",
"ordinal": 0
}
],
"plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H",
"source": {
"name": "My Application"
},
"start_date": "2023-06-20",
"timezone": "America/Los_Angeles",
"canceled_date": "canceled_date6",
"tax_percentage": "tax_percentage6"
}