PayPal Simulate-Event API

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.

OpenAPI Specification

paypal-simulate-event-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Paypal Subscriptions Authorizations Simulate-Event API
  description: You can use billing plans and subscriptions to create subscriptions that process recurring PayPal payments for physical or digital goods, or services. A plan includes pricing and billing cycle information that defines the amount and frequency of charge for a subscription. You can also define a fixed plan, such as a $5 basic plan or a volume- or graduated-based plan with pricing tiers based on the quantity purchased. For more information, see <a href="/docs/subscriptions/">Subscriptions Overview</a>.
  version: '1.6'
  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. <blockquote><strong>Note:</strong> You can also use the <a href="/docs/api/notifications/webhooks/simulator/">Webhooks simulator</a> to simulate webhook events.</blockquote>
paths:
  /v1/notifications/simulate-event:
    post:
      summary: Paypal Simulate webhook event
      description: Simulates a webhook event. In the JSON request body, specify a sample payload.<br>You need to subscribe to the following webhook events for Pay upon Invoice:<br><table><thead><tr><th>Event</th><th>Trigger</th></tr></thead><tbody><tr><td><code>PAYMENT.CAPTURE.COMPLETED</code></td><td>A payment capture completes.</td></tr><tr><td><code>PAYMENT.CAPTURE.DENIED</code></td><td>A payment capture is denied.</td></tr><tr><td><code>CHECKOUT.PAYMENT-APPROVAL.REVERSED</code></td><td>PayPal reverses a payment capture.</td></tr></tbody></table>
      operationId: simulate-event.post
      responses:
        '202':
          description: A successful request returns the HTTP `202 Accepted` status code and a JSON response body that shows details for the mock event.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/event'
        default:
          description: The error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/simulate_event'
            examples:
              simulate_event:
                value:
                  url: https://example.com/example_webhook
                  event_type: PAYMENT.AUTHORIZATION.CREATED
                  resource_version: '1.0'
      security:
      - Oauth2:
        - https://uri.paypal.com/services/applications/webhooks
      tags:
      - Simulate-Event
components:
  schemas:
    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
    event_version:
      type: string
      title: Event Version
      description: The event version in the webhook notification.
      deprecated: true
      pattern: ^([0-9]+.[0-9]+)$
    error:
      type: object
      title: Error
      description: The error details.
      properties:
        name:
          type: string
          description: The human-readable, unique name of the error.
        message:
          type: string
          description: The message that describes the error.
        debug_id:
          type: string
          description: The PayPal internal ID. Used for correlation purposes.
        information_link:
          type: string
          description: The information link, or URI, that shows detailed information about this error for the developer.
          readOnly: true
        details:
          type: array
          description: An array of additional details about the error.
          items:
            $ref: '#/components/schemas/error_details-2'
        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:
      - name
      - message
      - debug_id
    link_description:
      type: object
      title: Link Description
      description: The request-related [HATEOAS link](/docs/api/reference/api-responses/#hateoas-links) information.
      required:
      - href
      - rel
      properties:
        href:
          type: string
          description: The complete target URL. To make the related call, combine the method with this [URI Template-formatted](https://tools.ietf.org/html/rfc6570) link. For pre-processing, include the `$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.
        rel:
          type: string
          description: The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml).
        method:
          type: string
          description: The HTTP method required to make the related call.
          enum:
          - GET
          - POST
          - PUT
          - DELETE
          - HEAD
          - CONNECT
          - OPTIONS
          - PATCH
    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
    resource_version:
      title: Resource Version
      description: The resource version in the webhook notification.
      type: string
      pattern: ^([0-9]+.[0-9]+)$
    error_details-2:
      title: Error Details
      type: object
      description: The error details. Required for client-side `4XX` errors.
      properties:
        field:
          type: string
          description: The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors.
        value:
          type: string
          description: The value of the field that caused the error.
        location:
          type: string
          description: The location of the field that caused the error. Value is `body`, `path`, or `query`.
          default: body
        issue:
          type: string
          description: The unique, fine-grained application-level error code.
        description:
          type: string
          description: The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value.
      required:
      - issue
  securitySchemes:
    Oauth2:
      type: oauth2
      description: Oauth 2.0 authentication
      flows:
        clientCredentials:
          tokenUrl: /v1/oauth2/token
          scopes:
            https://uri.paypal.com/services/subscriptions: Manage plan & subscription
externalDocs:
  url: https://developer.paypal.com/docs/api/subscriptions/v1/