Webhook

Objects representing HTTP endpoints that will receive callbacks after various events.

Webhook / Create

Create | Delete | List | Find | Update

Examples

Create Webhook
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";

Webhook webhook = Webhook.create(new PaymentsMap()
        .set("url", "https://www.simplifycommerce.com/simplifyendpoint")
);

System.out.println(webhook);
require 'simplify'

Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"

webhook = Simplify::Webhook.create({
        "url" => "https://www.simplifycommerce.com/simplifyendpoint"
})

puts webhook.inspect
import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

webhook = simplify.Webhook.create({
        "url" : "https://www.simplifycommerce.com/simplifyendpoint"

})

print(webhook)
<?php

require_once("./lib/Simplify.php");

Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';

$webhook = Simplify_Webhook::createWebhook(array(
        'url' => 'https://www.simplifycommerce.com/simplifyendpoint'
));

print_r($webhook);

?>
use Net::Simplify;

$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";

my $webhook = Net::Simplify::Webhook->create({
    url => "https://www.simplifycommerce.com/simplifyendpoint"
});

print "Webhook ID ", $webhook->{id}, "\n";
using SimplifyCommerce.Payments;

PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";

PaymentsApi api = new PaymentsApi();

Webhook webhook = new Webhook();
webhook.Url = "https://www.simplifycommerce.com/simplifyendpoint";

try
{
    webhook = (Webhook)api.Create(webhook);
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}
var Simplify = require("simplify-commerce"),
    client = Simplify.getClient({
        publicKey: 'YOUR_PUBLIC_API_KEY',
        privateKey: 'YOUR_PRIVATE_API_KEY'
    });

