- API Introduction
- Error Code
- Payment Intents
- Charges
- Payment Methods
- Refunds
- Webhooks
- Events
- Files
- Disputes
- Payouts
- Balance
- Products
- Prices
- Payment Links
- Checkout
- Customers
- Setup Intents
- Invoices
- Invoice Items
- Invoice Line Item
- Subscriptions
- Subscription Items
- Issuing
- Coupons
- Promotion Code
- Accounts
Create a PaymentIntent
POST
/v1/payment_intents
When confirm=true is used during creation, it is equivalent to creating and confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when confirm=true is supplied.
Request
Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string {{Username}}:{{Password}}Example:
Authorization: Basic YWRtaW46MTIzNDU2
Header Params
Accept
string
required
Default:
application/json
Content-Type
string
required
Default:
application/json
Body Params application/json
confirm
boolean
optional
payment_method_data
object (Payment Method Data)
optional
type
enum<string>
required
Allowed values:
cardalipayplusalipaywechat_paysepa_debitalipay_hkboosttruemoneygcashkakaopaytouchngorabbit_line_paydanaklarnaidealgiropaysofortepstrustlybancontactp24unionpayfpxmcashgrabpaybank_transfer_idqrispromptpayovoshopeepayupiboletopaynowpix9paystitchbpi
billing_details
object (Billing Details)
optional
card
object
optional
sepa_debit
object
optional
wechat_pay
object
optional
alipayplus
object
optional
amount
integer
required
currency
string
required
description
string
optional
quantity
integer
optional
metadata
object
optional
key1
string
optional
merchant_user_id
string
optional
merchant_order_id
string
optional
shipping
object
optional
address
object
optional
name
string
required
phone
string
optional
return_url
string
optional
off-session
boolean
optional
customer
string
optional
payment_method_types
array[string]
optional
Allowed values:
alipayalipay_hkboostcardtruemoneygcashkakaopaytouchngorabbit_line_paydanaklarnaidealgiropaysofortepstrustlybancontactp24unionpayfpxmcashgrabpaybank_transfer_idqrispromptpayovoshopeepayupiboletopaynowpix9paystitchbpi
payment_method_options
object (Payment Method Options)
optional
card
object
optional
alipayplus
object
optional
alipay_hk
object
optional
alipay
object
optional
wechat_pay
object
optional
sepa_debit
object
optional
akulaku
object
optional
truemoney
object
optional
kakaopay
object
optional
shopeepay
object
optional
dana
object
optional
pix
object
optional
payment_method
string
optional
canceled_at
integer
optional
confirmation_method
string
optional
automatic (Default)
PaymentIntent can be confirmed using a publishable key. After next_action s are handled, no additional confirmation is required to complete the payment.
manual
All payment attempts must be made using a secret key. The PaymentIntent returns to the requires_confirmation state after handling next_actions, and requires your server to initiate each payment attempt with an explicit confirmation.
capture_method
string
optional
setup_future_usage
enum<string>
optional
Allowed values:
off_sessionon_session
Example
{
"amount": 10,
"currency": "USD",
"confirm": true,
"payment_method_data": {
"type": "card",
"card": {
"exp_month": "12",
"exp_year": "2026",
"number": "4111111111111111",
"cvc": "123"
},
"billing_details": {
"address": {
"line1": "XX mansion",
"line2": "XX Town",
"city": "city",
"state": "California",
"country": "US",
"postal_code": "55555"
},
"name": "Tom"
}
},
"description": "product description",
"quantity": 2,
"metadata": {
"key1": "value1"
},
"merchant_user_id": "123456",
"merchant_order_id": "Order112344343",
"shipping": {
"address": {
"line1": "XX mansion",
"line2": "XX Town",
"city": "city",
"state": "California",
"country": "US",
"postal_code": "xxx xxx"
},
"name": "tom",
"phone": "xxxx"
},
"return_url": "https://your.website"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://apitest.wooshpay.com/v1/payment_intents?members&reference&Type&_postman_listIndexKey=key&_postman_listAllowsMultipleValues' \
--data-raw '{
"amount":10,
"currency":"USD",
"confirm":true,
"payment_method_data" : {
"type":"card",
"card":{
"exp_month":"12",
"exp_year":"2026",
"number":"4111111111111111",
"cvc":"123"
},
"billing_details":{
"address": {
"line1": "XX mansion",
"line2": "XX Town",
"city": "city",
"state": "California",
"country": "US",
"postal_code": "55555"
},
"name": "Tom"
}
},
"description": "product description",
"quantity": 2,
"metadata" : {
"key1": "value1"
},
"merchant_user_id": "123456",
"merchant_order_id": "Order112344343",
"shipping": {
"address":{
"line1": "XX mansion",
"line2": "XX Town",
"city": "city",
"state": "California",
"country": "US",
"postal_code": "xxx xxx"
},
"name": "tom",
"phone": "xxxx"
},
"return_url":"https://your.website"
}'
Responses
🟢200OK
application/json
Body
id
string
optional
object
string
optional
created
integer
optional
currency
string
required
customer
string
optional
amount
integer
required
status
string
optional
description
string
optional
metadata
object
optional
livemode
boolean
optional
shipping
object (Shipping)
optional
address
object (Address)
optional
carrier
string
optional
name
string
optional
phone
string
optional
tracking_number
string
optional
merchant_order_id
string
optional
client_secret
string
optional
last_payment_error
object
optional
code
string
optional
message
string
optional
payment_method
object
optional
type
string
optional
decline_code
string
optional
next_action
object (Next Action)
optional
type
string
optional
redirect_to_url
object
optional
ddc_redirect
object
optional
challenge_redirect
object
optional
alipayplus_handle_redirect
object
optional
alipay_handle_redirect
object
optional
wechat_pay_display_qr_code
object
optional
wechat_pay_redirect_to_android_app
object
optional
wechat_pay_redirect_to_ios_app
object
optional
wechat_pay_redirect_to_web
object
optional
wechat_pay_official_account_params
object
optional
truemoney_handle_redirect
object
optional
akulaku_handle_redirect
object
optional
bank_transfer_id_handle_redirect
object
optional
promptpay_handle_redirect
object
optional
dana_handle_redirect
object
optional
shopeepay_handle_redirect
object
optional
gcash_handle_redirect
object
optional
rabbit_line_pay_handle_redirect
object
optional
alipay_hk_handle_redirect
object
optional
bpi_handle_redirect
object
optional
payment_method_types
array[string]
optional
Allowed values:
alipayalipay_hkboostcardtruemoneygcashkakaopaytouchngorabbit_line_paydanaklarnaidealgiropaysofortepstrustlybancontactp24unionpayfpxmcashgrabpaybank_transfer_idqrispromptpayovoshopeepayupiboletopaynowpix9paystitchbpi
payment_method_options
object (Payment Method Options)
optional
card
object
optional
alipayplus
object
optional
alipay_hk
object
optional
alipay
object
optional
wechat_pay
object
optional
sepa_debit
object
optional
akulaku
object
optional
truemoney
object
optional
kakaopay
object
optional
shopeepay
object
optional
dana
object
optional
pix
object
optional
payment_method
string
optional
receipt_email
string
optional
canceled_at
integer
optional
cancellation_reason
string
optional
confirmation_method
string
optional
automatic (Default)
PaymentIntent can be confirmed using a publishable key. After next_action s are handled, no additional confirmation is required to complete the payment.
manual
All payment attempts must be made using a secret key. The PaymentIntent returns to the requires_confirmation state after handling next_actions, and requires your server to initiate each payment attempt with an explicit confirmation.
3ds_status
object
optional
cavv
string
optional
eci
integer
optional
status
string
optional
Possible values are:
COMPLETED – The transaction has been completed.
PENDING – The transaction has not been completed yet.
FAILED – The authentication request failed.
three_d_result
string
optional
Y – The cardholder successfully authenticated with their card issuer.
A – The cardholder authentication was attempted.
N – The cardholder failed to successfully authenticate with their card issuer.
U – Authentication with the card issuer was unavailable.
C – Challenge Required; additional authentication is required.
R – Rejected transaction.
three_d_enrollment
string
optional
Y – Cardholder authentication is available
N – Cardholder is not enrolled in authentication
U – Cardholder authentication unavailable
three_d_secure_version
string
optional
xid
string
optional
three_d_secure_server_transaction_id
string
optional
amount_capturable
integer
optional
return_url
string
required
quantity
integer
optional
merchant_user_id
string
optional
amount_received
integer
optional
capture_method
string
optional
invoice
string
optional
Example
{
"id": "pi_1604012360740110336",
"object": "payment_intent",
"created": 1671261323000,
"currency": "USD",
"amount": 10,
"status": "succeeded",
"description": "product description",
"metadata": {
"key1": "value1"
},
"livemode": false,
"shipping": {
"address": {
"city": "city",
"country": "US",
"line1": "XX mansion",
"line2": "XX Town",
"state": "California",
"postal_code": "xxx xxx"
},
"carrier": null,
"name": "tom",
"phone": "xxxx",
"tracking_number": null
},
"customer": null,
"quantity": 2,
"invoice": null,
"merchant_user_id": "123456",
"merchant_order_id": "Order112344343",
"client_secret": "pi_1604012360740110336_secret_YYFHuk8Lago3RSqjbVFe68AA",
"last_payment_error": null,
"next_action": null,
"payment_method_types": "[\"wechat_pay\",\"alipay\",\"card\"]",
"receipt_email": null,
"canceled_at": null,
"cancellation_reason": null,
"confirmation_method": "automatic",
"payment_method_options": "{\"card\":{\"request_three_d_secure\":\"auto\",\"capture_method\":\"automatic\"}}",
"3ds_status": null,
"amount_capturable": null,
"return_url": "https://your.website",
"payment_method": "pm_1604012357044928512",
"amount_received": null,
"capture_method": "automatic"
}
Modified at 2024-07-04 02:42:06