- Authorization
- Orders
- Payments
- Invoices
- Invoices
- Generate invoice numberPOST
- Create draft invoicePOST
- Show invoice detailsGET
- List invoicesGET
- Generate QR codePOST
- Fully update invoicePUT
- Send invoicePOST
- Send invoice reminderPOST
- Cancel sent invoicePOST
- Delete invoiceDELETE
- Search for invoicesPOST
- Record payment for invoicePOST
- Delete external paymentDELETE
- Record refund for invoicePOST
- Delete external refundDELETE
- Templates
- Subscriptions
- Payouts
- Webhooks
- Shipment Tracking
- Transaction Search
- Disputes
- List disputes
- Show dispute details
- Accept claim
- Appeal dispute
- Settle dispute
- Update dispute status
- Make offer to resolve dispute
- Provide evidence
- Acknowledge returned item
- Provide supporting information for dispute
- Escalate dispute to claim
- Accept offer to resolve dispute
- Send message about dispute to other party
- Deny offer to resolve dispute
- Partially update dispute
- Onboarding (Limited Release)
Record payment for invoice
POST
/v2/invoicing/invoices/{invoice_id}/payments
PAID
. Otherwise, the invoice is marked as PARTIALLY PAID
.请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Basic 之后拼接空格,以及经过 Base64 编码的 username:password
示例:
Authorization: Basic *****************
Path 参数
invoice_id
string
必需
示例值:
{{invoice_id}}
Header 参数
Content-Type
string
必需
示例值:
application/json
PayPal-Request-Id
string
必需
示例值:
{{$guid}}
Body 参数application/json
method
string
必需
payment_date
string
必需
amount
object
必需
currency_code
string
必需
value
string
必需
type
string
必需
transaction_type
string
必需
note
string
必需
shipping_info
object
必需
name
object
必需
address
object
必需
示例
{
"method": "CASH",
"payment_date": "2022-02-07",
"amount": {
"currency_code": "USD",
"value": "10.00"
},
"type": "EXTERNAL",
"transaction_type": "CAPTURE",
"note": "<A note associated with an external cash or check payment.>",
"shipping_info": {
"name": {
"given_name": "Stephanie",
"surname": "Meyers"
},
"address": {
"address_line_1": "1234 Main Street",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "98765",
"country_code": "US"
}
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices/{{invoice_id}}/payments' \
--header 'PayPal-Request-Id: ' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"method": "CASH",
"payment_date": "2022-02-07",
"amount": {
"currency_code": "USD",
"value": "10.00"
},
"type": "EXTERNAL",
"transaction_type": "CAPTURE",
"note": "<A note associated with an external cash or check payment.>",
"shipping_info": {
"name": {
"given_name": "Stephanie",
"surname": "Meyers"
},
"address": {
"address_line_1": "1234 Main Street",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "98765",
"country_code": "US"
}
}
}'
返回响应
🟢200200 - Record CASH Payment
application/json
Body
payment_id
string
必需
示例
{
"payment_id": "EXTR-1GG075177H628991L"
}
🟢200200 - Record PAYPAL Payment
🟠400400 Bad Request - Invalid Amount
🟠400400 Bad Request - Invalid Payment Method
🟠401401 Unauthorized - Invalid Token
🟠404404 Not Found - Invoice Not Found
🟠422422 Unprocessable Entity - Payment Amount Greater Than Amount Due
修改于 2023-08-16 07:18:59