curl --request POST \
--url https://server.stage.overflow.co/api/v3/subscriptions/{donorId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--data '
{
"paymentMethodId": "6710f34fd5061afeec3eab57",
"amount": 50,
"frequency": "month",
"startDate": "2025-01-15T05:00:00.000Z",
"timezone": "America/Chicago",
"anonymous": false,
"campaignId": "7710f34fd5061afeec3eab78",
"subcampaignId": "7710f34fd5061afeec3eab79",
"donorNotes": "Happy to support this cause!"
}
'import requests
url = "https://server.stage.overflow.co/api/v3/subscriptions/{donorId}"
payload = {
"paymentMethodId": "6710f34fd5061afeec3eab57",
"amount": 50,
"frequency": "month",
"startDate": "2025-01-15T05:00:00.000Z",
"timezone": "America/Chicago",
"anonymous": False,
"campaignId": "7710f34fd5061afeec3eab78",
"subcampaignId": "7710f34fd5061afeec3eab79",
"donorNotes": "Happy to support this cause!"
}
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
paymentMethodId: '6710f34fd5061afeec3eab57',
amount: 50,
frequency: 'month',
startDate: '2025-01-15T05:00:00.000Z',
timezone: 'America/Chicago',
anonymous: false,
campaignId: '7710f34fd5061afeec3eab78',
subcampaignId: '7710f34fd5061afeec3eab79',
donorNotes: 'Happy to support this cause!'
})
};
fetch('https://server.stage.overflow.co/api/v3/subscriptions/{donorId}', 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://server.stage.overflow.co/api/v3/subscriptions/{donorId}",
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([
'paymentMethodId' => '6710f34fd5061afeec3eab57',
'amount' => 50,
'frequency' => 'month',
'startDate' => '2025-01-15T05:00:00.000Z',
'timezone' => 'America/Chicago',
'anonymous' => false,
'campaignId' => '7710f34fd5061afeec3eab78',
'subcampaignId' => '7710f34fd5061afeec3eab79',
'donorNotes' => 'Happy to support this cause!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-client-id: <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://server.stage.overflow.co/api/v3/subscriptions/{donorId}"
payload := strings.NewReader("{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-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://server.stage.overflow.co/api/v3/subscriptions/{donorId}")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.stage.overflow.co/api/v3/subscriptions/{donorId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "6710f34fd5061afeec3eab57",
"donorId": "6710f34fd5061afeec3eab57",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"startDate": "2025-01-01T00:00:00.000Z",
"status": "active",
"amount": 50,
"anonymous": false,
"frequency": "weekly",
"nextPaymentDate": "2025-01-01T00:00:00.000Z",
"paymentMethod": {
"id": "6710f34fd5061afeec3eab57",
"holderName": "John Doe",
"type": "card",
"last4": "4242",
"expiration": "12/2025"
},
"campaign": {
"id": "7710f34fd5061afeec3eab78",
"name": "Mission 2025"
},
"subcampaign": {
"id": "7710f34fd5061afeec3eab79",
"name": "Toy Drive"
},
"donorCoveredFees": false,
"metadata": {
"orderId": "abc-123"
},
"locationId": "6710f34fd5061afeec3eab57"
}
}Create Subscription
Creates a new recurring donation subscription for a donor.
curl --request POST \
--url https://server.stage.overflow.co/api/v3/subscriptions/{donorId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>' \
--data '
{
"paymentMethodId": "6710f34fd5061afeec3eab57",
"amount": 50,
"frequency": "month",
"startDate": "2025-01-15T05:00:00.000Z",
"timezone": "America/Chicago",
"anonymous": false,
"campaignId": "7710f34fd5061afeec3eab78",
"subcampaignId": "7710f34fd5061afeec3eab79",
"donorNotes": "Happy to support this cause!"
}
'import requests
url = "https://server.stage.overflow.co/api/v3/subscriptions/{donorId}"
payload = {
"paymentMethodId": "6710f34fd5061afeec3eab57",
"amount": 50,
"frequency": "month",
"startDate": "2025-01-15T05:00:00.000Z",
"timezone": "America/Chicago",
"anonymous": False,
"campaignId": "7710f34fd5061afeec3eab78",
"subcampaignId": "7710f34fd5061afeec3eab79",
"donorNotes": "Happy to support this cause!"
}
headers = {
"x-client-id": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
paymentMethodId: '6710f34fd5061afeec3eab57',
amount: 50,
frequency: 'month',
startDate: '2025-01-15T05:00:00.000Z',
timezone: 'America/Chicago',
anonymous: false,
campaignId: '7710f34fd5061afeec3eab78',
subcampaignId: '7710f34fd5061afeec3eab79',
donorNotes: 'Happy to support this cause!'
})
};
fetch('https://server.stage.overflow.co/api/v3/subscriptions/{donorId}', 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://server.stage.overflow.co/api/v3/subscriptions/{donorId}",
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([
'paymentMethodId' => '6710f34fd5061afeec3eab57',
'amount' => 50,
'frequency' => 'month',
'startDate' => '2025-01-15T05:00:00.000Z',
'timezone' => 'America/Chicago',
'anonymous' => false,
'campaignId' => '7710f34fd5061afeec3eab78',
'subcampaignId' => '7710f34fd5061afeec3eab79',
'donorNotes' => 'Happy to support this cause!'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-client-id: <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://server.stage.overflow.co/api/v3/subscriptions/{donorId}"
payload := strings.NewReader("{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-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://server.stage.overflow.co/api/v3/subscriptions/{donorId}")
.header("x-client-id", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.stage.overflow.co/api/v3/subscriptions/{donorId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodId\": \"6710f34fd5061afeec3eab57\",\n \"amount\": 50,\n \"frequency\": \"month\",\n \"startDate\": \"2025-01-15T05:00:00.000Z\",\n \"timezone\": \"America/Chicago\",\n \"anonymous\": false,\n \"campaignId\": \"7710f34fd5061afeec3eab78\",\n \"subcampaignId\": \"7710f34fd5061afeec3eab79\",\n \"donorNotes\": \"Happy to support this cause!\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "6710f34fd5061afeec3eab57",
"donorId": "6710f34fd5061afeec3eab57",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"startDate": "2025-01-01T00:00:00.000Z",
"status": "active",
"amount": 50,
"anonymous": false,
"frequency": "weekly",
"nextPaymentDate": "2025-01-01T00:00:00.000Z",
"paymentMethod": {
"id": "6710f34fd5061afeec3eab57",
"holderName": "John Doe",
"type": "card",
"last4": "4242",
"expiration": "12/2025"
},
"campaign": {
"id": "7710f34fd5061afeec3eab78",
"name": "Mission 2025"
},
"subcampaign": {
"id": "7710f34fd5061afeec3eab79",
"name": "Toy Drive"
},
"donorCoveredFees": false,
"metadata": {
"orderId": "abc-123"
},
"locationId": "6710f34fd5061afeec3eab57"
}
}Authorizations
Client ID for API authentication
API Key for API authentication
Path Parameters
The Id of the donor to create the subscription for.
"2ea1ae03ca521e437db76d76"
Body
Subscription creation details
Id of the payment method.
"6710f34fd5061afeec3eab57"
Subscription amount in dollars.
x > 050
Recurring frequency for the subscription.
two-weeks, 1st-15th, month, one-time, week "month"
ISO 8601 date string when the subscription should start.
"2025-01-15T05:00:00.000Z"
Timezone for the subscription start date. Defaults to UTC if not provided.
"America/Chicago"
Whether the donor wants the contribution to be anonymous.
false
Id of the campaign to allocate funds to
"7710f34fd5061afeec3eab78"
Id of the subcampaign for more specific allocation.
"7710f34fd5061afeec3eab79"
Notes from the donor.
"Happy to support this cause!"
Response
Subscription created successfully
The subscription that was created
Show child attributes
Show child attributes
Was this page helpful?