WooshPay OpenAPI
Product DocumentAPI ReferenceJS SDK ReferenceSaaS Platform Integration
Product DocumentAPI ReferenceJS SDK ReferenceSaaS Platform Integration
Back to WooshPay Website
  1. Subscriptions
  • API Introduction
  • Error Code
  • Payment Intents
    • Create a PaymentIntent
      POST
    • Update a PaymentIntent
      POST
    • Cancel a PaymentIntent
      POST
    • Capture a PaymentIntent
      POST
    • Confirm a PaymentIntent
      POST
    • Retrieve a PaymentIntent
      GET
    • List all PaymentIntents
      GET
    • Search PaymentIntents
      GET
  • Charges
    • Retrieve a charge
      GET
    • List all charges
      GET
  • Payment Methods
    • Create a PaymentMethod
      POST
    • Retrieve a PaymentMethod
      GET
    • Retrieve a Customer's PaymentMethod
      GET
    • Update a PaymentMethod
      POST
    • List PaymentMethods
      GET
    • List a Customer's PaymentMethods
      GET
    • Attach a PaymentMethod to a Customer
      POST
    • Detach a PaymentMethod from a Customer
      POST
  • Refunds
    • Create a refund
      POST
    • Retrieve a refund
      GET
  • Webhooks
    • Create a Webhook
    • List All Webhooks
    • Retrieve a Webhook
    • Delete a Webhook
    • Update a Webhook
  • Events
    • Types of events
    • Retrieve an event
  • Files
    • Files
    • Create a file
    • Retrieve a file
  • Disputes
    • Retrieve a dispute
    • Update a dispute
    • Close a dispute
    • List all disputes
  • Payouts
    • Beneficiary
      • Create a beneficiary
      • Retrieve a beneficiary
      • List all beneficiaries
      • Update a beneficiary
      • Delete a beneficiary
    • Payouts
      • Create a payout
      • Retrieve a Payout
      • Update a Payout
      • List All Payouts
  • Balance
    • Get balance
  • Products
    • Create a Product
    • Retrieve a product
    • Update a product
    • List all products
  • Prices
    • Create a price
    • Retrieve a price
    • Update a price
  • Payment Links
    • Create a payment link
    • Update a payment link
    • Retrieve payment link
    • List all payment links
    • Retrieve a payment link's line items
  • Checkout
    • Create a Session
    • Expire a Session
    • Retreive a Session
    • List All Checkout Sessions
    • Retrieve a Checkout Session's line items
  • Customers
    • Create a customer
    • Retrieve a customer
    • Update a customer
  • Invoices
    • Setup Intents
      • Create a SetupIntent
      • Retrieve a SetupIntent
      • Cancel a SetupIntent
      • List all SetupIntents
      • List all SetupAttempts
      • Update a SetupIntent
      • Confirm a SetupIntent
    • Create an invoice
    • Retrieve an invoice
    • Finalize an invoice
    • Send an invoice for manual payment
    • Delete a draft invoice
    • Void an invoice
    • List all invoices
    • Pay an invoice
  • Invoice Items
    • Create an invoice item
    • Retrieve an invoice item
  • Invoice Line Item
    • Bulk add invoice line items
  • Subscriptions
    • Create a subscription
      POST
    • Retrieve a subscription
      GET
    • Update a subscription
      POST
    • Cancel a subscription
      DELETE
    • List subscriptions
      GET
  • Subscription Items
    • Create a subscription item
    • Retrieve a subscription item
    • Delete a subscription item
  • Issuing
    • Authorizations
      • Retrieve an authorization
      • List all authorization
    • Cardholders
      • Create a cardholder
      • Update a cardholder
      • Retrieve a cardholder
      • List all cardholders
    • Cards
      • Create a card
      • Update a card
      • Retrieve a card
      • List all cards
      • Retrieve card remaining limits
    • Transactions
      • Update a transaction
      • Retrieve a transaction
      • List all transactions
  • Coupons
    • Create a Coupon
    • Retrieve a coupon
    • Delete a coupon
  • Promotion Code
    • Create a promotion code
    • Update a promotion code
  • Accounts
    • Retrieve account's paymentmethods
  • Fx Quote
    • Create an FX Quote
  1. Subscriptions

Retrieve a subscription

GET
/v1/subscriptions/{id}

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Path Params
id
string 
required
Example:
sub_1797505110591406080
Header Params
Accept
string 
required
Default:
application/json
Content-Type
string 
required
Default:
application/json

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://apitest.wooshpay.com/v1/subscriptions/sub_1797505110591406080' \
--header 'Accept;' \
--header 'Authorization: Basic Og=='

Responses

