Skip to main content
POST
/
subscription
/
apply
Subscription Application
curl --request POST \
  --url https://uat-interface.haipay.asia/subscription/apply \
  --header 'Content-Type: application/json' \
  --data '
{
  "country": "USA",
  "referer": "https://test.com",
  "amount": "0.5",
  "callBackUrl": "https://www.google.com",
  "inBankCode": "CREDIT_CARD",
  "subject": "Test subscription",
  "subscriptionOrderId": "1736739758574",
  "recurringIntervalCount": 1,
  "sign": "JeJR4N40eKncoohebUN31aNqPqpBxR799rmMutqrSmMaBn0Sjmqbskl4Wiitmatvvx6tqvuwkOYtk6ryrYj7YqJxDeNfDqthWzOxv2ixkKY0YDoWEAra9sWc4CnXBBssP0VIKg0jSTMNzdvmvuNBa7sLEQj5YjgswUnCGtYCmsz154JHSSRpdeYDLL+Nt5b96pzQn8WyRr6b/9SSCrLCWSdt22gJmY5sQh7cc9OcJfAGb5E1XflTq5Va78cV+fw9hHhaZmFzKncg4wxrdaatxg9tCElMJpL1OuWO7XLfcfqgA/8Y/qRCWmNf11Ji3ZSrr7rU4+V7Egrfu1Fcr5DTlw==",
  "partnerUserId": "H20241231",
  "payType": "SUBSCRIPTION",
  "phone": "0845632145871",
  "appId": 1724,
  "name": "howard",
  "notifyUrl": "https://www.google.com",
  "currency": "USD",
  "email": "howard@gmail.com",
  "recurringInterval": "D"
}
'
{
  "status": "1",
  "error": "00000000",
  "msg": "",
  "data": {
    "subscriptionNo": "4025011311423010028",
    "subscriptionOrderId": "1736739758574",
    "appId": 1724,
    "subject": "Test subscription",
    "payType": "SUBSCRIPTION",
    "inBankCode": "CREDIT_CARD",
    "amount": 0.5,
    "recurringInterval": "D",
    "recurringIntervalCount": 1,
    "status": "2",
    "sign": "QrOo7yPJMTRk92bP9WU8P0ATdRvCm8dWElhbxqV6qmZEWZDRXeJAwUvd3839zErg+3tN/U4Rwyru219AkXg9CJZtocna3fiYj7uLxwD6bpAp+i9DGz5ZKV9ab5mwIEPWIQXKuY6wATzmlz6W4TvAkRqgGtqLkwYUaeqsmgJrh4WlIMK13GW/zvoCmYfFD6pNZUByVixpll8JPeZG7F9d+x7yjDigJZ2S1wm4F307OzZJkUSKSvQn6Q0lOvp1JS0feXSC+hwCfrdllFXIE10TDV0itoPY5G7+3QdmHpINWp3kWmepR/1pOsN+09hLxe8xKAIZrX2GFHY00xo3QnxBIw=="
  }
}

Secret Key & Private Key (Generate Signature)

Body

application/json
appId
integer
required

Business ID (obtained from the backend, must pass the corresponding business ID according to the currency in the URL)

subscriptionOrderId
string
required

Merchant order ID (must be unique, max length 48)

Maximum string length: 48
amount
string
required

Transaction amount (accurate to two decimals; punctuation such as “,” is not allowed)

Pattern: ^\d+\.\d{2}$
name
string
required

User name, recommended to use real name. Format: includes firstName and lastName, separated by space. Example: Donald John Trump

phone
string
required

Real phone number

email
string<email>
required

Real email

subject
string
required

Subscription title

inBankCode
enum<string>
required

CREDIT_CARD, GOOGLE_PAY, APPLE_PAY

Available options:
CREDIT_CARD,
GOOGLE_PAY,
APPLE_PAY
payType
enum<string>
required

SUBSCRIPTION

Available options:
SUBSCRIPTION
callBackUrl
string<uri>
required

Redirect URL after successful payment

notifyUrl
string<uri>
required

Asynchronous notification URL

country
string
required

Country

currency
enum<string>
required

Currency, currently supported: USD

Available options:
USD
partnerUserId
string
required

User unique identifier (e.g., userId). Used for risk control. Must be real and valid, otherwise it will affect the transaction. Format: digits, letters, or common symbols -~!@#$%&*()_.

Pattern: ^[A-Za-z0-9\-~!@#$%&*()_]+$
recurringInterval
enum<string>
required

Recurring cycle type D(day),W(week),M(month),Y(year)

Available options:
D,
W,
M,
Y
recurringIntervalCount
integer
required

Recurring cycle interval

Required range: x >= 1
recurringMaxNumber
integer
required

Maximum number of cycles. Regardless of cycle type, maximum duration cannot exceed 3 years. Subscription will be automatically canceled at expiration.

Required range: x >= 1
website
string<uri>
required

Transaction website

retryTimes
integer
default:3
required

Retry attempts for failed periodic deductions, default 3

Required range: x >= 0
sign
string
required

Signature

body
string

Remark details

cancelUrl
string<uri>

If provided, the user can click “Back” on the payment page to return to this URL.

couponPeriod
integer

Discount Period (Currently only the first period discount and the full period discount are supported, i.e., couponPeriod can only be equal to 1 or recurringMaxNumber)

couponAmountPerPeriod
string

Discount amount per period

Pattern: ^\d+\.\d{2}$

Response

200 - application/json
status
string

1: Normal, 0: Exception

error
string

Error code

msg
string

Error description

data
object
Last modified on April 10, 2026