YoboPay
  1. Refunds
YoboPay
  • 接入说明
  • Introduction
  • Webhook接入
  • Webhook Introduction
  • Test Card
  • Embedded Checkout
  • Checkout
    • Create Session
      POST
    • Expire Session
      POST
    • Retrieve Session
      GET
  • PaymentIntents
    • Retrieve PaymentIntent
      GET
    • List all paymentIntent
      GET
  • Charges
    • List all charges
      GET
  • Customers
    • Create Customer
      POST
    • Update Customer
      POST
    • Retrieve Customer
      GET
  • Events
    • The Event object
    • Types of Events
    • Data Object
      • PaymentIntent
      • Charge
  • Refunds
    • Create Refund
      POST
    • List all refunds
      GET
  1. Refunds

Create Refund

POST
/v1/refunds

Request

Body Params application/json
paymentIntentId
string 
required
The identifier of the PaymentIntent to refund.
clientReferenceId
string 
自定义退款id
optional
A unique string to reference the Refund
amount
number 
退款金额
required
reason
enum<string> 
退款原因
required
Allowed values:
duplicatefraudulentrequested_by_customerresolved_dispute
Example
{
    "paymentIntentId": "pi_test_20250410113809370040",
    "clientReferenceId": "re_01",
    "amount": 10,
    "reason": "duplicate"
}

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 '/v1/refunds' \
--header 'Content-Type: application/json' \
--data-raw '{
    "paymentIntentId": "pi_test_20250410113809370040",
    "clientReferenceId": "re_01",
    "amount": 10,
    "reason": "duplicate"
}'

Responses

🟢200成功
application/json
Body
code
string 
required
msg
string 
optional
data
object (Refund) 
required
refundId
string 
required
Refund id
paymentIntentId
string 
required
The identifier of the PaymentIntent to refund.
clientReferenceId
string  | null 
自定义id
optional
A unique string to reference the Refund
amount
number 
退款金额
required
currency
string 
币种
required
reason
string 
退款原因
required
refund reason
status
enum<string> 
状态
required
Allowed values:
succeededfailedpending
failureReason
string 
退款失败原因
optional
closeTime
integer 
完结时间
optional
created
integer 
创建时间
required
Example
{
    "code": "success",
    "msg": null,
    "data": {
        "refundId": "re_test_RUqGWymLLrOz",
        "paymentIntentId": "pi_test_20250410113809370040",
        "clientReferenceId": "re_01",
        "amount": 10,
        "currency": "USD",
        "reason": "duplicate",
        "status": "succeeded",
        "failureReason": null,
        "closeTime": 1744361093092,
        "created": 1744285100757
    }
}
Modified at 2025-04-14 03:42:20
Previous
Charge
Next
List all refunds
Built with