- Authorization
- Orders
- Payments
- Invoices
- Subscriptions
- Payouts
- Webhooks
- List available eventsGET
- Create webhookPOST
- List webhooksGET
- Show webhook detailsGET
- List event notificationsGET
- List event subscriptions for webhookGET
- Show event notification detailsGET
- Trigger a sample eventPOST
- Verify webhook signaturePOST
- Resend event notificationPOST
- Simulate webhook eventPOST
- Update webhookPATCH
- Delete webhookDELETE
- 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)
Update webhook
PATCH
/v1/notifications/webhooks/{webhook_id}
replace
operation. Pass a json_patch
object with replace
operation and path
, which is /url
for a URL or /event_types
for events. The value
is either the URL or a list of events.请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Basic 之后拼接空格,以及经过 Base64 编码的 username:password
示例:
Authorization: Basic *****************
Path 参数
webhook_id
string
必需
示例值:
{{webhook_id}}
Header 参数
Content-Type
string
必需
示例值:
application/json
PayPal-Request-Id
string
必需
示例值:
{{$guid}}
Body 参数application/json
array of:
op
string
可选
path
string
可选
value
array [object {1}]
可选
name
string
必需
示例
[
{
"op": "replace",
"path": "/event_types",
"value": [
{
"name": "CUSTOMER.DISPUTE.CREATED"
},
{
"name": "CATALOG.PRODUCT.CREATED"
},
{
"name": "BILLING.PLAN.PRICING-CHANGE.ACTIVATED"
},
{
"name": "PAYMENT.PAYOUTSBATCH.SUCCESS"
},
{
"name": "BILLING.PLAN.CREATED"
}
]
}
]
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request PATCH 'https://api-m.sandbox.paypal.com/v1/notifications/webhooks/{{webhook_id}}' \
--header 'PayPal-Request-Id: ' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '[
{
"op": "replace",
"path": "/event_types",
"value": [
{
"name": "CUSTOMER.DISPUTE.CREATED"
},
{
"name": "CATALOG.PRODUCT.CREATED"
},
{
"name": "BILLING.PLAN.PRICING-CHANGE.ACTIVATED"
},
{
"name": "PAYMENT.PAYOUTSBATCH.SUCCESS"
},
{
"name": "BILLING.PLAN.CREATED"
}
]
}
]'
返回响应
🟢200200 - Update Webhook Event Types and URL
application/json
Body
id
string
必需
url
string
必需
event_types
array [object {2}]
必需
name
string
可选
description
string
可选
links
array [object {3}]
必需
href
string
必需
rel
string
必需
method
string
必需
示例
{
"id": "58J42045AF4813205",
"url": "https://example.com/example_webhook_2",
"event_types": [
{
"name": "PAYMENT.SALE.REFUNDED",
"description": "A merchant refunds a sale."
}
],
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks/58J42045AF4813205",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks/58J42045AF4813205",
"rel": "update",
"method": "PATCH"
},
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks/58J42045AF4813205",
"rel": "delete",
"method": "DELETE"
}
]
}
🟠401401 Unauthorized - Invalid Token
🟠404404 Not Found - Webhook Not Found
修改于 2023-08-16 07:18:59