openapi: 3.0.3
info:
title: Paypal Webhooks Management
description: The PayPal REST APIs use webhooks for event notification. Webhooks are HTTP callbacks that receive notification messages for events. After you configure a webhook listener for your app, you can create a webhook, which subscribes the webhook listener for your app to events. The notifications namespace contains resource collections for webhooks.
version: '1.11'
contact: {}
servers:
- url: https://api-m.sandbox.paypal.com
description: PayPal Sandbox Environment
- url: https://api-m.paypal.com
description: PayPal Live Environment
tags:
- name: Simulate-Event
description: Use the `/simulate-event` resource to use a sample payload to simulate a webhook event. The events that this call generates only serve to validate the connection to the listener URL and to show how webhook events look.
Note: You can also use the Webhooks simulator to simulate webhook events.- name: Verify-Webhook-Signature description: Use the `/verify-webhook-signature` resource to verify a webhook signature. - name: Webhooks description: Use the `/webhooks` resource to subscribe your webhook listener to events, list webhooks for an app, show details for, update, delete, and list event subscriptions for webhooks. - name: Webhooks-Event-Types description: Use the `/webhooks-event-types` resource to list available events to which any webhook can subscribe. - name: Webhooks-Events description: Use the `/webhooks-events` resource to list, show details for, and resend event notifications. - name: Webhooks-Lookup description: Use the `/webhooks-lookup` resource to create, list, show details for, and delete webhook lookups. externalDocs: url: https://developer.paypal.com/docs/api/webhooks/v1/ paths: "/v1/notifications/webhooks": post: summary: Paypal Create webhook description: Subscribes your webhook listener to events. operationId: webhooks.post responses: '201': description: A successful request returns the HTTP `201 Created` status code and a JSON response body with a [`webhook`](/docs/api/webhooks/v1/#definition-webhook) object that includes the webhook ID for later use. content: application/json: schema: "$ref": "#/components/schemas/webhook" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" requestBody: content: application/json: schema: "$ref": "#/components/schemas/webhook" examples: webhook: value: url: https://example.com/example_webhook event_types: - name: PAYMENT.AUTHORIZATION.CREATED - name: PAYMENT.AUTHORIZATION.VOIDED security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks get: summary: Paypal List webhooks description: Lists webhooks for an app. operationId: webhooks.list responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists webhooks with webhook details. content: application/json: schema: "$ref": "#/components/schemas/WebhookList" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/anchor_type" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks "/v1/notifications/webhooks/{webhook_id}": get: summary: Paypal Show webhook details description: Shows details for a webhook, by ID. operationId: webhooks.get responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows webhook details. content: application/json: schema: "$ref": "#/components/schemas/webhook" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks patch: summary: Paypal Update webhook description: Updates a webhook to replace webhook fields with new values. Supports only the `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. operationId: webhooks.update responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows webhook details. content: application/json: schema: "$ref": "#/components/schemas/webhook" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_id" requestBody: content: application/json: schema: "$ref": "#/components/schemas/patch_request" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks delete: summary: Paypal Delete webhook description: Deletes a webhook, by ID. operationId: webhooks.delete responses: '204': description: A successful request returns the HTTP `204 No Content` status code with no JSON response body. default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks "/v1/notifications/webhooks/{webhook_id}/event-types": get: summary: Paypal List event subscriptions for webhook description: Lists event subscriptions for a webhook, by ID. operationId: event-types.list responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists event subscriptions for a webhook. content: application/json: schema: "$ref": "#/components/schemas/EventTypeList" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks "/v1/notifications/webhooks-lookup": post: summary: Paypal Create webhook lookup description: Creates a webhook lookup. operationId: webhooks-lookup.post responses: '201': description: A successful request returns the HTTP `201 Created` status code and a JSON response body that shows webhook lookup details. content: application/json: schema: "$ref": "#/components/schemas/webhooks_lookup" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Lookup get: summary: Paypal List webhook lookups description: Lists webhook lookups. operationId: webhooks-lookup.list responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists webhook lookups with webhook lookup details. content: application/json: schema: "$ref": "#/components/schemas/WebhookLookupList" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Lookup "/v1/notifications/webhooks-lookup/{webhook_lookup_id}": get: summary: Paypal Show webhook lookup details description: Shows details for a webhook lookup, by ID. operationId: webhooks-lookup.get responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows webhook lookup details. content: application/json: schema: "$ref": "#/components/schemas/webhooks_lookup" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_lookup_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Lookup delete: summary: Paypal Delete webhook lookup description: Deletes a webhook lookup, by ID. operationId: webhooks-lookup.delete responses: '204': description: A successful request returns the HTTP `204 No Content` status code with no JSON response body. default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/webhook_lookup_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Lookup "/v1/notifications/verify-webhook-signature": post: summary: Paypal Verify webhook signature description: Verifies a webhook signature. operationId: verify-webhook-signature.post responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows the verification status. content: application/json: schema: "$ref": "#/components/schemas/verify_webhook_signature_response" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" requestBody: content: application/json: schema: "$ref": "#/components/schemas/verify_webhook_signature" examples: verify_webhook_signature: value: transmission_id: 69cd13f0-d67a-11e5-baa3-778b53f4ae55 transmission_time: '2016-02-18T20:01:35Z' cert_url: cert_url auth_algo: SHA256withRSA transmission_sig: lmI95Jx3Y9nhR5SJWlHVIWpg4AgFk7n9bCHSRxbrd8A9zrhdu2rMyFrmz+Zjh3s3boXB07VXCXUZy/UFzUlnGJn0wDugt7FlSvdKeIJenLRemUxYCPVoEZzg9VFNqOa48gMkvF+XTpxBeUx/kWy6B5cp7GkT2+pOowfRK7OaynuxUoKW3JcMWw272VKjLTtTAShncla7tGF+55rxyt2KNZIIqxNMJ48RDZheGU5w1npu9dZHnPgTXB9iomeVRoD8O/jhRpnKsGrDschyNdkeh81BJJMH4Ctc6lnCCquoP/GzCzz33MMsNdid7vL/NIWaCsekQpW26FpWPi/tfj8nLA== webhook_id: 1JE4291016473214C webhook_event: id: 8PT597110X687430LKGECATA create_time: '2013-06-25T21:41:28Z' resource_type: authorization event_type: PAYMENT.AUTHORIZATION.CREATED summary: A payment authorization was created resource: id: 2DC87612EK520411B create_time: '2013-06-25T21:39:15Z' update_time: '2013-06-25T21:39:17Z' state: authorized amount: total: '7.47' currency: USD details: subtotal: '7.47' parent_payment: PAY-36246664YD343335CKHFA4AY valid_until: '2013-07-24T21:39:15Z' links: - href: https://api-m.paypal.com/v1/payments/authorization/2DC87612EK520411B rel: self method: GET - href: https://api-m.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture rel: capture method: POST - href: https://api-m.paypal.com/v1/payments/authorization/2DC87612EK520411B/void rel: void method: POST - href: https://api-m.paypal.com/v1/payments/payment/PAY-36246664YD343335CKHFA4AY rel: parent_payment method: GET security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks - https://uri.paypal.com/services/applications/verify-webhook-signature tags: - Verify-Webhook-Signature "/v1/notifications/webhooks-event-types": get: summary: Paypal List available events description: Lists available events to which any webhook can subscribe. For a list of supported events, see [Webhook event names](/docs/api/notifications/webhooks/event-names/). operationId: webhooks-event-types.list responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists available events to which any webhook can subscribe. content: application/json: schema: "$ref": "#/components/schemas/EventTypeList" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" tags: - Webhooks-Event-Types "/v1/notifications/webhooks-events": get: summary: Paypal List event notifications description: Lists webhooks event notifications. Use query parameters to filter the response. operationId: webhooks-events.list responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists webhooks event notifications. content: application/json: schema: "$ref": "#/components/schemas/EventList" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/page_size" - "$ref": "#/components/parameters/start_time" - "$ref": "#/components/parameters/end_time" - "$ref": "#/components/parameters/transaction_id" - "$ref": "#/components/parameters/event_type" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Events "/v1/notifications/webhooks-events/{event_id}": get: summary: Paypal Show event notification details description: Shows details for a webhooks event notification, by ID. operationId: webhooks-events.get responses: '200': description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows webhooks event notification details. content: application/json: schema: "$ref": "#/components/schemas/event" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/event_id" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Events "/v1/notifications/webhooks-events/{event_id}/resend": post: summary: Paypal Resend event notification description: Resends a webhook event notification, by ID. Any pending notifications are not resent. operationId: webhooks-events.resend responses: '202': description: A successful request returns the HTTP `202 Accepted` status code and a JSON response body that shows webhook event notification details. content: application/json: schema: "$ref": "#/components/schemas/event" default: description: The error response. content: application/json: schema: "$ref": "#/components/schemas/error" parameters: - "$ref": "#/components/parameters/event_id" requestBody: content: application/json: schema: "$ref": "#/components/schemas/event_resend" security: - Oauth2: - https://uri.paypal.com/services/applications/webhooks tags: - Webhooks-Events "/v1/notifications/simulate-event": post: summary: Paypal Simulate webhook event description: Simulates a webhook event. In the JSON request body, specify a sample payload.
| Event | Trigger |
|---|---|
PAYMENT.CAPTURE.COMPLETED | A payment capture completes. |
PAYMENT.CAPTURE.DENIED | A payment capture is denied. |
CHECKOUT.PAYMENT-APPROVAL.REVERSED | PayPal reverses a payment capture. |
Note: To subscribe to all events, including events as they are added, specify an `*` as the value to represent a wildcard.readOnly: false description: type: string description: A human-readable description of the event. readOnly: true status: type: string description: The status of a webhook event. readOnly: true resource_versions: type: array description: 'Identifier for the event type example: 1.0/2.0 etc.' readOnly: true items: type: string description: The ID for an event type. For example, `1.0` or `2.0`. required: - name webhook: type: object title: Webhook description: One or more webhook objects. properties: id: type: string description: The ID of the webhook. readOnly: true url: type: string format: uri description: The URL that is configured to listen on `localhost` for incoming `POST` notification messages that contain event information. readOnly: false maxLength: 2048 event_types: type: array maxItems: 500 description: An array of events to which to subscribe your webhook. To subscribe to all events, including events as they are added, specify the asterisk wild card. To replace the `event_types` array, specify the asterisk wild card. To list all supported events, list available events. readOnly: false items: "$ref": "#/components/schemas/event_type" links: type: array description: An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links/). readOnly: true items: "$ref": "#/components/schemas/link_description" readOnly: true required: - url - event_types patch: type: object title: Patch description: The JSON patch object to apply partial updates to resources. properties: op: type: string description: The operation. enum: - add - remove - replace - move - copy - test path: type: string description: The JSON Pointer to the target document location at which to complete the operation. value: title: Patch Value description: The value to apply. The
remove operation does not require a value.
from:
type: string
description: The JSON Pointer to the target document location from which to move the value. Required for the move operation.
required:
- op
patch_request:
type: array
title: Patch Request
description: An array of JSON patch objects to apply partial updates to resources.
items:
"$ref": "#/components/schemas/patch"
webhooks_lookup:
type: object
title: Webhook Lookup
description: The webhook lookup details.
properties:
id:
type: string
description: The ID of the webhook lookup.
readOnly: true
client_id:
type: string
pattern: "^(?!\\d+$)\\w+\\S+"
maxLength: 128
description: The application client ID.
readOnly: true
links:
type: array
description: An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links/).
readOnly: true
items:
"$ref": "#/components/schemas/link_description"
readOnly: true
event_version:
type: string
title: Event Version
description: The event version in the webhook notification.
deprecated: true
pattern: "^([0-9]+.[0-9]+)$"
resource_version:
title: Resource Version
description: The resource version in the webhook notification.
type: string
pattern: "^([0-9]+.[0-9]+)$"
event:
type: object
title: Event
description: A webhook event notification.
properties:
id:
type: string
description: The ID of the webhook event notification.
readOnly: true
create_time:
type: string
format: date-time
description: The date and time when the webhook event notification was created, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
readOnly: true
resource_type:
type: string
description: The name of the resource related to the webhook notification event.
readOnly: true
event_version:
"$ref": "#/components/schemas/event_version"
event_type:
type: string
description: The event that triggered the webhook event notification.
readOnly: true
summary:
type: string
description: A summary description for the event notification.
readOnly: true
resource_version:
"$ref": "#/components/schemas/resource_version"
resource:
type: object
title: Resource
description: The resource that triggered the webhook event notification.
readOnly: true
additionalProperties: true
links:
type: array
description: An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
readOnly: true
items:
"$ref": "#/components/schemas/link_description"
readOnly: true
verify_webhook_signature:
type: object
title: Verify Webhook Signature
description: A verify webhook signature request.
properties:
auth_algo:
type: string
maxLength: 100
pattern: "^[a-zA-Z0-9]+$"
description: The algorithm that PayPal uses to generate the signature and that you can use to verify the signature. Extract this value from the `PAYPAL-AUTH-ALGO` response header, which is received with the webhook notification.
cert_url:
type: string
maxLength: 500
format: uri
description: The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification.
transmission_id:
type: string
maxLength: 50
pattern: "^(?!\\d+$)\\w+\\S+"
description: The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message.
transmission_sig:
type: string
maxLength: 500
pattern: "^(?!\\d+$)\\w+\\S+"
description: The PayPal-generated asymmetric signature. Appears in the `PAYPAL-TRANSMISSION-SIG` header of the notification message.
transmission_time:
type: string
maxLength: 100
format: date-time
description: The date and time of the HTTP transmission, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Appears in the `PAYPAL-TRANSMISSION-TIME` header of the notification message.
webhook_id:
type: string
maxLength: 50
pattern: "^[a-zA-Z0-9]+$"
description: The ID of the webhook as configured in your Developer Portal account.
webhook_event:
"$ref": "#/components/schemas/event"
required:
- auth_algo
- cert_url
- transmission_id
- transmission_sig
- transmission_time
- webhook_id
- webhook_event
verify_webhook_signature_response:
type: object
title: Verify Webhook Signature Response
description: The verify webhook signature response.
properties:
verification_status:
type: string
description: The status of the signature verification.
enum:
- SUCCESS
- FAILURE
required:
- verification_status
event_resend:
type: object
title: Event Resend
description: Resends a webhook event notification, by ID.
properties:
webhook_ids:
type: array
maxItems: 500
description: An array of webhook account IDs.
items:
type: string
description: The ID of the webhook event notification to resend.
simulate_event:
type: object
title: Simulate Event
description: Simulates a mock webhook event.
properties:
webhook_id:
type: string
description: The ID of the webhook. If omitted, the URL is required.
readOnly: false
pattern: "^[a-zA-Z0-9]+$"
maxLength: 50
url:
type: string
format: uri
description: The URL for the webhook endpoint. If omitted, the webhook ID is required.
readOnly: false
maxLength: 2048
event_type:
type: string
description: The event name. Specify one of the subscribed events. For each request, provide only one event.
readOnly: false
maxLength: 50
pattern: "^[a-zA-Z0-9.]+$"
resource_version:
type: string
description: 'The identifier for event type ex: 1.0/2.0 etc.'
readOnly: false
required:
- event_type
parameters:
anchor_type:
name: anchor_type
in: query
description: Filters the webhooks in the response by an `anchor_id` entity type.
schema:
type: string
enum:
- APPLICATION
- ACCOUNT
default: APPLICATION
webhook_id:
name: webhook_id
in: path
description: The ID of the webhook for which to list subscriptions.
required: true
schema:
type: string
webhook_lookup_id:
name: webhook_lookup_id
in: path
description: The ID of the webhook lookup to delete.
required: true
schema:
type: string
page_size:
name: page_size
in: query
description: The number of webhook event notifications to return in the response.
schema:
type: integer
default: 10
start_time:
name: start_time
in: query
description: 'Filters the webhook event notifications in the response to those created on or after this date and time and on or before the `end_time` value. Both values are in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6) format. Example: `start_time=2013-03-06T11:00:00Z`.'
schema:
type: string
end_time:
name: end_time
in: query
description: 'Filters the webhook event notifications in the response to those created on or after the `start_time` and on or before this date and time. Both values are in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6) format. Example: `end_time=2013-03-06T11:00:00Z`.'
schema:
type: string
transaction_id:
name: transaction_id
in: query
description: Filters the response to a single transaction, by ID.
schema:
type: string
event_type:
name: event_type
in: query
description: Filters the response to a single event.
schema:
type: string
event_id:
name: event_id
in: path
description: The ID of the webhook event notification to resend.
required: true
schema:
type: string
maxLength: 50
pattern: "^[a-zA-Z0-9]+$"