Create_payment_attempt
bearer_authAuthorizationBearer <token>Creates a payment attempt. Optional flow: "hosted" (default) returns the provider's hosted checkout URL; "payment_intent" (stripe + one-time purchases only) returns a raw PaymentIntent clientSecret for mobile wallet SDK confirmation (Apple Pay / Google Pay).
application/json- body
flow?|Checkout flow: "hosted" (default) redirects to the provider's hosted
checkout page; "payment_intent" returns a raw Stripe PaymentIntent
clientSecret for mobile wallet SDK confirmation (Apple Pay / Google
Pay). payment_intent is only valid for stripe + one-time purchases.
locale?|App locale tag (e.g. en, zh-CN) used to localize the provider's
hosted checkout page. Unrecognized values are dropped by the provider
clients (fail-open to the provider default language).
metadata?unknownopenid?|WeChat JSAPI payer openid; required when paymentScene = "jsapi".
paymentProvider*stringpaymentScene?|WeChat-only checkout scene: "native" (default) or "jsapi". Ignored
by other providers (DEC-wechat-support-009).
targetId*stringuuidtargetType*stringPayment attempt created successfully
application/json- response
amount*integerint64createdAt*stringcurrency*stringexpiresAt*stringid*stringuuidpaymentContext*paymentProvider*stringrealmId*stringstatus*stringtargetId*stringuuidtargetType*stringuserId*stringuuidcurl -X POST 'https://example.com/api/bill/purchase/payment-attempts' \
-H 'Content-Type: application/json' \
-d '{
"paymentProvider": "string",
"targetId": "cbca1126-180e-4334-9df8-cf82289d378b",
"targetType": "string"
}'{
"amount": 0,
"createdAt": "string",
"currency": "string",
"expiresAt": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"paymentContext": {
"clientSecret": "string",
"creemCheckoutUrl": "string",
"stripeCheckoutUrl": "string",
"wechatCodeUrl": "string",
"wechatJsapiParams": null
},
"paymentProvider": "string",
"realmId": "string",
"status": "string",
"targetId": "cbca1126-180e-4334-9df8-cf82289d378b",
"targetType": "string",
"userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b"
}