🟢200OK
application/json
Body
id
string 
optional
Unique identifier for the object.
object
string 
optional
value is "subscription"
cancel_at_period_end
boolean 
optional
If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
currency
string 
optional
Three-letter ISO currency code, in lowercase. Must be a supported currency.
current_period_end
integer 
optional
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
current_period_start
integer 
optional
Start of the current period that the subscription has been invoiced for.
customer
string 
optional
EXPANDABLE. ID of the customer who owns the subscription.
default_payment_method
string  | null 
optional
EXPANDABLE. ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer’s invoice_settings.default_payment_method or default_source.
description
string  | null 
optional
The subscription’s description, meant to be displayable to the customer.
items
array [object {7}] 
optional
id
string 
optional
Unique identifier for the object.
object
string 
optional
String representing the object’s type. Objects of the same type share the same value.
metadata
string 
optional
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
price
object 
optional
The price the customer is subscribed to.
quantity
integer 
optional
The quantity of the plan to which the customer should be subscribed.
subscription
string 
optional
The subscription this subscription_item belongs to.
created
string 
optional
Time at which the object was created. Measured in seconds since the Unix epoch.
latest_invoice
string  | null 
optional
The most recent invoice this subscription has generated.
metadata
string 
optional
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
pending_setup_intent
string  | null 
optional
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
pending_update
object  | null 
optional
You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription’s payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide.
billing_cycle_anchor
string 
optional
expires_at
string 
optional
subscription_items
string 
optional
trial_end
string 
optional
trial_from_plan
string 
optional
status
string 
optional
Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.
cancel_at
integer  | null 
optional
A date in the future at which the subscription will automatically get canceled
canceled_at
integer  | null 
optional
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
collection_method
string 
optional
Either charge_automatically, or send_invoice.
created
string 
optional
Time at which the object was created. Measured in seconds since the Unix epoch.
days_until_due
integer  | null 
optional
Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically.
default_source
string  | null 
optional
start_date
integer 
optional
Date when the subscription was first created. The date might differ from the created date due to backdating.
ended_at
integer 
optional
If the subscription has ended, the date the subscription ended.
livemode
boolean 
optional
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
next_pending_invoice_item_invoice
integer  | null 
optional
Timestamp. Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval.
payment_settings
object  | null 
optional
Payment settings passed on to invoices created by the subscription.
payment_method_options
object (Payment Method Options) 
optional
Payment-method-specific configuration for this PaymentIntent.
payment_method_types
string 
optional
save_default_payment_method
string 
optional
Either off, or on_subscription.
pending_invoice_item_interval
object 
optional
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval.
schedule
string 
optional
The schedule attached to the subscription
trial_start
integer  | null 
optional
If the subscription has a trial, the beginning of that trial.
trial_end
integer  | null 
optional
If the subscription has a trial, the end of that trial.
test_clock
string  | null 
optional
ID of the test clock this subscription belongs to.
Example
{
    "id": "string",
    "object": "string",
    "cancel_at_period_end": true,
    "currency": "string",
    "current_period_end": 0,
    "current_period_start": 0,
    "customer": "string",
    "default_payment_method": "string",
    "description": "string",
    "items": [
        {
            "id": "string",
            "object": "string",
            "metadata": "string",
            "price": {
                "id": "string",
                "object": "string",
                "active": true,
                "billing_scheme": "per_unit",
                "created": 0,
                "currency": "string",
                "livemode": true,
                "lookup_key": "string",
                "metadata": {},
                "nickname": "string",
                "product": "string",
                "type": "one_time",
                "unit_amount": 0,
                "recurring": {
                    "interval": "day",
                    "interval_count": 0,
                    "usage_type": "licensed"
                },
                "tiers_mode": null,
                "tiers": [
                    {
                        "up_to": "string",
                        "flat_amount": "string",
                        "unit_amount": "string"
                    }
                ]
            },
            "quantity": 0,
            "subscription": "string",
            "created": "string"
        }
    ],
    "latest_invoice": "string",
    "metadata": "string",
    "pending_setup_intent": "string",
    "pending_update": {
        "billing_cycle_anchor": "string",
        "expires_at": "string",
        "subscription_items": "string",
        "trial_end": "string",
        "trial_from_plan": "string"
    },
    "status": "string",
    "cancel_at": 0,
    "canceled_at": 0,
    "collection_method": "string",
    "created": "string",
    "days_until_due": 0,
    "default_source": "string",
    "start_date": 0,
    "ended_at": 0,
    "livemode": true,
    "next_pending_invoice_item_invoice": 0,
    "payment_settings": {
        "payment_method_options": {
            "card": {
                "request_three_d_secure": "any",
                "setup_future_usage": "on_session",
                "capture_method": "string",
                "tax_id": "string"
            },
            "alipayplus": {
                "terminal_type": "APP",
                "os_type": "IOS"
            },
            "alipay_hk": {
                "terminal_type": "APP",
                "os_type": "IOS"
            },
            "alipay": {
                "terminal_type": "APP",
                "os_type": "IOS"
            },
            "wechat_pay": {
                "terminal_type": "WEB",
                "client_ip": "string",
                "os_type": "IOS",
                "openid": "string"
            },
            "sepa_debit": {},
            "akulaku": {
                "terminal_type": "WEB",
                "os_type": "IOS"
            },
            "truemoney": {
                "terminal_type": "WEB",
                "os_type": "IOS"
            },
            "kakaopay": {
                "terminal_type": "WEB",
                "os_type": "IOS"
            },
            "shopeepay": {
                "terminal_type": "string",
                "os_type": "string"
            },
            "dana": {
                "terminal_type": "string",
                "os_type": "string"
            },
            "pix": {
                "tax_id": "string"
            }
        },
        "payment_method_types": "string",
        "save_default_payment_method": "string",
        "pending_invoice_item_interval": {
            "interval": "string",
            "interval_count": "string"
        },
        "schedule": "string"
    },
    "trial_start": 0,
    "trial_end": 0,
    "test_clock": "string"
}
Previous
Create a subscription
Next
Update a subscription
Built with