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

# Bill payment object

Bill payments represent payments made by a business to vendors.
Payments may be made at any time and applied to one or more outstanding (received, but not fully paid) bills.

### Attributes

<ParamField body="id" required="true" type="string">
  Unique identifier for the payment.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the bill payment in your system for linking and idempotency.
</ParamField>

<ParamField body="at" required="true" type="ISO8601 timestamp">
  Timestamp when the payment was completed.
</ParamField>

<ParamField body="method" required="true" type="enum">
  Payment method. Possible values are: `CASH`, `CHECK`, `CREDIT_CARD`, `ACH`, `CREDIT_BALANCE`, `OTHER`
</ParamField>

<ParamField body="amount" required="true" type="integer">
  Payment amount, in cents.
</ParamField>

<ParamField body="processor" type="string">
  Processor used to make the payment, if any.
  Any processor name can be provided and will be tracked.
</ParamField>

<ParamField body="imported_at" required="true" type="ISO8601 timestamp">
  Timestamp when the payment was imported into Layer.
</ParamField>

<ParamField body="allocations" required="true" type="array of BillPaymentAllocation objects">
  Bill allocations allow specifying a payment to be for multiple bills.
  Most commonly the full payment will be allocated to a single bill, but any number of allocations are allowed.
  The sum of all allocations must be equal to the payment amount.

  <Expandable title="BillPaymentAllocation properties">
    <ResponseField name="id" type="string" required="true">
      Unique identifier for the allocation.
    </ResponseField>

    <ResponseField name="bill_id" type="string" required="true">
      ID of a bill to which this payment is applied.
    </ResponseField>

    <ResponseField name="payment_id" type="string" required="true">
      ID of the payment this allocation applies from.
    </ResponseField>

    <ResponseField name="amount" required="true" type="integer">
      Payment amount allocated to this bill, in cents.
    </ResponseField>

    <ResponseField name="transaction_tags" type="Array of Tags">
      Transaction tags refer to tags associated with this bill payment allocation.

      <Expandable title="Tag properties">
        <ResponseField name="id" required="true" type="string">
          Unique identifier for the tag
        </ResponseField>

        <ResponseField name="key" required="true" type="string">
          The tag's key
        </ResponseField>

        <ResponseField name="value" required="true" type="string">
          The tag's value
        </ResponseField>

        <ResponseField name="dimension_display_name" type="string">
          Display name for the tag dimension
        </ResponseField>

        <ResponseField name="value_display_name" type="string">
          Display name for the tag value
        </ResponseField>

        <ResponseField name="dimension_id" required="true" type="string">
          ID of the tag dimension
        </ResponseField>

        <ResponseField name="definition_id" required="true" type="string">
          ID of the tag value definition
        </ResponseField>

        <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
          When the tag was created
        </ResponseField>

        <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
          When the tag was last updated
        </ResponseField>

        <ResponseField name="deleted_at" type="ISO8601 timestamp">
          When the tag was deleted
        </ResponseField>

        <ResponseField name="archived_at" type="ISO8601 timestamp">
          When the tag was archived
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="transaction_tags" required="true" name="transaction_tags" type="Array of Tags" type="array of Tag objects">
  Transaction tags refer to tags associated with this bill.

  <Expandable title="Tag properties">
    <ResponseField name="id" required="true" type="string">
      Unique identifier for the tag
    </ResponseField>

    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="dimension_display_name" type="string">
      Display name for the tag dimension
    </ResponseField>

    <ResponseField name="value_display_name" type="string">
      Display name for the tag value
    </ResponseField>

    <ResponseField name="dimension_id" required="true" type="string">
      ID of the tag dimension
    </ResponseField>

    <ResponseField name="definition_id" required="true" type="string">
      ID of the tag value definition
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>

    <ResponseField name="archived_at" type="ISO8601 timestamp">
      When the tag was archived
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="memo" type="string">
  Memo for any text you would like to associate with the bill payment (for example, to display to end users).
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary custom metadata in JSON format with a size limit of 1KB.
</ParamField>

<ParamField body="reference_number" type="string">
  Any (typically user-visible) identifier you would like to associate with the bill payment. Can be used to filter when listing bill payments.
</ParamField>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "id": "590ed436-c2bd-4e39-8047-f913a852f99c",
      "external_id": "bill-payment-1",
      "at": "2024-06-15T00:00:00Z",
      "method": "ACH",
      "amount": 10000,
      "processor": "BANK_TRANSFER",
      "imported_at": "2024-06-15T18:11:57.339076Z",
      "allocations": [
        {
          "id": "8901-abcd-ef23-4567",
          "bill_id": "b745c116-cd28-41a1-b4ea-84a2768b6e14",
          "payment_id": "590ed436-c2bd-4e39-8047-f913a852f99c",
          "amount": 10000,
          "transaction_tags": [
            {
              "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
              "key": "department",
              "value": "sales",
              "dimension_display_name": "Department",
              "value_display_name": "Sales Team",
              "dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
              "definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
              "created_at": "2024-02-27T02:16:40.389772Z",
              "updated_at": "2024-02-27T02:16:40.389772Z",
              "deleted_at": null,
              "archived_at": null
            }
          ]
        }
      ],
      "transaction_tags": [
        {
          "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "key": "department",
          "value": "sales",
          "dimension_display_name": "Department",
          "value_display_name": "Sales Team",
          "dimension_id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
          "definition_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
          "created_at": "2024-02-27T02:16:40.389772Z",
          "updated_at": "2024-02-27T02:16:40.389772Z",
          "deleted_at": null,
          "archived_at": null
        }
      ]
    }
  }
  ```
</ResponseExample>
