Labels
Create a label ledger entry
Create a new ledger entry to track fund adjustments on a Label by specifying a positive or negative amount value. Returns the location of the created ledger entry in the response header. Label amounts cannot go negative, so validation errors occur if the entry would result in a negative Label balance.
POST
/
labels
/
{id}
/
ledger-entries
cURL
POST https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f/ledger-entries
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY
{
"amount": {
"value": "-5.00",
"currency": "USD"
}
}// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var labelUrl =
"https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f";
var requestBody = {
amount: {
currency: "USD",
value: "-5.00",
},
};
dwolla
.post(`${labelUrl}/ledger-entries`, requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8'
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
label_url = 'https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f'
request_body = {
'amount': {
'currency': 'USD',
'value': '-5.00'
}
}
ledger_entry = app_token.post('%s/ledger-entries' % label_url, request_body)
ledger_entry.headers['location'] # => 'https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8'
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$labelsApi = new DwollaSwagger\LabelsApi($apiClient);
$label = $labelsApi->addLedgerEntry([
'amount' => [
'currency' => 'USD',
'value' => '-5.00'
]
], "https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f");
$label; # => "https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8"
?>
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
label_url = 'https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f'
request_body = {
:amount => {
:currency => "USD",
:value => "-5.00"
}
}
ledger_entry = app_token.post "#{label_url}/ledger-entries", request_body
ledger_entry.response_headers[:location] # => "https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8"
{
"code": "BadRequest",
"message": "The request body contains bad syntax or is incomplete."
}{
"code": "Forbidden",
"message": "The supplied credentials are not authorized for this resource."
}{
"code": "NotFound",
"message": "The requested resource was not found."
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
FlowClient Credentials
- Token URL
- /token
Headers
The media type of the response. Must be application/vnd.dwolla.v1.hal+json
Available options:
application/vnd.dwolla.v1.hal+json Path Parameters
The Id of the Label to update.
Body
application/json
Parameters to create a label ledger entry
Show child attributes
Show child attributes
Response
created
Was this page helpful?
⌘I
cURL
POST https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f/ledger-entries
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY
{
"amount": {
"value": "-5.00",
"currency": "USD"
}
}// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var labelUrl =
"https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f";
var requestBody = {
amount: {
currency: "USD",
value: "-5.00",
},
};
dwolla
.post(`${labelUrl}/ledger-entries`, requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8'
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
label_url = 'https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f'
request_body = {
'amount': {
'currency': 'USD',
'value': '-5.00'
}
}
ledger_entry = app_token.post('%s/ledger-entries' % label_url, request_body)
ledger_entry.headers['location'] # => 'https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8'
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$labelsApi = new DwollaSwagger\LabelsApi($apiClient);
$label = $labelsApi->addLedgerEntry([
'amount' => [
'currency' => 'USD',
'value' => '-5.00'
]
], "https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f");
$label; # => "https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8"
?>
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
label_url = 'https://api-sandbox.dwolla.com/labels/e217bcac-628a-456d-a375-6cc51230616f'
request_body = {
:amount => {
:currency => "USD",
:value => "-5.00"
}
}
ledger_entry = app_token.post "#{label_url}/ledger-entries", request_body
ledger_entry.response_headers[:location] # => "https://api-sandbox.dwolla.com/ledger-entries/76e5541d-18f4-e811-8112-e8dd3bececa8"
{
"code": "BadRequest",
"message": "The request body contains bad syntax or is incomplete."
}{
"code": "Forbidden",
"message": "The supplied credentials are not authorized for this resource."
}{
"code": "NotFound",
"message": "The requested resource was not found."
}