@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Webhooks Management
@base https://api-m.sandbox.paypal.com
@version 1.11
@auth OAuth2
@endpoints 16
@toc notifications(16)

@endpoint POST /v1/notifications/webhooks
@required {url: str(uri), event_types: [map{name!: str, description: str, status: str, resource_versions: [str]}]}
@optional {id: str, links: [map{href!: str, rel!: str, method: str}]}
@returns(201) {id: str, url: str(uri), event_types: [map], links: [map]}

@endpoint GET /v1/notifications/webhooks
@optional {anchor_type: str(APPLICATION/ACCOUNT)=APPLICATION}
@returns(200) {webhooks: [map]}

@endpoint GET /v1/notifications/webhooks/{webhook_id}
@required {webhook_id: str}
@returns(200) {id: str, url: str(uri), event_types: [map], links: [map]}

@endpoint PATCH /v1/notifications/webhooks/{webhook_id}
@required {webhook_id: str}
@returns(200) {id: str, url: str(uri), event_types: [map], links: [map]}

@endpoint DELETE /v1/notifications/webhooks/{webhook_id}
@required {webhook_id: str}
@returns(204)

@endpoint GET /v1/notifications/webhooks/{webhook_id}/event-types
@required {webhook_id: str}
@returns(200) {event_types: [map]}

@endpoint POST /v1/notifications/webhooks-lookup
@returns(201) {id: str, client_id: str, links: [map]}

@endpoint GET /v1/notifications/webhooks-lookup
@returns(200) {webhooks_lookups: [map]}

@endpoint GET /v1/notifications/webhooks-lookup/{webhook_lookup_id}
@required {webhook_lookup_id: str}
@returns(200) {id: str, client_id: str, links: [map]}

@endpoint DELETE /v1/notifications/webhooks-lookup/{webhook_lookup_id}
@required {webhook_lookup_id: str}
@returns(204)

@endpoint POST /v1/notifications/verify-webhook-signature
@required {auth_algo: str, cert_url: str(uri), transmission_id: str, transmission_sig: str, transmission_time: str(date-time), webhook_id: str, webhook_event: map{id: str, create_time: str(date-time), resource_type: str, event_version: str, event_type: str, summary: str, resource_version: str, resource: map, links: [map]}}
@returns(200) {verification_status: str}

@endpoint GET /v1/notifications/webhooks-event-types
@returns(200) {event_types: [map]}

@endpoint GET /v1/notifications/webhooks-events
@optional {page_size: int=10, start_time: str, end_time: str, transaction_id: str, event_type: str}
@returns(200) {events: [map], count: int, links: [map]}

@endpoint GET /v1/notifications/webhooks-events/{event_id}
@required {event_id: str}
@returns(200) {id: str, create_time: str(date-time), resource_type: str, event_version: str, event_type: str, summary: str, resource_version: str, resource: map, links: [map]}

@endpoint POST /v1/notifications/webhooks-events/{event_id}/resend
@required {event_id: str}
@optional {webhook_ids: [str]}
@returns(202) {id: str, create_time: str(date-time), resource_type: str, event_version: str, event_type: str, summary: str, resource_version: str, resource: map, links: [map]}

@endpoint POST /v1/notifications/simulate-event
@required {event_type: str}
@optional {webhook_id: str, url: str(uri), resource_version: str}
@returns(202) {id: str, create_time: str(date-time), resource_type: str, event_version: str, event_type: str, summary: str, resource_version: str, resource: map, links: [map]}

@end
