QuerySubscription
POST/v1/subscription/query
Query subscription plan
Request
- application/json
Body
required
The id when creating subscription respond.
The id of this subscription you defined when creating subscription.
subscription_ids
object
The subscription ids for batch query.
>= 1, <= 10
The list of subscription ids. Minimum: 1 id, Maximum: 10 ids.
subscriber
object
The subscriber of this subscription. Deprecated. Use the "SubscriptionIds" field instead.
The id of the subscriber.
The midas login id (muid) of the subscriber. Apply only to midasbuy.
Responses
- 200
- default
OK
- application/json
- Response
- Example
- Query regular subscription
- Query trial for the first seven days subscription
Response
Array [
Array [
Array [
]
]
]
subscriptions
object[]
The list of subscriptions.
The id when creating subscription respond.
The id of this subscription you defined when creating subscription.
The id of the merchant.
The id of the sub merchant (eg., merchant application ID).
subscriber
object
Subscriber
non-empty and <= 64 characters
The id of the subscriber.
The midas login id (muid) of the subscriber. Apply only to midasbuy.
The name of the subscriber.
The email of the subscriber.
The ip of the subscriber.
The phone number of the subscriber.
address
object
Address of payer or payee
country (eg. CN) -- use region_code instead
<= 100 characters
ISO 3166-2 define
city
county
region code
street name
house info
<= 100 characters
address postal code
[UNKNOWN, PENDING, APPROVED, ACTIVE, SUSPENDED, CANCELLED, VOIDED, COMPLETED]
Indicate the status of this subscription.
subscription_units
object[]
The subscription units of this subscription.
product
object
Product
non-empty
The id of the product.
The name of the product.
The description of the product.
[UNKNOWN, REGULAR, PROMOTIONAL]
Indicate the unit is regular or promotional(free trial, discount etc.)
period
object
Period value multiply period unit equals the duration of subscription unit. If period.period_unit = MONTH, it represents a calendar (natural) month. For example, a period starting on Jan 31 will renew on Feb 28/29. If a fixed-length period like "31 days" is desired instead of a natural month, use period.period_unit = DAY and period.value = 31.
[UNKNOWN, DAY, MONTH, YEAR]
Period unit.
The number of period unit. When using DAY as the period unit, the value must be at least 7 (i.e., value >= 7).
Indicate order of the whole subscription. We will execute the subscription units by the sequence you specified.
The number of times this cycle gets executed.
Indicate how many times the deduction of this subscription unit has been executed successfully.
amount
object
The three-character ISO-4217 currency code that identifies the currency.see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value as the summary of all kinds of total_amount in breakdown, which might be:An integer for currencies like JPY that are not typically fractional.A decimal fraction for currencies like TND that are subdivided into thousandths.For the required number of decimal places for a currency code, see Currency Codes.
breakdown
object
tax_total
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
taxes
object[]
The tax with breakdown
[UNKNOWN, ECOMMERCE_CONSUMPTION_TAX]
tax type
non-empty
tax name
Tax as a percentage of total amount example: value 8 means the tax as a percentage of total amount is 8%
tax_amount
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
tax reference
item_total
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
[UNKNOWN, TOTAL_AMOUNT, ITEM_AMOUNT]
Tax check mode, check tax by total amount or item amount. If merchant use payment_method=CHECKOUT_PAGE, this field is optional, and no need present tax_check_mode, tax_total of breakdown, taxes of breakdown. Otherwise, this field is required, and merchant should present tax_check_mode, tax_total of breakdown, taxes of breakdown.
[UNKNOWN, TAX_INCLUSIVE, TAX_EXCLUSIVE, NOT_TAX, TAX_DELAY]
tax mode This field is provided by system, merchant should not set it.
discount_display
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
remaining_discount_display
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
before_discount_display
object
The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
Value must match regular expression ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
The value, which might be: An integer for currencies like JPY that are not typically fractional. A decimal fraction for currencies like TND that are subdivided into thousandths. For the required number of decimal places for a currency code, see Currency Codes.
[UNKNOWN, PENDING, APPROVED, ACTIVE, SUSPENDED, CANCELLED, VOIDED, COMPLETED]
Indicate the status of this subscription unit when you query the subscription.
The number of times this subscription has been executed (charged).
The next deduction time for this subscription. Typically, the automatic renewal charge (auto-debit) is scheduled one day before the current subscription period ends, to ensure uninterrupted service. This field represents the planned charge time for the next billing cycle. Internet date and time format, see: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
The next execution time (i.e., the end time of the current subscription period). This is also the effective start time of the next subscription period if the renewal succeeds. It represents when the current cycle expires and the next one begins. Internet date and time format, see: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6 Deprecated: Use current_period_end_time instead.
The end time of the current subscription period. This is also the effective start time of the next subscription period if the renewal succeeds. It represents when the current cycle expires and the next one begins. Internet date and time format, see: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
card_info
object
The card bin of the card no.
The hash of the card no.
The mask of the card, it shows the first six and last four digits of the card.
The expire of month.
The expire of year.
The card verification value.
funding source name
The name of card holder.
card issuing country
card brand
card cooperation brand
card score, a larger value indicates a higher priority
visa、mc、amex、jcb、Discover : scheme; mada_card:mada_card ..
card number md5
The card verification value.
the selected brand for co-brand.
card contract id, used for card contract payment, if store_recurring_payment_method is true, this field will returned by payments rsp.
{
"subscriptions": [
{
"id": "string",
"reference_id": "string",
"merchant_id": "string",
"sub_merchant_id": "string",
"subscriber": {
"id": "string",
"midas_login_id": "string",
"name": "string",
"email": "user@example.com",
"ip": "string",
"phone_number": "string",
"address": {
"country": "string",
"state_or_province": "string",
"city": "string",
"county": "string",
"region_code": "string",
"street": "string",
"house_number_or_name": "string",
"postal_code": "string"
}
},
"status": "UNKNOWN",
"subscription_units": [
{
"product": {
"id": "string",
"name": "string",
"description": "string"
},
"type": "UNKNOWN",
"period": {
"period_unit": "UNKNOWN",
"value": 0
},
"sequence": 0,
"total_cycles": 0,
"current_cycle": 0,
"amount": {
"currency_code": "string",
"value": "string",
"breakdown": {
"tax_total": {
"currency_code": "string",
"value": "string"
},
"taxes": [
{
"tax_type": "UNKNOWN",
"tax_name": "string",
"tax_rate": "string",
"tax_amount": {
"currency_code": "string",
"value": "string"
}
}
],
"tax_reference": "string",
"item_total": {
"currency_code": "string",
"value": "string"
}
},
"tax_check_mode": "UNKNOWN",
"tax_mode": "UNKNOWN",
"discount_display": {
"currency_code": "string",
"value": "string"
},
"remaining_discount_display": {
"currency_code": "string",
"value": "string"
},
"before_discount_display": {
"currency_code": "string",
"value": "string"
}
},
"status": "UNKNOWN"
}
],
"executed_counts": 0,
"next_deduction_time": "string",
"next_execution_time": "string",
"current_period_end_time": "string",
"card_info": {
"card_bin": "string",
"card_hash": "string",
"card_mask": "string",
"expiry_month": "string",
"expiry_year": "string",
"cvc": "string",
"funding_source": "string",
"holder_name": "string",
"card_issuing_country": "string",
"card_brand": "string",
"card_cooperation_brand": "string",
"score": "string",
"card_type": "string",
"card_md5": "string",
"card_pwd": "string",
"selected_brand": "string",
"card_contract_id": "string"
}
}
]
}
{
"subscriptions": [
{
"id": "20250605132646SB17693869",
"reference_id": "SG250702129D5HE8NYX56E",
"merchant_id": "merchant_id_0001",
"sub_merchant_id": "sub_merchant_id_0001",
"subscriber": {
"id": "uid001",
"midas_login_id": "muid001",
"name": "John Smith",
"email": "john.smith@midas.com"
},
"status": "ACTIVE",
"subscription_units": [
{
"product": {
"id": "puid001",
"name": "Music Vip",
"description": "XX Music Vip Business"
},
"type": "REGULAR",
"period": {
"period_unit": "MONTH",
"value": 1
},
"sequence": 1,
"total_cycles": 0,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "ACTIVE"
}
],
"executed_counts": 1,
"next_deduction_tiem": "2025-07-04T13:25:46.000Z",
"next_execution_time": "2025-07-04T13:26:46.000Z",
"current_period_end_time": "2025-07-04T13:26:46.000Z"
}
]
}
{
"subscriptions": [
{
"id": "20250605132646SB17693869",
"reference_id": "SG250702129D5HE8NYX56E",
"merchant_id": "merchant_id_0001",
"sub_merchant_id": "sub_merchant_id_0001",
"subscriber": {
"id": "uid001",
"midas_login_id": "muid001",
"name": "John Smith",
"email": "john.smith@midas.com"
},
"status": "ACTIVE",
"subscription_units": [
{
"product": {
"id": "puid001_001",
"name": "Music Vip 01",
"description": "XX Music Vip Business Trial"
},
"type": "PROMOTIONAL",
"period": {
"period_unit": "DAY",
"value": 7
},
"sequence": 1,
"total_cycles": 1,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "COMPLETED"
},
{
"product": {
"id": "puid001",
"name": "Music Vip",
"description": "XX Music Vip Business"
},
"type": "REGULAR",
"period": {
"period_unit": "MONTH",
"value": 1
},
"sequence": 1,
"total_cycles": 0,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "ACTIVE"
}
],
"executed_counts": 1,
"last_execution_time": "2025-06-05T13:26:46.000Z",
"next_execution_time": "2025-07-04T13:26:46.000Z",
"current_period_end_time": "2025-07-04T13:26:46.000Z"
}
]
}
Error response structure
- application/json
- Response
- Example
- Query regular subscription
- Query trial for the first seven days subscription
Response
Array [
]
Array [
]
details
object[]
The type of the serialized message.
causes
object[]
{
"name": "string",
"message": "string",
"details": [
{
"@type": "string"
}
],
"debug_id": "string",
"causes": [
{
"cause": "string",
"solution": "string"
}
]
}
{
"subscriptions": [
{
"id": "20250605132646SB17693869",
"reference_id": "SG250702129D5HE8NYX56E",
"merchant_id": "merchant_id_0001",
"sub_merchant_id": "sub_merchant_id_0001",
"subscriber": {
"id": "uid001",
"midas_login_id": "muid001",
"name": "John Smith",
"email": "john.smith@midas.com"
},
"status": "ACTIVE",
"subscription_units": [
{
"product": {
"id": "puid001",
"name": "Music Vip",
"description": "XX Music Vip Business"
},
"type": "REGULAR",
"period": {
"period_unit": "MONTH",
"value": 1
},
"sequence": 1,
"total_cycles": 0,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "ACTIVE"
}
],
"executed_counts": 1,
"next_deduction_tiem": "2025-07-04T13:25:46.000Z",
"next_execution_time": "2025-07-04T13:26:46.000Z",
"current_period_end_time": "2025-07-04T13:26:46.000Z"
}
]
}
{
"subscriptions": [
{
"id": "20250605132646SB17693869",
"reference_id": "SG250702129D5HE8NYX56E",
"merchant_id": "merchant_id_0001",
"sub_merchant_id": "sub_merchant_id_0001",
"subscriber": {
"id": "uid001",
"midas_login_id": "muid001",
"name": "John Smith",
"email": "john.smith@midas.com"
},
"status": "ACTIVE",
"subscription_units": [
{
"product": {
"id": "puid001_001",
"name": "Music Vip 01",
"description": "XX Music Vip Business Trial"
},
"type": "PROMOTIONAL",
"period": {
"period_unit": "DAY",
"value": 7
},
"sequence": 1,
"total_cycles": 1,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "COMPLETED"
},
{
"product": {
"id": "puid001",
"name": "Music Vip",
"description": "XX Music Vip Business"
},
"type": "REGULAR",
"period": {
"period_unit": "MONTH",
"value": 1
},
"sequence": 1,
"total_cycles": 0,
"current_cycle": 1,
"amount": {
"currency_code": "USD",
"value": "68.0"
},
"status": "ACTIVE"
}
],
"executed_counts": 1,
"last_execution_time": "2025-06-05T13:26:46.000Z",
"next_execution_time": "2025-07-04T13:26:46.000Z",
"current_period_end_time": "2025-07-04T13:26:46.000Z"
}
]
}