Skip to main content
POST
/
label-reallocations
cURL
POST https://api-sandbox.dwolla.com/label-reallocations
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

{
 "_links":{
   "from": {
     "href": "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
   },
   "to": {
     "href": "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
   }
 },
 "amount": {
   "value": "15.00",
   "currency": "USD"
 }
}
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
_links: {
from: {
href: "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45",
},
to: {
href: "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc",
},
},
amount: {
currency: "USD",
value: "1.00",
},
};

dwolla
.post("label-reallocations", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'_links': {
'from': {
'href': 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45'
},
'to': {
'href': 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
}
},
'amount': {
'currency': 'USD',
'value': '15.00'
}
}

labelReallocation = app_token.post('label-reallocations', request_body)
labelReallocation.headers['location'] # => 'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$labelReallocationsApi = new DwollaSwagger\LabelreallocationsApi($apiClient);

$labelReallocation = $labelReallocationsApi->reallocateLabel([
'_links' => [
'from' => [
'href' => 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45',
],
'to' => [
'href' => 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
]
],
'amount' => [
'currency' => 'USD',
'value' => '15.00'
]
]);
$labelReallocation; # => "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"
?>
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
request_body = {
:_links => {
:from => {
:href => "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
},
:to => {
:href => "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
}
},
:amount => {
:currency => "USD",
:value => "15.00"
}
}

labelReallocation = app_token.post "label-reallocations", request_body
labelReallocation.response_headers[:location] # => "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"
{
  "code": "BadRequest",
  "message": "The request body contains bad syntax or is incomplete."
}
{
"code": "Forbidden",
"message": "Not authorized to create label reallocation"
}
{
"code": "NotFound",
"message": "Label not found"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

Accept
enum<string>
default:application/vnd.dwolla.v1.hal+json
required

The media type of the response. Must be application/vnd.dwolla.v1.hal+json

Available options:
application/vnd.dwolla.v1.hal+json

Body

application/json

Parameters to create a label reallocation

amount
object
required

Response

created