{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/donations","auth":"required","examples":{"codes":[{"language":"php","code":"<?php\n\n$client = new GuzzleHttp\\Client();\n\ntry {\n\n  //if using Guzzle 6+ change \"body\" to \"form_params\"\n  $response = $client->post('https://streamlabs.com/api/v1.0/donations', [\n    'body' => [\n      'access_token' \t=> 'ACCESS_TOKEN_HERE',\n      'name' => 'Thomas',\n      'identifier' => 'thomas:::at:::gmail.com',\n      'amount' => 50,\n      'currency' => 'USD',\n      'message' => 'nice!'\n    ]\n\t]);\n\n  $result = $response->json();\n\n} catch (Exception $e) {\n\n  //failed\n  $result = $e->getResponse()->json();\n\n}"}]},"method":"post","params":[{"name":"name","type":"string","default":"","desc":"The name of the donor","required":true,"in":"body","ref":"","_id":"55bef01dad601c2b00762bee"},{"name":"message","type":"string","default":"","desc":"The message from the donor","required":false,"in":"body","ref":"","_id":"55bef01dad601c2b00762bed"},{"name":"identifier","type":"string","default":"","desc":"An identifier for this donor, which is used to group donations with the same donor. For example, if you create more than one donation with the same identifier, they will be grouped together as if they came from the same donor. Typically this is best suited as an email address, or a unique hash.","required":true,"in":"body","ref":"","_id":"55bef01dad601c2b00762bec"},{"name":"amount","type":"double","default":"","desc":"The amount of this donation","required":true,"in":"body","ref":"","_id":"55bef01dad601c2b00762beb"},{"name":"currency","type":"string","default":"","desc":"The 3 letter currency code for this donation. Must be one of the [supported currency codes](doc:currency-codes).","required":true,"in":"body","ref":"","_id":"55bef01dad601c2b00762bea"},{"name":"created_at","type":"datetime","default":"","desc":"A timestamp that identifies when this donation was made. If left blank, it will default to now.","required":false,"in":"body","ref":"","_id":"55bef01dad601c2b00762be9"}],"results":{"codes":[{"language":"json","code":"{\n\t\"donation_id\": 1234567\n}","name":"","status":200},{"code":"{\n  \"error\": \"...\",\n  \"message\": \"...\"\n}","name":"","status":400,"language":"json"}]},"settings":""},"next":{"description":"","pages":[]},"title":"/donations","type":"endpoint","slug":"donations-1","excerpt":"Create a donation for the authenticated user.","body":"","updates":["583a02bfb2de6d0f0092b0e7","584d7256cda2b40f00058388","586b0da611dbba0f0033861c","586b0da7d0b0a92500e5e199","586b0dc187b29f1900124d90","586f9fd2379f953700a5a87c","58ab1706aecc3e2500573f09","58cce5ba1a9a972300b2c4d4"],"order":1,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55baf1f6d0736b3100bf102c","__v":11,"category":{"sync":{"isSync":false,"url":""},"pages":["55bad9c03f0767230008f518","55baf1d51b0d66370078166c","55baf1f6d0736b3100bf102c","55bef201ad601c2b00762bf0"],"title":"Donations","slug":"donations","order":3,"from_sync":false,"reference":true,"_id":"55bad8f33f0767230008f517","project":"55baca9cd0736b3100bf1008","version":"55baca9cd0736b3100bf100b","__v":4,"createdAt":"2015-07-31T02:09:55.734Z"},"createdAt":"2015-07-31T03:56:38.175Z","editedParams2":true,"githubsync":"","parentDoc":null,"project":"55baca9cd0736b3100bf1008","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55baca9dd0736b3100bf100c","55bacba0d0736b3100bf1017","55bad8f33f0767230008f517","55baf3f01b0d66370078166e","55baf4151b0d66370078166f","55f1cca35fe76419007dc794","573e2d6e610a090e00ca2b97","58d97ce57718211b0028e6bc","599b510cb683b50031a35299","5a871c493948fd004697e677"],"_id":"55baca9cd0736b3100bf100b","createdAt":"2015-07-31T01:08:44.540Z","project":"55baca9cd0736b3100bf1008","__v":10,"releaseDate":"2015-07-31T01:08:44.540Z"},"editedParams":true,"user":"55baca333f0767230008f4ff"}

post/donations

Create a donation for the authenticated user.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

name:
required
string
The name of the donor
message:
string
The message from the donor
identifier:
required
string
An identifier for this donor, which is used to group donations with the same donor. For example, if you create more than one donation with the same identifier, they will be grouped together as if they came from the same donor. Typically this is best suited as an email address, or a unique hash.
amount:
required
double
The amount of this donation
currency:
required
string
The 3 letter currency code for this donation. Must be one of the [supported currency codes](doc:currency-codes).
created_at:
datetime
A timestamp that identifies when this donation was made. If left blank, it will default to now.

Examples


Result Format