Skip to main content

QuerySubscription

POST 

/v1/subscription/query

Query subscription plan

Request

Body

required

    id string

    The id when creating subscription respond.

    reference_id string

    The id of this subscription you defined when creating subscription.

    subscription_ids

    object

    The subscription ids for batch query.

    ids string[]

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

    id string

    The id of the subscriber.

    midas_login_id string

    The midas login id (muid) of the subscriber. Apply only to midasbuy.

Responses

OK

Response

    subscriptions

    object[]

    The list of subscriptions.

  • Array [

  • id string

    The id when creating subscription respond.

    reference_id string

    The id of this subscription you defined when creating subscription.

    merchant_id string

    The id of the merchant.

    sub_merchant_id string

    The id of the sub merchant (eg., merchant application ID).

    subscriber

    object

    Subscriber

    id string

    non-empty and <= 64 characters

    The id of the subscriber.

    midas_login_id string

    The midas login id (muid) of the subscriber. Apply only to midasbuy.

    name string

    The name of the subscriber.

    email email

    The email of the subscriber.

    ip ip

    The ip of the subscriber.

    phone_number string

    The phone number of the subscriber.

    address

    object

    Address of payer or payee

    country string

    country (eg. CN) -- use region_code instead

    state_or_province string

    <= 100 characters

    ISO 3166-2 define

    city string

    city

    county string

    county

    region_code string

    region code

    street string

    street name

    house_number_or_name string

    house info

    postal_code string

    <= 100 characters

    address postal code

    status enum

    [UNKNOWN, PENDING, APPROVED, ACTIVE, SUSPENDED, CANCELLED, VOIDED, COMPLETED]

    Indicate the status of this subscription.

    subscription_units

    object[]

    The subscription units of this subscription.

  • Array [

  • product

    object

    Product

    id string

    non-empty

    The id of the product.

    name string

    The name of the product.

    description string

    The description of the product.

    type enum

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

    period_unit enum

    [UNKNOWN, DAY, MONTH, YEAR]

    Period unit.

    value int32

    The number of period unit. When using DAY as the period unit, the value must be at least 7 (i.e., value >= 7).

    sequence int32

    Indicate order of the whole subscription. We will execute the subscription units by the sequence you specified.

    total_cycles int32

    The number of times this cycle gets executed.

    current_cycle int32

    Indicate how many times the deduction of this subscription unit has been executed successfully.

    amount

    object

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency.see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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

  • Array [

  • tax_type enum

    [UNKNOWN, ECOMMERCE_CONSUMPTION_TAX]

    tax type

    tax_name string

    non-empty

    tax name

    tax_rate string

    Tax as a percentage of total amount example: value 8 means the tax as a percentage of total amount is 8%

    tax_amount

    object

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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 string

    tax reference

    item_total

    object

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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_check_mode enum

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

    tax_mode enum

    [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

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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

    currency_code string

    The three-character ISO-4217 currency code that identifies the currency. see: https://en.wikipedia.org/wiki/ISO_4217#Active_codes

    value string

    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.

    status enum

    [UNKNOWN, PENDING, APPROVED, ACTIVE, SUSPENDED, CANCELLED, VOIDED, COMPLETED]

    Indicate the status of this subscription unit when you query the subscription.

  • ]

  • executed_counts int32

    The number of times this subscription has been executed (charged).

    next_deduction_time string

    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

    next_execution_time string

    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.

    current_period_end_time string

    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

    card_bin string

    The card bin of the card no.

    card_hash string

    The hash of the card no.

    card_mask string

    The mask of the card, it shows the first six and last four digits of the card.

    expiry_month string

    The expire of month.

    expiry_year string

    The expire of year.

    cvc string

    The card verification value.

    funding_source string

    funding source name

    holder_name string

    The name of card holder.

    card_issuing_country string

    card issuing country

    card_brand string

    card brand

    card_cooperation_brand string

    card cooperation brand

    score string

    card score, a larger value indicates a higher priority

    card_type string

    visa、mc、amex、jcb、Discover : scheme; mada_card:mada_card ..

    card_md5 string

    card number md5

    card_pwd string

    The card verification value.

    selected_brand string

    the selected brand for co-brand.

    card_contract_id string

    card contract id, used for card contract payment, if store_recurring_payment_method is true, this field will returned by payments rsp.

  • ]

Loading...