# List subscriptions Used to fetch a paginated list of subscriptions Endpoint: GET /subscriptions Version: 1.1.0 Security: secretApiKeyAuth ## Query parameters: - `startTimestamp` (integer) The start timestamp (inclusive), it must be before the endTimestamp. If not provided will default to midnight on the current date (UTC). Example: 1641859200 - `endTimestamp` (integer) The timestamp when to return payment sessions up to (inclusive), it must be after the startTimestamp. If not provided it will default to the current time (UTC). Example: 1641945599 - `ascending` (boolean) Control the order (newest or oldest) in which the subscriptions are returned. false will arrange the results with newest first, whereas true shows oldest first. The default is false. - `limit` (integer) Control how many items are return in a given page The max limit we allow is 25. The default is 10. Example: 10 - `startsAfter` (string) A token to identify where to resume a subsequent paginated query. The value of the paginationToken field from that response should be supplied here, to retrieve the next page of results for that timestamp range. Example: "sub_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473" ## Response 200 fields (application/json): - `items` (array) - `items.id` (string) The ID of the subscription Example: "sub_01G0EYVFR02KBBVE2YWQ8AKMGJ" - `items.status` (string) Enum: "Pending", "Active", "Cancelled", "PastDue", "Ended", "Paused" - `items.description` (string,null) (optional) description helps you personalise/identify the specific subscription Example: "Bob's monthly gym membership" - `items.customer` (object) - `items.customer.id` (string) The Id of the customer this subscription belongs to Example: "cus_01G0EYVFR02KBBVE2YWQ8AKMGJ" - `items.paymentMethod` (object,null) - `items.paymentMethod.id` (string) The Id of the PaymentMethod belonging to the customer that will be used to pay for the subscription Example: "pmt_01G0EYVFR02KBBVE2YWQ8AKMGJ" - `items.paymentSessions` (object) - `items.paymentSessions.initial` (object) - `items.paymentSessions.initial.id` (string) The Id of the PaymentSession Example: "ps_01G0EYVFR02KBBVE2YWQ8AKMGJ" - `items.paymentSessions.initial.clientSecret` (string,null) The client secret of the payment session, only supplied when action is required by the customer Supply this to the frontend (web/iOS/Android) to collect the payment details / handle any required actions (3ds) Example: "ps_01FCTS1XMKH9FF43CAFA4CXT3P_secret_b83f2653-06d7-44a9-a548-5825e8186004" - `items.paymentSessions.initial.requiredAction` (object,null) The action to take (if any) in order to authorise the payment. This will be non-null if the customer's bank challenge the payment (i.e. 3DS) Example: {"type":"Redirect","url":"https://ryftpay.com/3ds-auth"} - `items.paymentSessions.initial.requiredAction.type` (string) The type of action Enum: "Redirect", "Identify", "Challenge" - `items.paymentSessions.initial.requiredAction.url` (string,null) The url to redirect to (if the requiredAction has type Redirect) Example: "https://ryftpay.com/3ds-auth" - `items.paymentSessions.initial.requiredAction.identify` (object,null) - `items.paymentSessions.initial.requiredAction.challenge` (object,null) - `items.paymentSessions.latest` (object) - `items.price` (object) - `items.price.amount` (integer) The amount (in minor units) that is charged on each recurring payment Example: 5000 - `items.price.currency` (string) The ISO currency code Example: "GBP" - `items.price.interval` (object) - `items.price.interval.unit` (string) The type of interval to wait for between charges Enum: "Days", "Months" - `items.price.interval.count` (number) The number of intervals between charges. e.g. type = Days & count = 60 would charge the customer every 60 days. Example: 1 - `items.price.interval.times` (number,null) (optional) The total number of charges throughout the lifecycle of the recurring series. Leave null for products that continue indefinitely. Example: 12 - `items.balance` (object) The full outstanding amount owed by the customer for this subscription. Any outstanding amount will be included in future cycle payments (on top of the recurring price) Example: {"amount":5000} - `items.balance.amount` (integer) The amount owed (in minor units of the currency in price) Example: 5000 - `items.pausePaymentDetail` (object,null) Non-null if you have paused payments for the subscription. - `items.pausePaymentDetail.reason` (string,null) Field describing why the subscription is paused. Example: "Offering service for free to customer" - `items.pausePaymentDetail.resumeAtTimestamp` (number,null) The epoch timestamp (seconds) when the subscription should resume collecting payments Example: 1470989538 - `items.pausePaymentDetail.pausedAtTimestamp` (number) The epoch timestamp (seconds) when the subscription was paused Example: 1470989538 - `items.cancelDetail` (object,null) Non-null if the subscription is cancelled - `items.cancelDetail.reason` (string,null) Field describing why the subscription is cancelled. Example: "Customer no longer wants to use the service" - `items.cancelDetail.cancelledAtTimestamp` (integer) The epoch timestamp (seconds) when the subscription was cancelled Example: 1480989538 - `items.billingDetail` (object) - `items.billingDetail.totalCycles` (number) The total number of billing cycles throughout the lifespan of the subscription. Example: 12 - `items.billingDetail.currentCycle` (number) The subscription's current billing cycle. e.g. given a monthly subscription for a 12 month recurring product, where the current date is 4 months removed from the initial charge will have currentCycle = 4 Example: 4 - `items.billingDetail.currentCycleStartTimestamp` (number) The (epoch) timestamp representing the start date for the current billing period. Example: 1480989538 - `items.billingDetail.currentCycleEndTimestamp` (number) The (epoch) timestamp representing the end date for the current billing period. Example: 1480989538 - `items.billingDetail.billingCycleTimestamp` (number) The (epoch) timestamp representing the date on which the customer will regularly be billed. e.g. 15th of each month. Example: 1480989538 - `items.billingDetail.nextBillingTimestamp` (number,null) The (epoch) timestamp representing the date on which we will next try to bill your customer. This will be equal to the billingCycleTimestamp at the start of each new billing cycle, but is updated should we fail to successfully charge the customer. The updated timestamp reflects when our recurring engine will retry payment. When 'null' it means that we are not currently planning to bill the customer again (it is Cancelled, Ended or Paused indefinitely) Example: 1480989538 - `items.billingDetail.failureDetail` (object,null) Non-null if the Subscription has become PastDue and one or more payment attempts have been unsuccessful. - `items.billingDetail.failureDetail.paymentAttempts` (number) The number of consecutive payment attempts that have failed. Example: 2 - `items.billingDetail.failureDetail.lastPaymentError` (string,null) The most recent error when attempting to Pay. Note that we may add further values without notice. Enum: "insufficient_funds", "declined_do_not_honour", "invalid_card_number", "cvv2_failure", "restricted_card", "blacklisted_card", "blacklisted_bin", "blacklisted_country", "blacklisted_ip", "risk_declined", "security_violation", "expired_card", "gateway_reject", "suspected_fraud", "contact_issuer", "not_permitted", "invalid_account", "pickup_card", "stolen_card", "issuer_decline", "closed_account", "account_not_activated", "limit_exceeded", "withdrawal_limit_exceeded", "blocked_by_cardholder", "3ds_authentication_failure", "3ds_cardholder_not_participating", "3ds_authentication_required", "payment_method_option_amex_disabled", "cvc_required", "payment_method_not_available", "payment_method_option_amex_not_available", "credit_card_not_permitted", "issuer_error", "system_error", "unknown_error" - `items.shippingDetails` (object,null) Example: {"address":{"firstName":"Fox","lastName":"Mulder","lineOne":"Stonehenge","postalCode":"SP4 7DE","city":"Salisbury","country":"GB"}} - `items.shippingDetails.address` (object) Example: {"firstName":"Fox","lastName":"Mulder","lineOne":"Stonehenge","postalCode":"SP4 7DE","city":"Salisbury","country":"GB"} - `items.shippingDetails.phoneNumber` (string,null) The phone number of the recipient receiving the goods, in E.164 format Example: "+447900000000" - `items.metadata` (object,null) use this parameter to attach key-value data to the subscription. These will be sent with any subscription events to your webhooks. You can have a maximum of 5 pieces of metadata. Example: {"myCustomerId":"1"} - `items.paymentSettings` (object) Settings for controlling fields/options on the underlying Payment Session's created by this subscription. - `items.paymentSettings.statementDescriptor` (any) Used to supply a dynamic statement descriptor for the payments created throughout the lifecycle of this subscription. Note that dynamic statement descriptors are not enabled by default and will be ignored if passed. Example: {"descriptor":"Ryft Ltd","city":"London"} - `items.createdTimestamp` (integer) The epoch timestamp (seconds) when the subscription was created Example: 1470989538 - `paginationToken` (string,null) A token to use for getting the next page of results - send the same request with this value in the 'paginationToken' query parameter. This field is null when there are no further items to return Example: "sub_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473" ## Response 400 fields (application/json): - `requestId` (string) Example: "b83f2653-06d7-44a9-a548-5825e8186004" - `code` (string) Example: "400" - `errors` (array) - `errors.message` (string) Example: "Required property 'amount' not found in JSON" ## Response 500 fields (application/json): - `requestId` (string) Example: "b83f2653-06d7-44a9-a548-5825e8186004" - `code` (string) Example: "400" - `errors` (array) - `errors.message` (string) Example: "Required property 'amount' not found in JSON"