Créer une transaction hors ligne
curl --request POST \
--url https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"amount": 123,
"fundraiser_id": 123,
"fundraiser_team_id": 123,
"fundraiser_page_id": 123,
"email": "<string>",
"business_name": "<string>",
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation"
payload = {
"token": "<string>",
"amount": 123,
"fundraiser_id": 123,
"fundraiser_team_id": 123,
"fundraiser_page_id": 123,
"email": "<string>",
"business_name": "<string>",
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"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({
token: '<string>',
amount: 123,
fundraiser_id: 123,
fundraiser_team_id: 123,
fundraiser_page_id: 123,
email: '<string>',
business_name: '<string>',
billing: {
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
})
};
fetch('https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation', 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/private/user/fundraiser/{id}/offline-donation",
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([
'token' => '<string>',
'amount' => 123,
'fundraiser_id' => 123,
'fundraiser_team_id' => 123,
'fundraiser_page_id' => 123,
'email' => '<string>',
'business_name' => '<string>',
'billing' => [
'first_name' => '<string>',
'last_name' => '<string>',
'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/private/user/fundraiser/{id}/offline-donation"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}")
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/private/user/fundraiser/{id}/offline-donation")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation")
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 \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}"
response = http.request(request)
puts response.read_body{
"id": 123123,
"user_id": 120120,
"email": "john@example.com",
"amount": 49.95,
"currency": "USD",
"fundraiser_id": 1,
"fundraiser_team_id": 1,
"fundraiser_page_id": 1
}
API spécifiques à l'utilisateur
Créer une transaction hors ligne
Enregistrez une transaction de don hors ligne au nom de l’utilisateur authentifié pour une campagne CrowdChange, avec montant et coordonnées du donateur.
POST
/
v2
/
private
/
user
/
fundraiser
/
{id}
/
offline-donation
Créer une transaction hors ligne
curl --request POST \
--url https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"amount": 123,
"fundraiser_id": 123,
"fundraiser_team_id": 123,
"fundraiser_page_id": 123,
"email": "<string>",
"business_name": "<string>",
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation"
payload = {
"token": "<string>",
"amount": 123,
"fundraiser_id": 123,
"fundraiser_team_id": 123,
"fundraiser_page_id": 123,
"email": "<string>",
"business_name": "<string>",
"billing": {
"first_name": "<string>",
"last_name": "<string>",
"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({
token: '<string>',
amount: 123,
fundraiser_id: 123,
fundraiser_team_id: 123,
fundraiser_page_id: 123,
email: '<string>',
business_name: '<string>',
billing: {
first_name: '<string>',
last_name: '<string>',
address: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
})
};
fetch('https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation', 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/private/user/fundraiser/{id}/offline-donation",
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([
'token' => '<string>',
'amount' => 123,
'fundraiser_id' => 123,
'fundraiser_team_id' => 123,
'fundraiser_page_id' => 123,
'email' => '<string>',
'business_name' => '<string>',
'billing' => [
'first_name' => '<string>',
'last_name' => '<string>',
'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/private/user/fundraiser/{id}/offline-donation"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}")
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/private/user/fundraiser/{id}/offline-donation")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crowdchange.dev/v2/private/user/fundraiser/{id}/offline-donation")
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 \"token\": \"<string>\",\n \"amount\": 123,\n \"fundraiser_id\": 123,\n \"fundraiser_team_id\": 123,\n \"fundraiser_page_id\": 123,\n \"email\": \"<string>\",\n \"business_name\": \"<string>\",\n \"billing\": {\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}"
response = http.request(request)
puts response.read_body{
"id": 123123,
"user_id": 120120,
"email": "john@example.com",
"amount": 49.95,
"currency": "USD",
"fundraiser_id": 1,
"fundraiser_team_id": 1,
"fundraiser_page_id": 1
}
Paramètres de chemin
integer
requis
ID de la campagne.
Corps
string
requis
Jeton d’accès de l’utilisateur.
number
requis
Montant total de la transaction hors ligne au format xxx.xx.
integer
requis
ID de la campagne.
integer
ID de l’équipe.
integer
ID de la page.
string
Courriel du donateur.
string
Nom de l’entreprise
object
Réponse
integer
ID de la transaction.
integer
ID du donateur.
string
Courriel du donateur.
number
Montant total.
string
Code de devise. Valeurs permises :
CAD, USD, AUD, EURinteger
ID de la campagne.
integer
ID de l’équipe.
integer
ID de la page.
| Status | Description |
|---|---|
400 | Bad Request |
403 | Forbidden |
{
"id": 123123,
"user_id": 120120,
"email": "john@example.com",
"amount": 49.95,
"currency": "USD",
"fundraiser_id": 1,
"fundraiser_team_id": 1,
"fundraiser_page_id": 1
}
Cette page vous a-t-elle été utile ?
⌘I