Traiter une transaction
curl --request POST \
--url https://api.crowdchange.dev/v2/client/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"frequency": "<string>",
"email": "<string>",
"fundraiser_id": 123,
"card": {
"type": "<string>",
"token": "<string>"
},
"billing": {
"is_foundation": true,
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"custom_data": {},
"tax_receipt": {
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"tribute": {
"fundraiser_tribute_id": 123,
"type": "<string>",
"honoree": "<string>",
"message": "<string>",
"method": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"donor_copy": true
},
"extra": {
"mail_receipt": true,
"donation_setting_item_id": 123,
"installments": {
"total_amount": 123,
"duration": 123,
"day": 123
}
},
"mail": {
"same_as_billing": true,
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.crowdchange.dev/v2/client/transactions"
payload = {
"amount": 123,
"frequency": "<string>",
"email": "<string>",
"fundraiser_id": 123,
"card": {
"type": "<string>",
"token": "<string>"
},
"billing": {
"is_foundation": True,
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"custom_data": {},
"tax_receipt": {
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"tribute": {
"fundraiser_tribute_id": 123,
"type": "<string>",
"honoree": "<string>",
"message": "<string>",
"method": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"donor_copy": True
},
"extra": {
"mail_receipt": True,
"donation_setting_item_id": 123,
"installments": {
"total_amount": 123,
"duration": 123,
"day": 123
}
},
"mail": {
"same_as_billing": True,
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
frequency: '<string>',
email: '<string>',
fundraiser_id: 123,
card: {type: '<string>', token: '<string>'},
billing: {
is_foundation: true,
title: '<string>',
business_name: '<string>',
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
custom_data: {},
tax_receipt: {
title: '<string>',
business_name: '<string>',
first_name: '<string>',
last_name: '<string>',
email: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
tribute: {
fundraiser_tribute_id: 123,
type: '<string>',
honoree: '<string>',
message: '<string>',
method: '<string>',
address: {
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
email: '<string>',
phone: '<string>',
name: '<string>',
donor_copy: true
},
extra: {
mail_receipt: true,
donation_setting_item_id: 123,
installments: {total_amount: 123, duration: 123, day: 123}
},
mail: {
same_as_billing: true,
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
})
};
fetch('https://api.crowdchange.dev/v2/client/transactions', 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.crowdchange.dev/v2/client/transactions",
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([
'amount' => 123,
'frequency' => '<string>',
'email' => '<string>',
'fundraiser_id' => 123,
'card' => [
'type' => '<string>',
'token' => '<string>'
],
'billing' => [
'is_foundation' => true,
'title' => '<string>',
'business_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'custom_data' => [
],
'tax_receipt' => [
'title' => '<string>',
'business_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'tribute' => [
'fundraiser_tribute_id' => 123,
'type' => '<string>',
'honoree' => '<string>',
'message' => '<string>',
'method' => '<string>',
'address' => [
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'email' => '<string>',
'phone' => '<string>',
'name' => '<string>',
'donor_copy' => true
],
'extra' => [
'mail_receipt' => true,
'donation_setting_item_id' => 123,
'installments' => [
'total_amount' => 123,
'duration' => 123,
'day' => 123
]
],
'mail' => [
'same_as_billing' => true,
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.crowdchange.dev/v2/client/transactions"
payload := strings.NewReader("{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.crowdchange.dev/v2/client/transactions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/client/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123123,
"ref_id": "SCXXxxXxxxxxXXXx",
"amount": 49.95,
"currency": "USD",
"currency_symbol": "$",
"frequency": "once",
"fundraiser_id": 1,
"parent_id": null,
"fundraiser_page_id": null,
"fundraiser_team_id": null,
"organization_id": 1,
"fundraiser_name": "Gala Night",
"organization_name": "Crowdchange",
"organization_code": "CrowdchangeID",
"user_id": 120120,
"email": "john@example.com",
"mail": null,
"statement_descriptor": "XXX*CC XXX",
"summary": {
"amount_covered_fee": 1.95,
"amount_custom_fee": 0,
"amount_donation": 48,
"amount_apparel": 0,
"amount_ticket": 0,
"amount_registration": 0,
"amount_sponsor": 0,
"amount_cards": 0,
"frequency": "once"
},
"upsell": null,
"promo_code": null,
"billing_address": {
"name": "Mr. John Snow",
"email": "john@example.com",
"business_name": null,
"title": "Mr.",
"first_name": "John",
"last_name": "Snow",
"address": "123 Main St",
"city": "Toronto",
"state": "ON",
"zip": "M5V2T6",
"country": "CA",
"phone": null
},
"dtd": null,
"created_at": "2024-01-01 12:00:00",
"status": "received"
}
Transactions
Traiter une transaction
Soumettez une transaction de don CrowdChange avec un jeton de paiement de votre processeur pour débiter le donateur et enregistrer le don à la campagne.
POST
/
v2
/
client
/
transactions
Traiter une transaction
curl --request POST \
--url https://api.crowdchange.dev/v2/client/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"frequency": "<string>",
"email": "<string>",
"fundraiser_id": 123,
"card": {
"type": "<string>",
"token": "<string>"
},
"billing": {
"is_foundation": true,
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"custom_data": {},
"tax_receipt": {
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"tribute": {
"fundraiser_tribute_id": 123,
"type": "<string>",
"honoree": "<string>",
"message": "<string>",
"method": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"donor_copy": true
},
"extra": {
"mail_receipt": true,
"donation_setting_item_id": 123,
"installments": {
"total_amount": 123,
"duration": 123,
"day": 123
}
},
"mail": {
"same_as_billing": true,
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.crowdchange.dev/v2/client/transactions"
payload = {
"amount": 123,
"frequency": "<string>",
"email": "<string>",
"fundraiser_id": 123,
"card": {
"type": "<string>",
"token": "<string>"
},
"billing": {
"is_foundation": True,
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"custom_data": {},
"tax_receipt": {
"title": "<string>",
"business_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"tribute": {
"fundraiser_tribute_id": 123,
"type": "<string>",
"honoree": "<string>",
"message": "<string>",
"method": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
},
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"donor_copy": True
},
"extra": {
"mail_receipt": True,
"donation_setting_item_id": 123,
"installments": {
"total_amount": 123,
"duration": 123,
"day": 123
}
},
"mail": {
"same_as_billing": True,
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 123,
frequency: '<string>',
email: '<string>',
fundraiser_id: 123,
card: {type: '<string>', token: '<string>'},
billing: {
is_foundation: true,
title: '<string>',
business_name: '<string>',
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
custom_data: {},
tax_receipt: {
title: '<string>',
business_name: '<string>',
first_name: '<string>',
last_name: '<string>',
email: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
tribute: {
fundraiser_tribute_id: 123,
type: '<string>',
honoree: '<string>',
message: '<string>',
method: '<string>',
address: {
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
},
email: '<string>',
phone: '<string>',
name: '<string>',
donor_copy: true
},
extra: {
mail_receipt: true,
donation_setting_item_id: 123,
installments: {total_amount: 123, duration: 123, day: 123}
},
mail: {
same_as_billing: true,
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
})
};
fetch('https://api.crowdchange.dev/v2/client/transactions', 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.crowdchange.dev/v2/client/transactions",
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([
'amount' => 123,
'frequency' => '<string>',
'email' => '<string>',
'fundraiser_id' => 123,
'card' => [
'type' => '<string>',
'token' => '<string>'
],
'billing' => [
'is_foundation' => true,
'title' => '<string>',
'business_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'custom_data' => [
],
'tax_receipt' => [
'title' => '<string>',
'business_name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'tribute' => [
'fundraiser_tribute_id' => 123,
'type' => '<string>',
'honoree' => '<string>',
'message' => '<string>',
'method' => '<string>',
'address' => [
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
],
'email' => '<string>',
'phone' => '<string>',
'name' => '<string>',
'donor_copy' => true
],
'extra' => [
'mail_receipt' => true,
'donation_setting_item_id' => 123,
'installments' => [
'total_amount' => 123,
'duration' => 123,
'day' => 123
]
],
'mail' => [
'same_as_billing' => true,
'address' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.crowdchange.dev/v2/client/transactions"
payload := strings.NewReader("{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.crowdchange.dev/v2/client/transactions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/client/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"frequency\": \"<string>\",\n \"email\": \"<string>\",\n \"fundraiser_id\": 123,\n \"card\": {\n \"type\": \"<string>\",\n \"token\": \"<string>\"\n },\n \"billing\": {\n \"is_foundation\": true,\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"custom_data\": {},\n \"tax_receipt\": {\n \"title\": \"<string>\",\n \"business_name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"tribute\": {\n \"fundraiser_tribute_id\": 123,\n \"type\": \"<string>\",\n \"honoree\": \"<string>\",\n \"message\": \"<string>\",\n \"method\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"donor_copy\": true\n },\n \"extra\": {\n \"mail_receipt\": true,\n \"donation_setting_item_id\": 123,\n \"installments\": {\n \"total_amount\": 123,\n \"duration\": 123,\n \"day\": 123\n }\n },\n \"mail\": {\n \"same_as_billing\": true,\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123123,
"ref_id": "SCXXxxXxxxxxXXXx",
"amount": 49.95,
"currency": "USD",
"currency_symbol": "$",
"frequency": "once",
"fundraiser_id": 1,
"parent_id": null,
"fundraiser_page_id": null,
"fundraiser_team_id": null,
"organization_id": 1,
"fundraiser_name": "Gala Night",
"organization_name": "Crowdchange",
"organization_code": "CrowdchangeID",
"user_id": 120120,
"email": "john@example.com",
"mail": null,
"statement_descriptor": "XXX*CC XXX",
"summary": {
"amount_covered_fee": 1.95,
"amount_custom_fee": 0,
"amount_donation": 48,
"amount_apparel": 0,
"amount_ticket": 0,
"amount_registration": 0,
"amount_sponsor": 0,
"amount_cards": 0,
"frequency": "once"
},
"upsell": null,
"promo_code": null,
"billing_address": {
"name": "Mr. John Snow",
"email": "john@example.com",
"business_name": null,
"title": "Mr.",
"first_name": "John",
"last_name": "Snow",
"address": "123 Main St",
"city": "Toronto",
"state": "ON",
"zip": "M5V2T6",
"country": "CA",
"phone": null
},
"dtd": null,
"created_at": "2024-01-01 12:00:00",
"status": "received"
}
Corps
number
requis
Montant total de la transaction au format xxx.xx.
string
requis
Fréquence de paiement. Valeurs permises :
once, month, yearstring
Courriel de l’utilisateur.
integer
requis
ID de la campagne.
object
requis
object
requis
Informations de facturation.
Afficher propriétés
Afficher propriétés
boolean
Indique si le paiement est effectué au nom d’une fondation.
string
Titre de civilité. Par exemple, M. / Mlle / Mme.
string
Nom de l’entreprise
string
requis
Prénom.
string
requis
Nom de famille.
string
requis
Adresse municipale.
string
requis
Ville.
string
requis
État ou province, en deux lettres.
string
requis
Code postal.
string
requis
Code de pays ISO 3166-1 alpha-2.
object
Données supplémentaires de la transaction.
object
Informations pour un reçu fiscal émis au nom d’une autre personne.
object
Informations pour un reçu fiscal émis au nom d’une autre personne.
Afficher propriétés
Afficher propriétés
integer
ID de l’hommage.
string
Type d’hommage. Valeurs permises :
in_honor, in_memory, donationstring
Personne honorée.
string
Message.
string
Méthode de livraison. Valeurs permises :
mail, email, smsobject
string
Courriel.
string
Numéro de téléphone.
string
Nom.
boolean
Envoyer une copie au donateur.
object
Informations supplémentaires.
Afficher propriétés
Afficher propriétés
boolean
Envoyer le reçu par la poste
integer
ID de l’énoncé d’impact.
object
Paiement à versements fixes. Lorsqu’activée, cette option répartit le don total en versements mensuels égaux. Nécessite que
frequency soit once, que la campagne ait les paiements à versements activés, et un processeur de paiement compatible avec les paiements récurrents (Stripe ou Paysafe). Le premier versement est débité immédiatement; les suivants sont débités le day choisi de chaque mois subséquent. Le champ amount de la requête est ignoré et remplacé côté serveur par total_amount / duration.Afficher propriétés
Afficher propriétés
number
Montant total du don à répartir sur l’ensemble des versements, au format
xxx.xx. Chaque versement est de total_amount / duration (arrondi à 2 décimales).integer
Nombre de versements mensuels. Doit correspondre à l’une des durées configurées sur la campagne (par défaut
3, 6 ou 12).integer
Jour du mois où chaque versement est débité après le premier paiement. Doit correspondre à l’un des jours configurés sur la campagne (par défaut
1 ou 15).object
Réponse
integer
ID de la transaction.
string
ID de référence ou de confirmation du processeur de paiement.
number
Montant total de la transaction.
string
Code de devise.
string
Symbole de devise.
string
Fréquence de paiement. Valeurs permises :
once, month, yearinteger
ID de la campagne.
integer
ID de la transaction parente pour les paiements récurrents ou à versements, sinon
null.integer
ID de la page personnelle à laquelle la transaction est attribuée, le cas échéant.
integer
ID de l’équipe à laquelle la transaction est attribuée, le cas échéant.
integer
ID de l’organisation.
string
Nom de la campagne.
string
Nom de l’organisation.
string
ID personnalisé de l’organisation.
integer
ID de l’utilisateur.
string
Courriel de contact du donateur.
object
string
Descripteur qui apparaît sur le relevé de carte du donateur.
object
Répartition du montant de la transaction par catégorie.
Afficher propriétés
Afficher propriétés
number
Frais de traitement assumés par le donateur.
number
Frais personnalisés appliqués à la transaction.
number
Montant du don.
number
Montant dépensé en vêtements.
number
Montant dépensé en billets.
number
Montant dépensé en inscription.
number
Montant dépensé en commandites.
number
Montant dépensé en cartes électroniques.
string
Fréquence de paiement. Valeurs permises :
once, month, yearobject
Détails de la proposition de don récurrent, lorsqu’une telle proposition a été présentée. Sinon
null.string
Code promotionnel appliqué à la transaction, le cas échéant.
object
Détails de facturation de la transaction.
Afficher propriétés
Afficher propriétés
object
string
Date et heure de création de la transaction.
string
Statut de la transaction.
| Statut | Description |
|---|---|
400 | Requête invalide |
403 | Interdit |
{
"id": 123123,
"ref_id": "SCXXxxXxxxxxXXXx",
"amount": 49.95,
"currency": "USD",
"currency_symbol": "$",
"frequency": "once",
"fundraiser_id": 1,
"parent_id": null,
"fundraiser_page_id": null,
"fundraiser_team_id": null,
"organization_id": 1,
"fundraiser_name": "Gala Night",
"organization_name": "Crowdchange",
"organization_code": "CrowdchangeID",
"user_id": 120120,
"email": "john@example.com",
"mail": null,
"statement_descriptor": "XXX*CC XXX",
"summary": {
"amount_covered_fee": 1.95,
"amount_custom_fee": 0,
"amount_donation": 48,
"amount_apparel": 0,
"amount_ticket": 0,
"amount_registration": 0,
"amount_sponsor": 0,
"amount_cards": 0,
"frequency": "once"
},
"upsell": null,
"promo_code": null,
"billing_address": {
"name": "Mr. John Snow",
"email": "john@example.com",
"business_name": null,
"title": "Mr.",
"first_name": "John",
"last_name": "Snow",
"address": "123 Main St",
"city": "Toronto",
"state": "ON",
"zip": "M5V2T6",
"country": "CA",
"phone": null
},
"dtd": null,
"created_at": "2024-01-01 12:00:00",
"status": "received"
}
Cette page vous a-t-elle été utile ?
⌘I