Webhook

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

Webhook / Create

Create | Delete | List | Find | Update

Examples

Create Webhook
  1. PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
  2. PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
  3.  
  4. Webhook webhook = Webhook.create(new PaymentsMap()
  5. .set("url", "https://www.simplifycommerce.com/simplifyendpoint")
  6. );
  7.  
  8. System.out.println(webhook);
  1. require 'simplify'
  2.  
  3. Simplify::public_key = "YOUR_PUBLIC_API_KEY"
  4. Simplify::private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = Simplify::Webhook.create({
  7. "url" => "https://www.simplifycommerce.com/simplifyendpoint"
  8. })
  9.  
  10. puts webhook.inspect
  1. import simplify
  2.  
  3. simplify.public_key = "YOUR_PUBLIC_API_KEY"
  4. simplify.private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = simplify.Webhook.create({
  7. "url" : "https://www.simplifycommerce.com/simplifyendpoint"
  8.  
  9. })
  10.  
  11. print(webhook)
  1. <?php
  2.  
  3. require_once("./lib/Simplify.php");
  4.  
  5. Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
  6. Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
  7.  
  8. $webhook = Simplify_Webhook::createWebhook(array(
  9. 'url' => 'https://www.simplifycommerce.com/simplifyendpoint'
  10. ));
  11.  
  12. print_r($webhook);
  13.  
  14. ?>
  1. use Net::Simplify;
  2.  
  3. $Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
  4. $Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
  5.  
  6. my $webhook = Net::Simplify::Webhook->create({
  7. url => "https://www.simplifycommerce.com/simplifyendpoint"
  8. });
  9.  
  10. print "Webhook ID ", $webhook->{id}, "\n";
  1. using SimplifyCommerce.Payments;
  2.  
  3. PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
  4. PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
  5.  
  6. PaymentsApi api = new PaymentsApi();
  7.  
  8. Webhook webhook = new Webhook();
  9. webhook.Url = "https://www.simplifycommerce.com/simplifyendpoint";
  10.  
  11. try
  12. {
  13. webhook = (Webhook)api.Create(webhook);
  14. }
  15. catch (Exception e)
  16. {
  17. Console.WriteLine(e.ToString());
  18. }
  1. var Simplify = require("simplify-commerce"),
  2. client = Simplify.getClient({
  3. publicKey: 'YOUR_PUBLIC_API_KEY',
  4. privateKey: 'YOUR_PRIVATE_API_KEY'
  5. });
  6.  
  7. client.webhook.create({
  8. url : "https://www.simplifycommerce.com/simplifyendpoint"
  9. }, function(errData, data){
  10.  
  11. if(errData){
  12. console.error("Error Message: " + errData.data.error.message);
  13. // handle the error
  14. return;
  15. }
  16.  
  17. console.log("Success Response: " + JSON.stringify(data));
  18. });
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
  1. PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
  2. PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
  3.  
  4. Webhook webhook = Webhook.find("4TR6Bc");
  5.  
  6. webhook = webhook.delete();
  7.  
  8. System.out.println(webhook);
  1. require 'simplify'
  2.  
  3. Simplify::public_key = "YOUR_PUBLIC_API_KEY"
  4. Simplify::private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = Simplify::Webhook.find('4TR6Bc')
  7.  
  8. webhook = webhook.delete()
  9.  
  10. puts webhook.inspect
  1. import simplify
  2.  
  3. simplify.public_key = "YOUR_PUBLIC_API_KEY"
  4. simplify.private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = simplify.Webhook.find('4TR6Bc')
  7. webhook.delete()
  1. <?php
  2.  
  3. require_once("./lib/Simplify.php");
  4.  
  5. Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
  6. Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
  7.  
  8. $obj = Simplify_Webhook::findWebhook('4TR6Bc');
  9.  
  10. $obj = $obj->deleteWebhook();
  11.  
  12. ?>
  1. use Net::Simplify;
  2.  
  3. $Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
  4. $Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
  5.  
  6. $webhook = Net::Simplify::Webhook->find('4TR6Bc');
  7.  
  8. $webhook->delete();
  9.  
  1. using SimplifyCommerce.Payments;
  2.  
  3. PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
  4. PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
  5.  
  6. PaymentsApi api = new PaymentsApi();
  7.  
  8.  
  9. try
  10. {
  11. String id = "1234";
  12.  
  13. Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);
  14.  
  15. webhook = (Webhook)api.Delete(typeof(Webhook), webhook.Id);
  16.  
  17. Console.WriteLine (webhook.Id);
  18. }
  19. catch (Exception e)
  20. {
  21. Console.WriteLine(e.ToString());
  22. }
  23.  
  1. var Simplify = require("simplify-commerce"),
  2. client = Simplify.getClient({
  3. publicKey: 'YOUR_PUBLIC_API_KEY',
  4. privateKey: 'YOUR_PRIVATE_API_KEY'
  5. });
  6.  
  7. client.webhook.delete("4TR6Bc", function(errData, data){
  8.  
  9. if(errData){
  10. console.error("Error Message: " + errData.data.error.message);
  11. // handle the error
  12. return;
  13. }
  14.  
  15. console.log("Success Response: " + JSON.stringify(data));
  16. });
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
  1. PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
  2. PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
  3.  
  4. ResourceList<Webhook> webhook = Webhook.list(new PaymentsMap("max", 30));
  5.  
  6. System.out.println ("Total: " + webhook.getTotal());
  7. for (Webhook o: webhook.getList()) {
  8. System.out.println(o.toString());
  9. }
  1. require 'simplify'
  2.  
  3. Simplify::public_key = "YOUR_PUBLIC_API_KEY"
  4. Simplify::private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. val = Simplify::Webhook.list({"max" => 30})
  7.  
  8. puts "Total: #{val['total']}"
  9. val['list'].each do |o|
  10. puts o.inspect
  11. end
  1. import simplify
  2.  
  3. simplify.public_key = "YOUR_PUBLIC_API_KEY"
  4. simplify.private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhooks = simplify.Webhook.list({"max": 30})
  7.  
  8. print "Total: " + str(webhooks.total)
  9. for o in webhooks.list:
  10. print(o)
  1. <?php
  2.  
  3. require_once("./lib/Simplify.php");
  4.  
  5. Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
  6. Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
  7.  
  8. $webhook = Simplify_Webhook::listWebhook(array("max" => 30));
  9.  
  10. print "Total: " . $webhook->total . "\n";
  11. foreach ($webhook->list as $o) {
  12. print_r($o);
  13. }
  14.  
  15. ?>
  1. use Net::Simplify;
  2.  
  3. $Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
  4. $Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
  5.  
  6. $webhooks = Net::Simplify::Webhook->list({max => 30});
  7.  
  8. print "Total: ", $webhooks->total, "\n";
  9. foreach my $webhook ($webhooks->list) {
  10. print $webhook->{id}, "\n";
  11. }
  1. using SimplifyCommerce.Payments;
  2.  
  3. PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
  4. PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
  5.  
  6. PaymentsApi api = new PaymentsApi();
  7.  
  8.  
  9. try
  10. {
  11. ResourceList<Webhook> webhook = (ResourceList<Webhook>)api.List(typeof(Webhook));
  12.  
  13. Console.WriteLine ("Total: " + webhook.Total);
  14. Console.WriteLine ("List: " + webhook.List.ToString());
  15.  
  16. }
  17. catch (Exception e)
  18. {
  19. Console.WriteLine(e.ToString());
  20. }
  21.  
  1. var Simplify = require("simplify-commerce"),
  2. client = Simplify.getClient({
  3. publicKey: 'YOUR_PUBLIC_API_KEY',
  4. privateKey: 'YOUR_PRIVATE_API_KEY'
  5. });
  6.  
  7. client.webhook.list({max: 30}, function(errData, data){
  8.  
  9. if(errData){
  10. console.error("Error Message: " + errData.data.error.message);
  11. // handle the error
  12. return;
  13. }
  14.  
  15. console.log("Total: " + data.total);
  16.  
  17. for(var i=0; i < data.list.length; i++){
  18. console.log("Amount: " + data.list[i].amount);
  19. }
  20. });
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
  1. PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
  2. PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
  3.  
  4. Webhook webhook = Webhook.find("4TR6Bc");
  5.  
  6. System.out.println (webhook);
  1. require 'simplify'
  2.  
  3. Simplify::public_key = "YOUR_PUBLIC_API_KEY"
  4. Simplify::private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = Simplify::Webhook.find('4TR6Bc')
  7.  
  8. puts webhook.inspect
  9.  
  1. import simplify
  2.  
  3. simplify.public_key = "YOUR_PUBLIC_API_KEY"
  4. simplify.private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = simplify.Webhook.find('4TR6Bc')
  7.  
  8. print(webhook)
  1. <?php
  2.  
  3. require_once("./lib/Simplify.php");
  4.  
  5. Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
  6. Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
  7.  
  8. $obj = Simplify_Webhook::findWebhook('4TR6Bc');
  9.  
  10. print_r($obj);
  11.  
  12. ?>
  1. use Net::Simplify;
  2.  
  3. $Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
  4. $Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
  5.  
  6. $webhook = Net::Simplify::Webhook->find('4TR6Bc');
  7.  
  8. print $webhook->{id}, "\n";
  1. using SimplifyCommerce.Payments;
  2. using Newtonsoft.Json;
  3.  
  4. PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
  5. PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
  6.  
  7. PaymentsApi api = new PaymentsApi();
  8.  
  9.  
  10. try
  11. {
  12. String id = "1234";
  13.  
  14. Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);
  15.  
  16. // output all properties
  17. Console.WriteLine(JsonConvert.SerializeObject(webhook).ToString());
  18. }
  19. catch (Exception e)
  20. {
  21. Console.WriteLine(e.ToString());
  22. }
  23.  
  1. var Simplify = require("simplify-commerce"),
  2. client = Simplify.getClient({
  3. publicKey: 'YOUR_PUBLIC_API_KEY',
  4. privateKey: 'YOUR_PRIVATE_API_KEY'
  5. });
  6.  
  7. client.webhook.find("4TR6Bc", function(errData, data){
  8.  
  9. if(errData){
  10. console.error("Error Message: " + errData.data.error.message);
  11. // handle the error
  12. return;
  13. }
  14.  
  15. console.log("Success Response: " + JSON.stringify(data));
  16. });
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
  1. PaymentsApi.PUBLIC_KEY = "YOUR_PUBLIC_API_KEY";
  2. PaymentsApi.PRIVATE_KEY = "YOUR_PRIVATE_API_KEY";
  3.  
  4. Webhook webhook = Webhook.find("4TR6Bc");
  5.  
  6. webhook.set("url", "https://www.simplifycommerce.com/simplifyendpoint2");
  7.  
  8. webhook.update();
  9.  
  1. require 'simplify'
  2.  
  3. Simplify::public_key = "YOUR_PUBLIC_API_KEY"
  4. Simplify::private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6.  
  7. webhook = Simplify::Webhook.find('4TR6Bc')
  8.  
  9. updates = {
  10. "url" => "https://www.simplifycommerce.com/simplifyendpoint2"
  11.  
  12. }
  13.  
  14. webhook.merge!(updates)
  15.  
  16. webhook = webhook.update()
  17. puts webhook.inspect
  1. import simplify
  2.  
  3. simplify.public_key = "YOUR_PUBLIC_API_KEY"
  4. simplify.private_key = "YOUR_PRIVATE_API_KEY"
  5.  
  6. webhook = simplify.Webhook.find('4TR6Bc')
  7.  
  8. webhook["url"] = 'https://www.simplifycommerce.com/simplifyendpoint2'
  9.  
  10. webhook.update()
  1. <?php
  2.  
  3. require_once("./lib/Simplify.php");
  4.  
  5. Simplify::$publicKey = 'YOUR_PUBLIC_API_KEY';
  6. Simplify::$privateKey = 'YOUR_PRIVATE_API_KEY';
  7.  
  8. $webhook = Simplify_Webhook::findWebhook('4TR6Bc');
  9.  
  10. $updates = array(
  11. 'url' => 'https://www.simplifycommerce.com/simplifyendpoint2'
  12.  
  13. );
  14.  
  15. $webhook->setAll($updates);
  16.  
  17. $webhook->updateWebhook();
  18.  
  19. ?>
  1. use Net::Simplify;
  2.  
  3. $Net::Simplify::public_key = "YOUR_PUBLIC_API_KEY";
  4. $Net::Simplify::private_key = "YOUR_PRIVATE_API_KEY";
  5.  
  6. $webhook = Net::Simplify::Webhook->find('4TR6Bc');
  7.  
  8. $webhook->{url} = "https://www.simplifycommerce.com/simplifyendpoint2";
  9.  
  10. $webhook->update();
  1. using SimplifyCommerce.Payments;
  2.  
  3. PaymentsApi.PublicApiKey = "YOUR_PUBLIC_KEY";
  4. PaymentsApi.PrivateApiKey = "YOUR_PRIVATE_KEY";
  5.  
  6. PaymentsApi api = new PaymentsApi();
  7.  
  8. string id = "1234";
  9.  
  10. Webhook webhook = (Webhook)api.Find(typeof(Webhook), id);
  11.  
  12. webhook.Url = "https://www.simplifycommerce.com/simplifyendpoint2";
  13.  
  14.  
  15. try
  16. {
  17. webhook = (Webhook)api.Update(webhook);
  18. }
  19. catch (Exception e)
  20. {
  21. Console.WriteLine(e.ToString());
  22. }
  23.  
  24.  
  1. var Simplify = require("simplify-commerce"),
  2. client = Simplify.getClient({
  3. publicKey: 'YOUR_PUBLIC_API_KEY',
  4. privateKey: 'YOUR_PRIVATE_API_KEY'
  5. });
  6.  
  7. client.webhook.update({
  8. id: "4TR6Bc", // ID of object to update
  9. url : "https://www.simplifycommerce.com/simplifyendpoint2"
  10. }, function(errData, data){
  11.  
  12. if(errData){
  13. console.error("Error Message: " + errData.data.error.message);
  14. // handle the error
  15. return;
  16. }
  17.  
  18. console.log("Success Response: " + JSON.stringify(data));
  19. });
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