Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 16.9 KB

Subscription.md

File metadata and controls

58 lines (46 loc) · 16.9 KB

Subscription

Properties

Name Type Required Description
billing str Determines the method of billing at the end of the billing cycle. Set to pay_automatically - Rapyd generates a 'payment' object, then attempts to pay it using the designated payment method.
billing_cycle_anchor BillingCycleAnchor Determines the start of the next full billing cycle, as defined in the plan described in the 'items'. One of the following values: _ now - The present day. The next billing cycle starts right now. _ Timestamp in Unix time - A time in the future, at or after the end of the free trial period, not more than the length of the billing cycle. The current billing cycle will be shorter than all other billing cycles. Relevant to creation of the subscription. * unchanged - The original billing cycle anchor is unchanged. Relevant to updating a subscription.
cancel_at_period_end bool Determines the last date that charges accrue. true - Charges accrue until the end of the current billing period, then the subscription is canceled. _ When no trial period is set, after cancel_at_period_end is set to true the subscription will not be renewed at the next interval. _ When a trial period is set after cancel_at_period_end is set to true, the subscription will not begin. false - This is the default. _ When the subscription is created, no end is defined. _ When Cancel Subscription is run, charges stop immediately and the subscription is canceled.
canceled_at float Date and time that the subscription is canceled by the customer or by the client. Unix time. Response only.
created_at float Time of creation of this subscription, in Unix time. Response only.
current_period_end float End of the current billing cycle, in Unix time. Response only.
current_period_start float Start of the current billing cycle, in Unix time. Response only.
customer_token str ID of the customer who pays for this subscription. String starting with cus_. Response only.
days_until_due float Number of days from the invoice date for customer to complete the payment.
discount Discount Describes the fields relating to discounts in REST messages and webhooks for customer profiles and subscriptions Contains information about the coupon that applies to the customer. Read-only field. Adding a discount is a 2-step process:
1. Create Coupon, which returns a coupon ID.
2. Add the coupon ID to the coupon field of the customer with Create Customer or Update Customer.
ended_at float Date that the subscription was canceled or otherwise terminated. Unix time. Response only.
id_ str ID of the Subscription object. String starting with sub_.
metadata dict A JSON object defined by the client.
payment_fields dict Additional payment_options fields.
payment_method str Payment method ID or Payment Method object. if not specified in this field, the payment method is the default payment method specified for the customer.
payout_fields dict Reserved.
simultaneous_invoice bool Determines whether each upcoming subscription invoice is issued immediately. _ true - The invoice is issued when the subscription is created. _ false - The invoice is issued an hour after the subscription is created. This is the default.
status SubscriptionStatus Status of the subscription. One of the following: _ active - The customer is currently paying for this subscription. _ canceled - The customer has canceled this subscription, but it remains in the Rapyd database. _ past_due - Payment for this subscription was not received by the end of the billing period. _ trialing - The subscription is in its free trial period. * unpaid - An error occurred in the payment for this subscription. Response only.
subscription_items SubscriptionItems
tax_percent float The percentage tax rate that is applied to the subtotal of the invoice, after subtracting all discounts. Decimal. Range: 0-100, with up to four decimal places.
trial_end float The date and time of the end of the customer's free trial period, in Unix time, or the string now. Takes precedence over trial_period_days. If trial_end is not set by the client, Rapyd calculates this date by adding trial_period_days to the date in created_at. Relevant when trial_period_days is not defined.
trial_start float Date and time of the start of the customer's free trial period, in Unix time. Response only.
type_ SubscriptionType The type of the subscription. One of the following values: _ payment _ payout Response only.

BillingCycleAnchor

Determines the start of the next full billing cycle, as defined in the plan described in the 'items'. One of the following values: _ now - The present day. The next billing cycle starts right now. _ Timestamp in Unix time - A time in the future, at or after the end of the free trial period, not more than the length of the billing cycle. The current billing cycle will be shorter than all other billing cycles. Relevant to creation of the subscription. * unchanged - The original billing cycle anchor is unchanged. Relevant to updating a subscription.

SubscriptionStatus

Status of the subscription. One of the following: _ active - The customer is currently paying for this subscription. _ canceled - The customer has canceled this subscription, but it remains in the Rapyd database. _ past_due - Payment for this subscription was not received by the end of the billing period. _ trialing - The subscription is in its free trial period. * unpaid - An error occurred in the payment for this subscription. Response only.

Properties

Name Type Required Description
ACTIVE str "active"
CANCELED str "canceled"
PASTDUE str "past_due"
TRIALING str "trialing"
UNPAID str "unpaid"

SubscriptionType

The type of the subscription. One of the following values: _ payment _ payout Response only.

Properties

Name Type Required Description
PAYOUT str "payout"
PAYMENT str "payment"