client.webhook.create({
    url : "https://www.simplifycommerce.com/simplifyendpoint"
}, function(errData, data){

    if(errData){
        console.error("Error Message: " + errData.data.error.message);
        // handle the error
        return;
    }

    console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
url Endpoint URL required
OUTPUT
id Object ID
dateCreated Date in UTC millis Webhook was created
url Endpoint URL

Webhook / Delete

Create | Delete | List | Find | Update

Examples

Delete Webhook
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";

Webhook webhook = Webhook.find("4TR6Bc");

webhook = webhook.delete();

System.out.println(webhook);
require 'simplify'

Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"

webhook = Simplify::Webhook.find('4TR6Bc')

webhook = webhook.delete()

puts webhook.inspect
import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

webhook = simplify.Webhook.find('4TR6Bc')
webhook.delete()
<?php

require_once("./lib/Simplify.php");

Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';

$obj  = Simplify_Webhook::findWebhook('4TR6Bc');

$obj = $obj->deleteWebhook();

?>
use Net::Simplify;

$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";

$webhook = Net::Simplify::Webhook->find('4TR6Bc');

$webhook->delete();

using SimplifyCommerce.Payments;

PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";

PaymentsApi api = new PaymentsApi();


try
{
    String id = "1234";

    Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);

    webhook = (Webhook)api.Delete(typeof(Webhook), webhook.Id);

    Console.WriteLine (webhook.Id);
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}

var Simplify = require("simplify-commerce"),
    client = Simplify.getClient({
        publicKey: 'YOUR_PUBLIC_API_KEY',
        privateKey: 'YOUR_PRIVATE_API_KEY'
    });

client.webhook.delete("4TR6Bc", function(errData, data){

    if(errData){
        console.error("Error Message: " + errData.data.error.message);
        // handle the error
        return;
    }

    console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id Object ID required
OUTPUT
id Object ID
dateCreated Date in UTC millis Webhook was created
url Endpoint URL

Webhook / List

Create | Delete | List | Find | Update

Examples

List Webhook
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";

ResourceList<Webhook> webhook = Webhook.list(new PaymentsMap("max", 30));

System.out.println ("Total: " + webhook.getTotal());
for (Webhook o: webhook.getList()) {
    System.out.println(o.toString());
}
require 'simplify'

Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"

val = Simplify::Webhook.list({"max" => 30})

puts "Total: #{val['total']}"
val['list'].each do |o|
    puts o.inspect
end
import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

webhooks = simplify.Webhook.list({"max": 30})

print "Total: " + str(webhooks.total)
for o in webhooks.list:
    print(o)
<?php

require_once("./lib/Simplify.php");

Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';

$webhook = Simplify_Webhook::listWebhook(array("max" => 30));

print "Total: " . $webhook->total . "\n";
foreach ($webhook->list as $o) {
    print_r($o);
}

?>
use Net::Simplify;

$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";

$webhooks = Net::Simplify::Webhook->list({max => 30});

print "Total: ", $webhooks->total, "\n";
foreach my $webhook ($webhooks->list) {
    print $webhook->{id}, "\n";
}
using SimplifyCommerce.Payments;

PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";

PaymentsApi api = new PaymentsApi();


try
{
    ResourceList<Webhook> webhook = (ResourceList<Webhook>)api.List(typeof(Webhook));

    Console.WriteLine ("Total: " + webhook.Total);
    Console.WriteLine ("List: " + webhook.List.ToString());

}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}

var Simplify = require("simplify-commerce"),
    client = Simplify.getClient({
        publicKey: 'YOUR_PUBLIC_API_KEY',
        privateKey: 'YOUR_PRIVATE_API_KEY'
    });

client.webhook.list({max: 30}, function(errData, data){

    if(errData){
        console.error("Error Message: " + errData.data.error.message);
        // handle the error
        return;
    }

    console.log("Total: " + data.total);

    for(var i=0; i < data.list.length; i++){
        console.log("Amount: " + data.list[i].amount);
    }
});
INPUT PARAMETERS
filter Filters to apply to the list. optional
max Allows up to a max of 50 list items to return.
[min value: 0, max value: 50, default: 20]
optional
offset Used in paging of the list. This is the start offset of the page.
[min value: 0, default: 0]
optional
sorting Allows for ascending or descending sorting of the list. The value is a map between the property name and the sorting direction (either 'asc' for ascending or 'desc' for descending). Sortable properties are:dateCreated optional
OUTPUT
filter Filters to apply to the list.
list Object list
max Allows up to a max of 50 list items to return.
offset Used in paging of the list. This is the start offset of the page.
sorting Allows for ascending or descending sorting of the list.
total Total number of records available

Webhook / Find

Create | Delete | List | Find | Update

Examples

Find Webhook
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";

Webhook webhook = Webhook.find("4TR6Bc");

System.out.println (webhook);
require 'simplify'

Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"

webhook = Simplify::Webhook.find('4TR6Bc')

puts webhook.inspect

import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

webhook = simplify.Webhook.find('4TR6Bc')

print(webhook)
<?php

require_once("./lib/Simplify.php");

Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';

$obj  = Simplify_Webhook::findWebhook('4TR6Bc');

print_r($obj);

?>
use Net::Simplify;

$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";

$webhook = Net::Simplify::Webhook->find('4TR6Bc');

print $webhook->{id}, "\n";
using SimplifyCommerce.Payments;
using Newtonsoft.Json;

PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";

PaymentsApi api = new PaymentsApi();


try
{
    String id = "1234";

    Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);

    // output all properties
    Console.WriteLine(JsonConvert.SerializeObject(webhook).ToString());
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}

var Simplify = require("simplify-commerce"),
    client = Simplify.getClient({
        publicKey: 'YOUR_PUBLIC_API_KEY',
        privateKey: 'YOUR_PRIVATE_API_KEY'
    });

client.webhook.find("4TR6Bc", function(errData, data){

    if(errData){
        console.error("Error Message: " + errData.data.error.message);
        // handle the error
        return;
    }

    console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id Object ID required
OUTPUT
id Object ID
dateCreated Date in UTC millis Webhook was created
url Endpoint URL

Webhook / Update

Create | Delete | List | Find | Update

Examples

Update Webhook
PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";

Webhook webhook = Webhook.find("4TR6Bc");

webhook.set("url", "https://www.simplifycommerce.com/simplifyendpoint2");

webhook.update();

require 'simplify'

Simplify::public_key = "YOUR_PUBLIC_API_KEY"
Simplify::private_key = "YOUR_PRIVATE_API_KEY"


webhook = Simplify::Webhook.find('4TR6Bc')

updates = {
        "url" => "https://www.simplifycommerce.com/simplifyendpoint2"

}

webhook.merge!(updates)

webhook = webhook.update()
puts webhook.inspect
import simplify

simplify.public_key = "YOUR_PUBLIC_API_KEY"
simplify.private_key = "YOUR_PRIVATE_API_KEY"

webhook = simplify.Webhook.find('4TR6Bc')

webhook["url"] = 'https://www.simplifycommerce.com/simplifyendpoint2'

webhook.update()
<?php

require_once("./lib/Simplify.php");

Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';

$webhook  = Simplify_Webhook::findWebhook('4TR6Bc');

$updates = array(
        'url' => 'https://www.simplifycommerce.com/simplifyendpoint2'

);

$webhook->setAll($updates);

$webhook->updateWebhook();

?>
use Net::Simplify;

$Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
$Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";

$webhook = Net::Simplify::Webhook->find('4TR6Bc');

$webhook->{url} = "https://www.simplifycommerce.com/simplifyendpoint2";

$webhook->update();
using SimplifyCommerce.Payments;

PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";

PaymentsApi api = new PaymentsApi();

string id = "1234";

Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);

webhook.Url = "https://www.simplifycommerce.com/simplifyendpoint2";


try
{
    webhook = (Webhook)api.Update(webhook);
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}


var Simplify = require("simplify-commerce"),
    client = Simplify.getClient({
        publicKey: 'YOUR_PUBLIC_API_KEY',
        privateKey: 'YOUR_PRIVATE_API_KEY'
    });

client.webhook.update({
    id: "4TR6Bc", // ID of object to update
    url : "https://www.simplifycommerce.com/simplifyendpoint2"
}, function(errData, data){

    if(errData){
        console.error("Error Message: " + errData.data.error.message);
        // handle the error
        return;
    }

    console.log("Success Response: " + JSON.stringify(data));
});
INPUT PARAMETERS
id Object ID required
url Endpoint URL required
OUTPUT
id Object ID
dateCreated Date in UTC millis Webhook was created
url Endpoint URL