Skip to main content
POST
/
events
/
{merchant_id}
Events - List
curl --request POST \
  --url https://sandbox.hyperswitch.io/events/{merchant_id} \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "created_after": "2023-01-01T00:00:00",
  "created_before": "2023-01-31T23:59:59",
  "event_classes": [
    "payments",
    "refunds"
  ],
  "event_types": [
    "payment_succeeded"
  ],
  "is_delivered": true,
  "limit": 5,
  "object_id": "{{object_id}}",
  "offset": 0,
  "profile_id": "{{profile_id}}"
}
'
import requests

url = "https://sandbox.hyperswitch.io/events/{merchant_id}"

payload = {
"created_after": "2023-01-01T00:00:00",
"created_before": "2023-01-31T23:59:59",
"event_classes": ["payments", "refunds"],
"event_types": ["payment_succeeded"],
"is_delivered": True,
"limit": 5,
"object_id": "{{object_id}}",
"offset": 0,
"profile_id": "{{profile_id}}"
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
created_after: '2023-01-01T00:00:00',
created_before: '2023-01-31T23:59:59',
event_classes: ['payments', 'refunds'],
event_types: ['payment_succeeded'],
is_delivered: true,
limit: 5,
object_id: '{{object_id}}',
offset: 0,
profile_id: '{{profile_id}}'
})
};

fetch('https://sandbox.hyperswitch.io/events/{merchant_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.hyperswitch.io/events/{merchant_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'created_after' => '2023-01-01T00:00:00',
'created_before' => '2023-01-31T23:59:59',
'event_classes' => [
'payments',
'refunds'
],
'event_types' => [
'payment_succeeded'
],
'is_delivered' => true,
'limit' => 5,
'object_id' => '{{object_id}}',
'offset' => 0,
'profile_id' => '{{profile_id}}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sandbox.hyperswitch.io/events/{merchant_id}"

payload := strings.NewReader("{\n \"created_after\": \"2023-01-01T00:00:00\",\n \"created_before\": \"2023-01-31T23:59:59\",\n \"event_classes\": [\n \"payments\",\n \"refunds\"\n ],\n \"event_types\": [\n \"payment_succeeded\"\n ],\n \"is_delivered\": true,\n \"limit\": 5,\n \"object_id\": \"{{object_id}}\",\n \"offset\": 0,\n \"profile_id\": \"{{profile_id}}\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://sandbox.hyperswitch.io/events/{merchant_id}")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"created_after\": \"2023-01-01T00:00:00\",\n \"created_before\": \"2023-01-31T23:59:59\",\n \"event_classes\": [\n \"payments\",\n \"refunds\"\n ],\n \"event_types\": [\n \"payment_succeeded\"\n ],\n \"is_delivered\": true,\n \"limit\": 5,\n \"object_id\": \"{{object_id}}\",\n \"offset\": 0,\n \"profile_id\": \"{{profile_id}}\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.hyperswitch.io/events/{merchant_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"created_after\": \"2023-01-01T00:00:00\",\n \"created_before\": \"2023-01-31T23:59:59\",\n \"event_classes\": [\n \"payments\",\n \"refunds\"\n ],\n \"event_types\": [\n \"payment_succeeded\"\n ],\n \"is_delivered\": true,\n \"limit\": 5,\n \"object_id\": \"{{object_id}}\",\n \"offset\": 0,\n \"profile_id\": \"{{profile_id}}\"\n}"

response = http.request(request)
puts response.read_body
{
  "events": [
    {
      "event_id": "evt_018e31720d1b7a2b82677d3032cab959",
      "merchant_id": "y3oqhf46pyzuxjbcn2giaqnb44",
      "profile_id": "SqB0zwDGR5wHppWf0bx7GKr1f2",
      "object_id": "QHrfd5LUDdZaKtAjdJmMu0dMa1",
      "initial_attempt_id": "evt_018e31720d1b7a2b82677d3032cab959",
      "created": "2022-09-10T10:11:12Z",
      "is_delivery_successful": true,
      "processor_merchant_id": "<string>"
    }
  ],
  "total_count": 123
}

Authorizations

api-key
string
header
required

Admin API keys allow you to perform some privileged actions such as creating a merchant account and Merchant Connector account.

Path Parameters

merchant_id
string
required

The unique identifier for the Merchant Account.

Body

application/json

The constraints that can be applied when listing Events.

The constraints to apply when filtering events.

created_after
string<date-time> | null

Filter events created after the specified time.

created_before
string<date-time> | null

Filter events created before the specified time.

limit
integer<int32> | null

Include at most the specified number of events.

Required range: x >= 0
offset
integer<int32> | null

Include events after the specified offset.

Required range: x >= 0
object_id
string | null

Filter all events associated with the specified object identifier (Payment Intent ID, Refund ID, etc.)

event_id
string | null

Filter all events associated with the specified Event_id

profile_id
string | null

Filter all events associated with the specified business profile ID.

event_classes
enum<string>[] | null

Filter events by their class.

Available options:
payments,
refunds,
disputes,
mandates,
payouts,
subscriptions
event_types
enum<string>[] | null

Filter events by their type.

Available options:
payment_succeeded,
payment_failed,
payment_processing,
payment_cancelled,
payment_cancelled_post_capture,
payment_authorized,
payment_partially_authorized,
payment_captured,
payment_expired,
action_required,
refund_succeeded,
refund_failed,
dispute_opened,
dispute_expired,
dispute_accepted,
dispute_cancelled,
dispute_challenged,
dispute_won,
dispute_lost,
mandate_active,
mandate_revoked,
payout_success,
payout_failed,
payout_initiated,
payout_processing,
payout_cancelled,
payout_expired,
payout_reversed,
invoice_paid,
surcharge_payment_succeeded,
surcharge_refund_succeeded
is_delivered
boolean | null

Filter all events by is_overall_delivery_successful field of the event.

recipient
enum<string> | null
Available options:
merchant,
connector

Response

200 - application/json

List of Events retrieved successfully

The response body of list initial delivery attempts api call.

events
object[]
required

The list of events

total_count
integer<int64>
required

Count of total events