Skip to main content
Create Event Subscription
curl --request POST \
  --url https://api.yapily.com/notifications/event-subscriptions \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "eventTypeId": "payment.status.completed",
  "notification": {
    "type": "WEBHOOK",
    "url": "https://httpbin.com/new_endpoint"
  }
}
'
{
  "meta": {
    "tracingId": "<string>"
  },
  "data": {
    "eventTypeId": "payment.status.completed",
    "applicationId": "2698db90-6635-4f76-b673-5ce8e2aeda0e",
    "created": "28-07-2021 15:47:03",
    "notification": {
      "type": "WEBHOOK",
      "url": "https://httpbin.com/new_endpoint"
    }
  },
  "links": {},
  "forwardedData": [
    {
      "headers": {},
      "url": "<string>"
    }
  ],
  "raw": [
    {
      "request": {
        "method": "<string>",
        "url": "<string>",
        "requestInstant": "2023-11-07T05:31:56Z",
        "headers": {},
        "body": {},
        "bodyParameters": {},
        "startTime": "2023-11-07T05:31:56Z",
        "startedAt": "2023-11-07T05:31:56Z"
      },
      "duration": "<string>",
      "headers": {},
      "resultCode": 123,
      "result": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Use HTTP Basic Authentication with your Application ID as username and Application Secret as password. Manage credentials in the Yapily Console. See Authentication for details.

Headers

sub-application
string<uuid>

The sub-application ID to which event type is being subscribed to

Body

application/json
eventTypeId
string
required

Unique identifier of the event type (for which notifications will be sent).

Allowed values: payment.status, payment.status.completed, payment.isoStatus

Example:

"payment.status.completed"

notification
object
required

Subscription details for how and where to receive notifications.

Response

Event subscription created successfully

meta
object
data
Response on successful creation of event subscription · object
forwardedData
object[]
raw
object[]
deprecated