Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 3.71 KB

File metadata and controls

44 lines (35 loc) · 3.71 KB

Create Subscription Request

Defines parameters in a CreateSubscription endpoint request.

Structure

Create Subscription Request

Fields

Name Type Tags Description
idempotency_key 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.
location_id string Required The ID of the location the subscription is associated with.
Constraints: Minimum Length: 1
plan_id string Required The ID of the subscription plan created using the Catalog API.
For more information, see
Set Up and Manage a Subscription Plan and
Subscriptions Walkthrough.
Constraints: Minimum Length: 1
customer_id string Required The ID of the customer profile.
Constraints: Minimum Length: 1
start_date string Optional The start date of the subscription, in YYYY-MM-DD format. For example,
2013-01-15. If the start date is left empty, the subscription begins
immediately.
canceled_date string Optional The date when the subscription should be canceled, in
YYYY-MM-DD format (for example, 2025-02-29). This overrides the plan configuration
if it comes before the date the subscription would otherwise end.
tax_percentage string Optional The tax to add when billing the subscription.
The percentage is expressed in decimal form, using a '.' as the decimal
separator and without a '%' sign. For example, a value of 7.5
corresponds to 7.5%.
Constraints: Maximum Length: 10
price_override_money 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.
card_id string Optional The ID of the customer card to charge.
If not specified, Square sends an invoice via email. For an example to
create a customer and add a card on file, see Subscriptions Walkthrough.
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.

Example (as JSON)

{
  "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB",
  "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
  "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf",
  "location_id": "S8GWD5R9QB376",
  "plan_id": "6JHXF3B2CW3YKHDV4XEM674H",
  "price_override_money": {
    "amount": 100,
    "currency": "USD"
  },
  "start_date": "2020-08-01",
  "tax_percentage": "5",
  "timezone": "America/Los_Angeles"
}