Paypal API
  1. Invoices
Paypal API
  • Authorization
    • Generate access_token
      POST
    • Terminate access_token
      POST
    • User Info
      GET
    • Generate client_token
      POST
  • Orders
    • Create order
      POST
    • Show order details
      GET
    • Update order
      PATCH
    • Authorize payment for order
      POST
    • Capture payment for order
      POST
  • Payments
    • Show details for authorized payment
      GET
    • Reauthorize authorized payment
      POST
    • Void authorized payment
      POST
    • Capture authorized payment
      POST
    • Show captured payment details
      GET
    • Refund captured payment
      POST
    • Show refund details
      GET
  • Invoices
    • Invoices
      • Generate invoice number
        POST
      • Create draft invoice
        POST
      • Show invoice details
        GET
      • List invoices
        GET
      • Generate QR code
        POST
      • Fully update invoice
        PUT
      • Send invoice
        POST
      • Send invoice reminder
        POST
      • Cancel sent invoice
        POST
      • Delete invoice
        DELETE
      • Search for invoices
        POST
      • Record payment for invoice
        POST
      • Delete external payment
        DELETE
      • Record refund for invoice
        POST
      • Delete external refund
        DELETE
    • Templates
      • List templates
      • Create template
      • Show template details
      • Fully update template
      • Delete template
  • Subscriptions
    • Catalog Products
      • Create product
      • List products
      • Show product details
      • Update product
    • Plans
      • Create plan
      • List plans
      • Show plan details
      • Update plan
      • Deactivate plan
      • Activate plan
      • Update pricing
    • Subscriptions
      • Create subscription
      • Show subscription details
      • Update subscription
      • Revise plan or quantity of subscription
      • Suspend subscription
      • Activate subscription
      • Cancel subscription
      • Capture authorized payment on subscription
      • List transactions for subscription
  • Payouts
    • Create batch payout
    • Show payout batch details
    • Show payout item details
    • Cancel unclaimed payout item
  • Webhooks
    • List available events
    • Create webhook
    • List webhooks
    • Show webhook details
    • List event notifications
    • List event subscriptions for webhook
    • Show event notification details
    • Trigger a sample event
    • Verify webhook signature
    • Resend event notification
    • Simulate webhook event
    • Update webhook
    • Delete webhook
  • Shipment Tracking
    • Add tracking information for multiple PayPal transactions
    • Show tracking information
    • Update or cancel tracking information for PayPal transaction
  • Transaction Search
    • List transactions
    • List all balances
  • 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)
    • Manage Accounts
      • Create managed account
      • Search managed account through external id
      • Search managed account by Seller Id
      • Partially updates information for a managed account
      • Shows collection of registered wallet domains
  1. Invoices

Generate QR code

POST
/v2/invoicing/invoices/{invoice_id}/generate-qr-code
Generates a QR code for an invoice, by ID. The QR code is a PNG image in Base64-encoded format that corresponds to the invoice ID. You can generate a QR code for an invoice and add it to a paper or PDF invoice. When customers use their mobile devices to scan the QR code, they are redirected to the PayPal mobile payment flow where they can view the invoice and pay online with PayPal or a credit card. Before you get a QR code, you must create an invoice and send an invoice to move the invoice from a draft to payable state. Do not include an email address if you do not want the invoice emailed.

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Basic 之后拼接空格,以及经过 Base64 编码的 username:password
示例:
Authorization: Basic *****************
Path 参数
invoice_id
string 
必需
(Required) The ID of the invoice for which to generate a QR code.
示例值:
{{invoice_id}}
Header 参数
Content-Type
string 
必需
The Content-Type header field is used to specify the nature of the data in the body of an entity. PayPal REST APIs support application/json.
示例值:
application/json
Body 参数application/json
width
integer 
必需
height
integer 
必需
action
string 
必需
示例
{
  "width": 500,
  "height": 500,
  "action": "pay"
}

示例代码

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}}/generate-qr-code' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
    "width": 500,
    "height": 500,
    "action": "pay"
}'

返回响应

🟢200200 - Generate QR Code
text/plain
Body
object {0}
示例
--92f9a85e-0ee4-4dae-a38f-363c5a96c5aa
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/p8PPB6Px+PxeDwe/0H/BxlNAWidO1XiAAAAAElFTkSuQmCC
--92f9a85e-0ee4-4dae-a38f-363c5a96c5aa--
🟠400400 Bad Request - Invalid Action Value
🟠400400 Bad Request - Invalid QR Code Size
🟠401401 Unauthorized - Invalid Token
🟠404404 Not Found - Invoice Not Found
修改于 2023-08-16 07:18:59
上一页
List invoices
下一页
Fully update invoice
Built with