Skip to main content
POST
/
v0
/
sources
/
{id}
/
events
/
{eventId}
/
approve
Approve
curl --request POST \
  --url https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve', 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://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/sources/{id}/events/{eventId}/approve")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "sev_c3d4e5f6g7h8i9j0",
  "createdAt": "2024-03-10T15:30:00Z",
  "customerId": "cus_q3r4s5t6u7v8w9x0",
  "errorMessage": null,
  "externalEventId": "evt_stripe_345678",
  "processedAt": "2024-03-10T16:00:00Z",
  "processedBy": "usr_platform",
  "rawData": {
    "amount": 50000,
    "currency": "usd",
    "description": "Stripe revenue event"
  },
  "sourceId": "src_x3y4z5a6b7c8d9e0",
  "status": "processed",
  "subscriptionId": "sub_z1a2b3c4d5e6f7g8",
  "updatedAt": "2024-03-10T16:00:00Z",
  "usageEventIds": [
    "usg_a1b2c3d4e5f6g7h8"
  ]
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

Unique identifier for a source

Pattern: ^src_[a-zA-Z0-9]+$
eventId
string
required

Unique identifier for a source event

Pattern: ^sev_[a-zA-Z0-9]+$

Response

Event approved successfully

id
string
required

Unique identifier for a source event

Pattern: ^sev_[a-zA-Z0-9]+$
createdAt
string<date-time>
required
externalEventId
string
required
rawData
object
required
sourceId
string
required

Unique identifier for a source

Pattern: ^src_[a-zA-Z0-9]+$
status
enum<string>
required
Available options:
pending,
processed,
failed,
rejected
updatedAt
string<date-time>
required
customerId
string

The customer associated with this source event

errorMessage
string
processedAt
string<date-time>
processedBy
string
subscriptionId
string

The subscription associated with this source event

usageEventIds
string[]