curl --request POST \
--url https://api.verdn.com/v2/pledge-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "order_123",
"recipient": {
"email": "customer@example.com"
},
"pledges": [
{
"impact": {
"offeringId": "off_123",
"amount": 100
}
}
]
}
'import requests
url = "https://api.verdn.com/v2/pledge-transaction"
payload = {
"reference": "order_123",
"recipient": { "email": "customer@example.com" },
"pledges": [{ "impact": {
"offeringId": "off_123",
"amount": 100
} }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: 'order_123',
recipient: {email: 'customer@example.com'},
pledges: [{impact: {offeringId: 'off_123', amount: 100}}]
})
};
fetch('https://api.verdn.com/v2/pledge-transaction', 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.verdn.com/v2/pledge-transaction",
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([
'reference' => 'order_123',
'recipient' => [
'email' => 'customer@example.com'
],
'pledges' => [
[
'impact' => [
'offeringId' => 'off_123',
'amount' => 100
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.verdn.com/v2/pledge-transaction"
payload := strings.NewReader("{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.verdn.com/v2/pledge-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verdn.com/v2/pledge-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"charge": {
"amount": "25.00",
"currencyCode": "USD",
"paidAt": null
},
"createdAt": "2024-01-25T12:00:00Z",
"id": "ptran_01JH67QPC8R56E4DP7K4PB3MRD",
"isLive": false,
"notifications": [],
"pledges": [
{
"detail": {
"description": null,
"externalId": null,
"externalUrl": null,
"image": null,
"name": null,
"nounPlural": null,
"nounSingular": null
},
"id": "p_01JH67QPDG65G48KN5WE2J71Y4",
"impact": {
"amount": 100,
"offeringId": "off_123"
}
}
],
"recipient": {
"email": "customer@example.com",
"firstName": null,
"name": null
},
"reference": "order_123",
"timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
"trigger": {
"date": null,
"externalUrl": null,
"phrase": null
}
}{
"error": "true",
"message": "Not authorized. Check your API key and try again."
}Create Pledge Transaction
Create a new pledge transaction with multiple pledges
curl --request POST \
--url https://api.verdn.com/v2/pledge-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "order_123",
"recipient": {
"email": "customer@example.com"
},
"pledges": [
{
"impact": {
"offeringId": "off_123",
"amount": 100
}
}
]
}
'import requests
url = "https://api.verdn.com/v2/pledge-transaction"
payload = {
"reference": "order_123",
"recipient": { "email": "customer@example.com" },
"pledges": [{ "impact": {
"offeringId": "off_123",
"amount": 100
} }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: 'order_123',
recipient: {email: 'customer@example.com'},
pledges: [{impact: {offeringId: 'off_123', amount: 100}}]
})
};
fetch('https://api.verdn.com/v2/pledge-transaction', 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.verdn.com/v2/pledge-transaction",
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([
'reference' => 'order_123',
'recipient' => [
'email' => 'customer@example.com'
],
'pledges' => [
[
'impact' => [
'offeringId' => 'off_123',
'amount' => 100
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.verdn.com/v2/pledge-transaction"
payload := strings.NewReader("{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.verdn.com/v2/pledge-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verdn.com/v2/pledge-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"order_123\",\n \"recipient\": {\n \"email\": \"customer@example.com\"\n },\n \"pledges\": [\n {\n \"impact\": {\n \"offeringId\": \"off_123\",\n \"amount\": 100\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"charge": {
"amount": "25.00",
"currencyCode": "USD",
"paidAt": null
},
"createdAt": "2024-01-25T12:00:00Z",
"id": "ptran_01JH67QPC8R56E4DP7K4PB3MRD",
"isLive": false,
"notifications": [],
"pledges": [
{
"detail": {
"description": null,
"externalId": null,
"externalUrl": null,
"image": null,
"name": null,
"nounPlural": null,
"nounSingular": null
},
"id": "p_01JH67QPDG65G48KN5WE2J71Y4",
"impact": {
"amount": 100,
"offeringId": "off_123"
}
}
],
"recipient": {
"email": "customer@example.com",
"firstName": null,
"name": null
},
"reference": "order_123",
"timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
"trigger": {
"date": null,
"externalUrl": null,
"phrase": null
}
}{
"error": "true",
"message": "Not authorized. Check your API key and try again."
}Overview
Creates a new pledge transaction containing one or more pledges. Each pledge represents an impact commitment tied to a specific offering.Examples
const response = await fetch('https://api.verdn.com/v2/pledge-transaction', {
method: 'POST',
headers: {
'Authorization': 'Bearer verdn_sk_test_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
reference: "order_123",
recipient: {
email: "customer@example.com",
},
pledges: [{
impact: {
offeringId: "off_123",
amount: 100,
},
}],
})
})
{
"charge": {
"amount": "25.00",
"currencyCode": "USD",
"paidAt": null
},
"createdAt": "2024-01-25T12:00:00Z",
"id": "ptran_01JH67QPC8R56E4DP7K4PB3MRD",
"isLive": false,
"notifications": [],
"pledges": [
{
"detail": {
"description": null,
"externalId": null,
"externalUrl": null,
"image": null,
"name": null,
"nounPlural": null,
"nounSingular": null
},
"id": "p_01JH67QPDG65G48KN5WE2J71Y4",
"impact": {
"amount": 100,
"offeringId": "off_123"
}
}
],
"recipient": {
"email": "customer@example.com",
"firstName": null,
"name": null
},
"reference": "order_123",
"timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
"trigger": {
"date": null,
"externalUrl": null,
"phrase": null
}
}
const response = await fetch('https://api.verdn.com/v2/pledge-transaction', {
method: 'POST',
headers: {
'Authorization': 'Bearer verdn_sk_test_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
reference: "order_123",
recipient: {
email: "customer@example.com",
name: "John Doe",
firstName: "John"
},
trigger: {
phrase: "Purchase completed",
date: "2024-01-25T12:00:00Z",
externalUrl: "https://example.com/order/123"
},
pledges: [{
impact: {
offeringId: "off_123",
amount: 100
},
detail: {
name: "Custom Tree Planting",
description: "Plant trees in Africa",
image: "https://example.com/tree.jpg",
externalUrl: "https://example.com/impact/123",
externalId: "CUST_123"
}
}],
notifications: ["Email", "Klaviyo"]
})
})
{
"charge": {
"amount": "25.00",
"currencyCode": "USD",
"paidAt": null
},
"createdAt": "2024-01-25T12:00:00Z",
"id": "ptran_01JH67N6WT90W8EW7GF9QN2Y57",
"isLive": false,
"notifications": [
{
"status": "Pending",
"type": "Email"
},
{
"status": "Pending",
"type": "Klaviyo"
}
],
"pledges": [
{
"detail": {
"description": "Plant trees in Africa",
"externalId": "CUST_123",
"externalUrl": "https://example.com/impact/123",
"image": "https://example.com/tree.jpg",
"name": "Custom Tree Planting",
"nounPlural": null,
"nounSingular": null
},
"id": "p_01JH67N6Y8Z56NZK3HC3AATPJF",
"impact": {
"amount": 100,
"offeringId": "off_123"
},
}
],
"recipient": {
"email": "customer@example.com",
"name": "John Doe",
"firstName": "John"
},
"reference": "order_123",
"timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
"trigger": {
"date": "2024-01-25T12:00:00Z",
"externalUrl": "https://example.com/order/123",
"phrase": "Purchase completed"
}
}
API Reference
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
An optional unit ID to provide when using a team-level key
Body
Input schema for creating a new pledge transaction
A unique reference for the pledge transaction (e.g. order ID)
Show child attributes
Show child attributes
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional array of notification service(s) used to alert recipient on pledge creation
3Email, Klaviyo, Cordial, Ometria Response
Successful response
Show child attributes
Show child attributes
Unique ID for the pledge transaction
Boolean indicating production vs test pledge transaction
Array of notification statuses for this pledge transaction
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A unique reference for the pledge transaction (e.g. order ID)
URL to the generated timeline, intended for the pledge recipient (should not be made public)
Show child attributes
Show child attributes