Creates a new disbursement in draft state with basic details. Important: a disbursement is not triggered until the organization adds receivers through the Upload Disbursement Instructions endpoint and the status changes from draft to ready .
Create Disbursement
curl --request POST \
--url https://api.example.com/disbursements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: */*' \
--data '{
"name": "My New Disbursement name",
"wallet_id": "e2de8544-b7e2-40a9-ad40-411f70d5c4bf",
"asset_id": "d227a68c-2f40-11ee-be56-0242ac120002",
"verification_field": "DATE_OF_BIRTH",
"registration_contact_type": "PHONE_NUMBER",
"receiver_registration_message_template": "You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register."
}'
import requests
url = "https://api.example.com/disbursements"
payload = "{\n \"name\": \"My New Disbursement name\",\n \"wallet_id\": \"e2de8544-b7e2-40a9-ad40-411f70d5c4bf\",\n \"asset_id\": \"d227a68c-2f40-11ee-be56-0242ac120002\",\n \"verification_field\": \"DATE_OF_BIRTH\",\n \"registration_contact_type\": \"PHONE_NUMBER\",\n \"receiver_registration_message_template\": \"You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register.\"\n}"
headers = {
"Authorization": "<api-key>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': '*/*'},
body: '{\n "name": "My New Disbursement name",\n "wallet_id": "e2de8544-b7e2-40a9-ad40-411f70d5c4bf",\n "asset_id": "d227a68c-2f40-11ee-be56-0242ac120002",\n "verification_field": "DATE_OF_BIRTH",\n "registration_contact_type": "PHONE_NUMBER",\n "receiver_registration_message_template": "You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register."\n}'
};
fetch('https://api.example.com/disbursements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
Names the distribution account this request acts on. Required when the tenant has more than one active account. With a single active account, or an API key scoped to exactly one account, it may be omitted.
The custom template used to send invitations to receivers. The default message isn't returned. In the message's content it's possible to add the following template variables: {{.OrganizationName}} which is the Organization Name configured and {{.RegistrationLink}} which is the link generated by SDP to send to the receiver (in case this is not present in the message, it's automatically appended at the end).
Example:
"You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register."
curl --request POST \
--url https://api.example.com/disbursements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: */*' \
--data '{
"name": "My New Disbursement name",
"wallet_id": "e2de8544-b7e2-40a9-ad40-411f70d5c4bf",
"asset_id": "d227a68c-2f40-11ee-be56-0242ac120002",
"verification_field": "DATE_OF_BIRTH",
"registration_contact_type": "PHONE_NUMBER",
"receiver_registration_message_template": "You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register."
}'
import requests
url = "https://api.example.com/disbursements"
payload = "{\n \"name\": \"My New Disbursement name\",\n \"wallet_id\": \"e2de8544-b7e2-40a9-ad40-411f70d5c4bf\",\n \"asset_id\": \"d227a68c-2f40-11ee-be56-0242ac120002\",\n \"verification_field\": \"DATE_OF_BIRTH\",\n \"registration_contact_type\": \"PHONE_NUMBER\",\n \"receiver_registration_message_template\": \"You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register.\"\n}"
headers = {
"Authorization": "<api-key>",
"Content-Type": "*/*"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': '*/*'},
body: '{\n "name": "My New Disbursement name",\n "wallet_id": "e2de8544-b7e2-40a9-ad40-411f70d5c4bf",\n "asset_id": "d227a68c-2f40-11ee-be56-0242ac120002",\n "verification_field": "DATE_OF_BIRTH",\n "registration_contact_type": "PHONE_NUMBER",\n "receiver_registration_message_template": "You have a payment waiting for you from {{.OrganizationName}}. Click {{.RegistrationLink}} to register."\n}'
};
fetch('https://api.example.com/disbursements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));