> ## Documentation Index
> Fetch the complete documentation index at: https://developers.dwolla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml post /labels/{id}/ledger-entries
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /labels/{id}/ledger-entries:
    post:
      tags:
        - labels
      summary: Create a label ledger entry
      description: >-
        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.
      operationId: createLabelLedgerEntry
      parameters:
        - name: id
          in: path
          description: The Id of the Label to update.
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Accept'
      requestBody:
        required: true
        description: Parameters to create a label ledger entry
        content:
          application/json:
            schema:
              required:
                - amount
              type: object
              properties:
                amount:
                  type: object
                  required:
                    - value
                    - currency
                  properties:
                    value:
                      type: string
                      description: >-
                        Amount of funds to increase or decrease for a Label. To
                        decrease funds in a Label a string numeric value will be
                        supplied and prepended with a "-" operator.
                      example: '-5.00'
                    currency:
                      type: string
                      description: Currency code for the amount
                      example: USD
      responses:
        '201':
          description: created
          headers:
            Location:
              $ref: '#/components/headers/Location'
        '400':
          description: Bad request
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '403':
          description: Forbidden
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Not found
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      x-codeSamples:
        - lang: bash
          source: >
            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"
             }
            }
        - lang: javascript
          source: |
            // 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'
        - lang: python
          source: >
            # 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'
        - lang: php
          source: >
            <?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"

            ?>
        - lang: ruby
          source: >
            # 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"
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  headers:
    Location:
      description: The location of the created resource
      schema:
        type: string
  schemas:
    BadRequestError:
      title: BadRequestError
      description: Error response schema for 400 Bad Request
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: BadRequest
        message:
          type: string
          example: The request body contains bad syntax or is incomplete.
    ForbiddenError:
      title: ForbiddenError
      description: Error response schema for 403 Forbidden
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: Forbidden
        message:
          type: string
          example: The supplied credentials are not authorized for this resource.
    NotFoundError:
      title: NotFoundError
      description: Error response schema for 404 NotFound
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: NotFound
        message:
          type: string
          example: The requested resource was not found.
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````