- API Introduction
- Error Code
- Payment Intents
- Charges
- Payment Methods
- Refunds
- Webhooks
- Events
- Files
- Disputes
- Payouts
- Balance
- Products
- Prices
- Payment Links
- Checkout
- Customers
- Setup Intents
- Invoices
- Invoice Items
- Invoice Line Item
- Subscriptions
- Subscription Items
- Issuing
- Authorizations
- Cardholders
- Cards
- Transactions
- Coupons
- Promotion Code
- Accounts
Create a subscription
POST
/v1/subscriptions
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 YWRtaW46MTIzNDU2
Header Params
Accept
string
required
Default:
application/json
Content-Type
string
required
Default:
application/json
Body Params application/json
currency
string
optional
customer
string
required
default_payment_method
string | null
optional
description
string | null
optional
items
array [object {5}]
required
billing_thresholds
object
optional
metadata
object
required
price
string
required
price_data
object
required
quantity
integer
optional
metadata
string
optional
cancel_at
integer | null
optional
collection_method
string
optional
days_until_due
integer | null
optional
default_source
string | null
optional
next_pending_invoice_item_invoice
integer | null
optional
payment_settings
object
optional
payment_method_options
object (Payment Method Options)
optional
payment_method_types
string
optional
save_default_payment_method
string
optional
test_clock
string | null
optional
trial_period_days
integer
optional
add_invoice_items
object
optional
price
string
optional
price_data
object
optional
quantity
string
optional
Example
{
"currency": "string",
"customer": "string",
"default_payment_method": "string",
"description": "string",
"items": [
{
"billing_thresholds": {
"usage_gte": 0
},
"metadata": {},
"price": "string",
"price_data": {
"currency": "string",
"product": "string",
"recurring": {
"interval": "day",
"interval_count": 0
},
"unit_amount": 0
},
"quantity": 0
}
],
"metadata": "string",
"cancel_at": 0,
"collection_method": "string",
"days_until_due": 0,
"default_source": "string",
"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"
},
"test_clock": "string",
"trial_period_days": 0,
"add_invoice_items": {
"price": "string",
"price_data": {
"currency": "string",
"product": "string",
"unit_amount": "string"
},
"quantity": "string"
}
}
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 POST 'https://apitest.wooshpay.com/v1/subscriptions?members&reference&Type&_postman_listIndexKey=key&_postman_listAllowsMultipleValues' \
--data-raw ''
Responses
🟢200OK
application/json
Body
id
string
optional
object
string
optional
cancel_at_period_end
boolean
optional
currency
string
optional
current_period_end
integer
optional
current_period_start
integer
optional
customer
string
optional
default_payment_method
string | null
optional
description
string | null
optional
items
array [object {7}]
optional
id
string
optional
object
string
optional
metadata
string
optional
price
object
optional
quantity
integer
optional
subscription
string
optional
created
string
optional
latest_invoice
string | null
optional
metadata
string
optional
pending_setup_intent
string | null
optional
pending_update
object | null
optional
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
cancel_at
integer | null
optional
canceled_at
integer | null
optional
collection_method
string
optional
created
string
optional
days_until_due
integer | null
optional
default_source
string | null
optional
start_date
integer
optional
ended_at
integer
optional
livemode
boolean
optional
next_pending_invoice_item_invoice
integer | null
optional
payment_settings
object | null
optional
payment_method_options
object (Payment Method Options)
optional
payment_method_types
string
optional
save_default_payment_method
string
optional
pending_invoice_item_interval
object
optional
schedule
string
optional
trial_start
integer | null
optional
trial_end
integer | null
optional
test_clock
string | null
optional
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"
},
"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": {
"taxid": "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"
}
Modified at 2024-11-11 09:30:25