创建订阅(API Only)
Request Body Parameters
application/json公共请求参数
bizContent
durationObject必填trialObject可选autoRecoveryObject可选paymentMethodObject必填customerObject必填goodsArray必填billingAddressObject必填browserInfoObject可选deviceObject必填merchantSubscriptionIdString(64)必填商户定义的订阅计划的唯一ID。requestIdString(64)必填商户请求唯一编号。descriptionString(256)必填订阅计划的描述,例如 Youtube monthly menbership。redirectUrlString(255)必填订阅过程中需要商户处理的重定向地址,一般指3ds挑战页面,钱包授权绑定页面。startAtString(10)可选订阅开始时间,10 位秒级时间戳字符串。不填时默认取当前时间。endAtString(10)可选订阅结束时间,10 位秒级时间戳字符串。不推荐传值,若商户定义,严格执行。不传则默认自动续费。notifyUrlString(512)必填订阅计划通知地址。
地址建议:请填写基于公网域名的完整 URL,推荐使用标准 Web 端口(HTTPS 默认 443,HTTP 默认 80),并确保该地址可稳定接收 PingPongCheckout 的异步通知。amountString(12)必填每期扣款金额。currencyString(3)必填每期扣款币种,ISO 4217 三位币种代码。paymentNotifyUrlString(255)可选支付结果异步通知地址。
地址建议:请填写基于公网域名的完整 URL,推荐使用标准 Web 端口(HTTPS 默认 443,HTTP 默认 80),并确保该地址可稳定接收 PingPongCheckout 的异步通知。remarkString(255)可选商户扩展字段,响应中会原样返回。languageString(12)可选交互语言。tradeCountryString(2)必填交易国家,使用 ISO 3166-1 alpha-2 国家二字码。shopperIPString(64)必填用户下单IP,支持 IPv4 格式。merchantRequestBillDescriptorString(22)可选商家自定义动态账单描述,最长 22 个字符;仅允许英文字母、数字、空白字符及英文符号, . ( ) - / :,不允许中文或其他特殊符号。不同渠道侧可能会做适当截取。merchantUserIdString(256)必填商户侧用户唯一 ID。jsGeneratedDataString(256)按条件选卡支付必须接入风控组件,卡支付需要传,若获取失败,可传空字符串,不阻塞支付流程。通过嵌入pingpong提供的风控组件,获取浏览器相关信息的json字符串,传到这个参数中。使用风控插件对接的商户使用,详见3DS集成指南。
请求报文示例
{
"clientId": "2024061100000000001",
"accId": "20240611000000000010001",
"signType": "SHA256",
"sign": "SIGN_VALUE",
"version": "1.0",
"bizContent": {
"merchantSubscriptionId": "SUB_M_202606110001",
"requestId": "REQ_SUB_CREATE_001",
"description": "Monthly membership subscription",
"redirectUrl": "https://merchant.example.com/subscription/return",
"startAt": "1781116800",
"endAt": "1812652800",
"notifyUrl": "https://merchant.example.com/notify/subscription",
"duration": {
"periodCount": 1,
"periodUnit": "MONTH"
},
"trial": {
"startAt": "1781116800",
"endAt": "1781721600",
"periodDays": 7,
"amount": "0.00",
"currency": "USD"
},
"autoRecovery": {
"enabled": true
},
"amount": "9.99",
"currency": "USD",
"paymentNotifyUrl": "https://merchant.example.com/notify/payment",
"remark": "test subscription",
"language": "en",
"tradeCountry": "US",
"shopperIP": "8.8.8.8",
"merchantRequestBillDescriptor": "TEST SUB",
"merchantUserId": "USER_001",
"paymentMethod": {
"type": "scheme",
"cardInfo": {
"number": "4111111111111111",
"expireMonth": "12",
"expireYear": "2030",
"holderFirstName": "John",
"holderLastName": "Smith",
"cvv": "123"
}
},
"jsGeneratedData": "JS_GENERATED_DATA",
"customer": {
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@example.com",
"phone": "13800138000",
"phoneCountryCode": "86",
"identificationType": "ID_CARD",
"identificationId": "ID123456",
"birthDate": "1990-01-01",
"accountNumber": "123456789012",
"domesticCardNumber": "9704123456789012",
"domesticCardIssuingDate": "2020-01",
"domesticCardExpireMonth": "12",
"domesticCardExpireYear": "2030"
},
"goods": [
{
"name": "Membership",
"description": "Monthly membership",
"sku": "SKU_SUB_001",
"unitPrice": "9.99",
"number": "1",
"imgUrl": "https://merchant.example.com/goods/sub.png",
"virtualProduct": "Y",
"itemType": "1"
}
],
"billingAddress": {
"street": "1 Market St",
"postcode": "94105",
"city": "San Francisco",
"state": "CA",
"country": "US",
"district": "SOMA"
},
"browserInfo": {
"windowSize": "05",
"acceptHeader": "text/html,application/xhtml+xml",
"colorDepth": "32",
"screenHeight": "1080",
"screenWidth": "1920",
"jetLag": "-480",
"userAgent": "Mozilla/5.0",
"javaEnabled": false,
"javaScriptEnabled": true
},
"device": {
"orderTerminal": "02"
}
}
}Responses Body Parameters
application/json公共返回参数
bizContent
durationObject可选trialObject可选autoRecoveryObject可选threeDUnionParamsObject可选paymentMethodObject可选cardInfoObject可选authenticationInfoObject可选actionObject可选issuerInfoObject可选merchantSubscriptionIdString(64)必填商户定义的订阅计划的唯一ID。requestIdString(64)必填商户请求唯一编号。subscriptionIdString(64)必填PingPong 订阅单号。statusString(32)必填订阅计划状态。有效值包括:PENDING订阅已创建,但尚未进入正式生效阶段。IN_TRIAL订阅处于试用期内,当前服务可用,但尚未完成首次正式收费。ACTIVE订阅当前正常生效中,用户有权使用服务。PAST_DUE订阅已到应扣款时间,但本次扣款失败,进入欠费/补扣阶段。CANCELLED订阅已终止,不再继续自动续费。
startAtString(10)可选订阅开始时间,10 位秒级时间戳字符串。endAtString(10)可选订阅结束时间,10 位秒级时间戳字符串。notifyUrlString(255)可选订阅通知地址。threeDContinueString(32)可选是否需要继续 3DS 流程。
响应报文示例
{
"clientId": "2025050971820281024",
"accId": "2025050971820281024001",
"signType": "MD5",
"sign": "SIGN_VALUE",
"version": "1.0",
"bizContent": {
"merchantSubscriptionId": "SUB_MER_001",
"requestId": "REQ_SUB_CREATE_001",
"subscriptionId": "SUB-1234567890abcdef",
"status": "PENDING",
"startAt": "1785152760",
"endAt": "1816688760",
"notifyUrl": "https://merchant.example.com/subscription/notify",
"duration": {
"periodCount": 1,
"periodUnit": "MONTH"
},
"trial": {
"startAt": "1785152760",
"endAt": "1785757560",
"periodDays": 7,
"amount": "0.00",
"currency": "USD"
},
"autoRecovery": {
"enabled": true
},
"threeDContinue": "Y",
"threeDUnionParams": {
"threeDSMethodData": "THREEDS_METHOD_DATA",
"creq": "CREQ_VALUE"
},
"paymentMethod": {
"type": "CARD",
"cardInfo": {
"firstSixDigits": "411111",
"lastFourDigits": "1111",
"issuringBank": "CHASE",
"isoCountry": "US",
"paymentBrand": "VISA",
"cardType": "CREDIT",
"cardLevel": "PLATINUM",
"lastName": "Lebron",
"firstName": "James",
"ipCountry": "US",
"isoCountryA2": "US"
}
},
"cardInfo": {
"firstSixDigits": "411111",
"lastFourDigits": "1111",
"issuringBank": "CHASE",
"isoCountry": "US",
"paymentBrand": "VISA",
"cardType": "CREDIT",
"cardLevel": "PLATINUM",
"lastName": "Lebron",
"firstName": "James",
"ipCountry": "US",
"isoCountryA2": "US"
},
"authenticationInfo": {
"threeDSecure": "Y",
"cvvResult": "Y",
"avsResult": "U"
},
"action": {
"type": "PAYMENT_REDIRECT_URL",
"qrCode": "QR_CODE_CONTENT",
"qrUrl": "https://merchant.example.com/qr.png",
"paymentRedirectUrl": "https://merchant.example.com/payment/redirect",
"jsSdkUrl": "https://pay-cdn.pingpongx.com/sdk.js"
},
"issuerInfo": {
"issuerResultCode": "00",
"issuerResultMsg": "APPROVED"
}
},
"code": "000000",
"description": "SUCCESS"
}