Subscriptions

List subscriptions

Changed on

Used to fetch a paginated list of subscriptions

get/subscriptions

Request

  • Base URL
    https://sandbox-api.ryftpay.com/v1
  • URL
    https://sandbox-api.ryftpay.com/v1/subscriptions
  • Auth
    API key in header Authorization

Query parameters

startTimestampinteger
Example:1641859200

The start timestamp (inclusive), it must be before the endTimestamp. If not provided will default to midnight on the current date (UTC).

endTimestampinteger
Example:1641945599

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).

ascendingboolean

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.

limitinteger
Example:10

Control how many items are return in a given page The max limit we allow is 25. The default is 10.

startsAfterstring
Example:sub_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473

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.

Response

Successfully retrieved the subscriptions

paginationTokenstring nullable

A token to use for getting the next page of results - send the same request with this value in the 'startsAfter' query parameter. This field is null when there are no further items to return

Example response

{
  "items": [
    {
      "id": "sub_01G0EYVFR02KBBVE2YWQ8AKMGJ",
      "status": "Active",
      "description": "Bob's monthly gym membership",
      "customer": {
        "id": "cus_01G0EYVFR02KBBVE2YWQ8AKMGJ"
      },
      "paymentMethod": {
        "id": "pmt_01G0EYVFR02KBBVE2YWQ8AKMGJ"
      },
      "paymentSessions": {
        "initial": {
          "id": "ps_01G0EYVFR02KBBVE2YWQ8AKMGJ",
          "clientSecret": "ps_01FCTS1XMKH9FF43CAFA4CXT3P_secret_b83f2653-06d7-44a9-a548-5825e8186004",
          "requiredAction": {
            "type": "Redirect",
            "url": "https://ryftpay.com/3ds-auth"
          }
        },
        "latest": {
          "id": "ps_01G0EYVFR02KBBVE2YWQ8AKMGJ",
          "clientSecret": "ps_01FCTS1XMKH9FF43CAFA4CXT3P_secret_b83f2653-06d7-44a9-a548-5825e8186004",
          "requiredAction": {
            "type": "Redirect",
            "url": "https://ryftpay.com/3ds-auth"
          }
        }
      },
      "price": {
        "amount": 5000,
        "currency": "GBP",
        "interval": {
          "unit": "Months",
          "count": 1,
          "times": 12
        }
      },
      "balance": {
        "amount": 5000
      },
      "pausePaymentDetail": {
        "reason": "Offering service for free to customer",
        "resumeAtTimestamp": 1470989538,
        "pausedAtTimestamp": 1470989538
      },
      "cancelDetail": {
        "reason": "Customer no longer wants to use the service",
        "cancelledAtTimestamp": 1480989538
      },
      "billingDetail": {
        "totalCycles": 12,
        "currentCycle": 4,
        "currentCycleStartTimestamp": 1480989538,
        "currentCycleEndTimestamp": 1480989538,
        "billingCycleTimestamp": 1480989538,
        "nextBillingTimestamp": 1480989538,
        "failureDetail": {
          "paymentAttempts": 2,
          "lastPaymentError": "insufficient_funds"
        }
      },
      "shippingDetails": {
        "address": {
          "firstName": "Fox",
          "lastName": "Mulder",
          "lineOne": "Stonehenge",
          "postalCode": "SP4 7DE",
          "city": "Salisbury",
          "country": "GB"
        }
      },
      "metadata": {
        "myCustomerId": "1"
      },
      "paymentSettings": {
        "statementDescriptor": {
          "descriptor": "Ryft Ltd",
          "city": "London"
        }
      },
      "createdTimestamp": 1470989538
    }
  ],
  "paginationToken": "sub_01FCTS1XMKH9FF43CAFA4CXT3P_1641912473"
}

Changes

    • warning

      added the new 3ds_authentication_not_supported enum value to the //// response property for the response status

    • warning

      added the new authorisation_denied enum value to the //// response property for the response status

    • warning

      added the new in_person_terminal_action_cancelled enum value to the //// response property for the response status

    • warning

      added the new in_person_terminal_action_timeout enum value to the //// response property for the response status

    • warning

      added the new in_person_terminal_busy enum value to the //// response property for the response status

    • warning

      added the new in_person_terminal_not_available enum value to the //// response property for the response status

    • warning

      added the new payment_cancelled enum value to the //// response property for the response status

    • warning

      added the new recurring_series_terminated enum value to the //// response property for the response status