This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Create bill

POST https://api-sandbox.payabli.com/api/Bill/single/{entry}
Content-Type: application/json

Creates a bill in an entrypoint.

Reference: https://docs.payabli.com/developers/api-reference/bill/add-bill

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi
  version: 1.0.0
paths:
  /Bill/single/{entry}:
    post:
      operationId: add-bill
      summary: Add bill
      description: Creates a bill in an entrypoint.
      tags:
        - subpackage_bill
      parameters:
        - name: entry
          in: path
          description: >-
            The paypoint's entrypoint identifier. [Learn
            more](/developers/api-reference/api-overview#entrypoint-vs-entry)
          required: true
          schema:
            type: string
        - name: requestToken
          in: header
          required: true
          schema:
            type: string
        - name: idempotencyKey
          in: header
          required: false
          schema:
            $ref: '#/components/schemas/type_:IdempotencyKey'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_bill:BillResponse'
        '400':
          description: Bad request/ invalid data
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal API Error
          content:
            application/json:
              schema:
                description: Any type
        '503':
          description: Database connection error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:PayabliApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_bill:BillOutData'
servers:
  - url: https://api-sandbox.payabli.com/api
  - url: https://api.payabli.com/api
components:
  schemas:
    type_:IdempotencyKey:
      type: string
      description: >-
        _Optional but recommended_ A unique ID that you can include to prevent
        duplicating objects or transactions in the case that a request is sent
        more than once. This key isn't generated in Payabli, you must generate
        it yourself. This key persists for 2 minutes. After 2 minutes, you can
        reuse the key if needed.
      title: IdempotencyKey
    type_:AccountingField:
      type: string
      description: Optional custom field.
      title: AccountingField
    type_:AdditionalDataString:
      type: string
      description: >-
        Custom dictionary of key:value pairs. You can use this field to store
        any data related to the object or for your system. Example usage: 


        ```json

        {
          "additionalData": {
            "key1": "value1",
            "key2": "value2",
            "key3": "value3"
          }
        }

        ```
      title: AdditionalDataString
    type_:FileContentFtype:
      type: string
      enum:
        - pdf
        - doc
        - docx
        - jpg
        - jpeg
        - png
        - gif
        - txt
      description: The MIME type of the file (if content is provided)
      title: FileContentFtype
    type_:FileContent:
      type: object
      properties:
        fContent:
          type: string
          description: >-
            Content of file, Base64-encoded. Ignored if furl is specified. Max
            upload size is 30 MB.
        filename:
          type: string
          description: The name of the attached file.
        ftype:
          $ref: '#/components/schemas/type_:FileContentFtype'
          description: The MIME type of the file (if content is provided)
        furl:
          type: string
          description: Optional URL provided to show or download the file remotely
      description: Contains details about a file. Max upload size is 30 MB.
      title: FileContent
    type_:Attachments:
      type: array
      items:
        $ref: '#/components/schemas/type_:FileContent'
      description: >-
        Array of `fileContent` objects with attached documents. Max upload size
        is 30 MB.
      title: Attachments
    type_:ItemCommodityCode:
      type: string
      description: Item or product commodity code. Max length of 250 characters.
      title: ItemCommodityCode
    type_:ItemDescription:
      type: string
      description: Item or product description. Max length of 250 characters.
      title: ItemDescription
    type_:ItemProductCode:
      type: string
      description: Item or product code. Max length of 250 characters.
      title: ItemProductCode
    type_:ItemProductName:
      type: string
      description: Item or product name. Max length of 250 characters.
      title: ItemProductName
    type_:ItemUnitofMeasure:
      type: string
      description: Unit of measurement. Max length of 100 characters.
      title: ItemUnitofMeasure
    type_:BillItem:
      type: object
      properties:
        itemCategories:
          type: array
          items:
            type: string
          description: Array of tags classifying item or product.
        itemCommodityCode:
          $ref: '#/components/schemas/type_:ItemCommodityCode'
        itemCost:
          type: number
          format: double
          description: Item or product price per unit.
        itemDescription:
          $ref: '#/components/schemas/type_:ItemDescription'
        itemMode:
          type: integer
          description: >-
            Internal class of item or product: value '0' is only for invoices ,
            '1' for bills and, '2' common for both.
        itemProductCode:
          $ref: '#/components/schemas/type_:ItemProductCode'
        itemProductName:
          $ref: '#/components/schemas/type_:ItemProductName'
        itemQty:
          type: integer
          description: Quantity of item or product.
        itemTaxAmount:
          type: number
          format: double
          description: Tax amount applied to item or product.
        itemTaxRate:
          type: number
          format: double
          description: Tax rate applied to item or product.
        itemTotalAmount:
          type: number
          format: double
          description: Total amount in item or product.
        itemUnitOfMeasure:
          $ref: '#/components/schemas/type_:ItemUnitofMeasure'
      required:
        - itemCost
      title: BillItem
    type_:Billitems:
      type: array
      items:
        $ref: '#/components/schemas/type_:BillItem'
      description: Array of `LineItems` contained in bill.
      title: Billitems
    type_:Comments:
      type: string
      description: Any comment or description.
      title: Comments
    type_:Frequency:
      type: string
      enum:
        - onetime
        - weekly
        - every2weeks
        - every6months
        - monthly
        - every3months
        - annually
      description: Frequency for operation.
      title: Frequency
    type_bill:BillOutDataScheduledOptions:
      type: object
      properties:
        storedMethodId:
          type: string
          description: The ID of the stored payment method to use for the bill.
      title: BillOutDataScheduledOptions
    type_:Billstatus:
      type: integer
      description: |-

        The bill's status. Values are: 

        - `-99`: deleted or canceled
        - `1`: Active
        - `2`: Sent to approval
        - `5`: Partially approved
        - `11`: Rejected
        - `20`: Approved
        - `50`: Payment in transit
        - `100`: Paid "
      title: Billstatus
    type_:Terms:
      type: string
      description: >-
        Payment terms for invoice. If no terms are defined, then response data
        for this field defaults to `NET30`.


        **Available Values:**


        - `PIA`: Payment in advance


        - `CIA`: Cash in advance


        - `UR`: Upon receipt


        - `NET10`: 10 days after invoice date


        - `NET20`: 20 days after invoice date


        - `NET30`: 30 days after invoice date


        - `NET45`: 45 days after invoice date


        - `NET60`: 60 days after invoice date


        - `NET90`: 90 days after invoice date


        - `EOM`: Due end of this month


        - `MFI`: 1st of the month following the invoice date


        - `5MFI`: 5th of the month following the invoice date


        - `10MFI`: 10th of the month following the invoice date


        - `15MFI`: 15th of the month following the invoice date


        - `20MFI`: 20th of the month following the invoice date


        - `2/10NET30`: 2% discount if paid within 10 days, otherwise net 30 days


        - `UF`: Until further notice


        - `10UF`: 10 days until further notice


        - `20UF`: 20 days until further notice


        - `25UF`: 25 days until further notice


        - `50UF`: 50 days until further notice
      title: Terms
    type_:VendorNumber:
      type: string
      description: >-
        Custom number identifying the vendor. Must be unique in paypoint. Can't
        be blank.
      title: VendorNumber
    type_:AdditionalData:
      type: object
      additionalProperties:
        type: object
        additionalProperties:
          description: Any type
      description: >-
        Custom dictionary of key:value pairs. You can use this field to store
        any data related to the object or for your system. If you are using
        [custom identifiers](/developers/developer-guides/entities-customers),
        pass those in this object. Max length for a value is 100 characters.
        Example usage: 


        ```json

        {
          "additionalData": {
            "key1": "value1",
            "key2": "value2",
            "key3": "value3"
          }
        }

        ```
      title: AdditionalData
    type_:AddressNullable:
      type: string
      description: The address.
      title: AddressNullable
    type_:AddressAddtlNullable:
      type: string
      description: Additional line for the address.
      title: AddressAddtlNullable
    type_:BankAccountHolderName:
      type: string
      description: The accountholder's name.
      title: BankAccountHolderName
    type_:BankAccountHolderType:
      type: string
      enum:
        - Personal
        - Business
      description: Describes whether the bank is a personal or business account.
      title: BankAccountHolderType
    type_:BankName:
      type: string
      description: Name of bank for account.
      title: BankName
    type_:RoutingAccount:
      type: string
      description: Routing number of bank account.
      title: RoutingAccount
    type_:TypeAccount:
      type: string
      enum:
        - Checking
        - Savings
      description: 'Type of bank account: Checking or Savings.'
      title: TypeAccount
    type_:BillingData:
      type: object
      properties:
        accountNumber:
          type: string
          description: Account number for bank account.
        bankAccountFunction:
          type: integer
          description: >-
            Describes whether the bank account is used for deposits or
            withdrawals in Payabli:
              - `0`: Deposit
              - `1`: Withdrawal 
              - `2`: Deposit and withdrawal
        bankAccountHolderName:
          $ref: '#/components/schemas/type_:BankAccountHolderName'
        bankAccountHolderType:
          $ref: '#/components/schemas/type_:BankAccountHolderType'
        bankName:
          $ref: '#/components/schemas/type_:BankName'
        id:
          type: integer
          description: The bank's ID in Payabli.
        routingAccount:
          $ref: '#/components/schemas/type_:RoutingAccount'
        typeAccount:
          $ref: '#/components/schemas/type_:TypeAccount'
      title: BillingData
    type_:Email:
      type: string
      format: email
      description: Email address.
      title: Email
    type_:Contacts:
      type: object
      properties:
        contactEmail:
          $ref: '#/components/schemas/type_:Email'
          description: Contact email address.
        contactName:
          type: string
          description: Contact name.
        contactPhone:
          type: string
          description: Contact phone number.
        contactTitle:
          type: string
          description: Contact title.
        additionalData:
          $ref: '#/components/schemas/type_:AdditionalDataString'
      title: Contacts
    type_:ContactsField:
      type: array
      items:
        $ref: '#/components/schemas/type_:Contacts'
      description: List of contacts.
      title: ContactsField
    type_:VendorEin:
      type: string
      description: >-
        EIN/Tax ID for vendor. Must be nine digits formatted as `XX-XXXXXXX`
        (for example, `12-3456789`).
      title: VendorEin
    type_:LocationCode:
      type: string
      description: A location code used to identify the vendor's location.
      title: LocationCode
    type_:Mcc:
      type: string
      description: >-
        Business Merchant Category Code (MCC). [This
        resource](https://github.com/greggles/mcc-codes/blob/main/mcc_codes.csv)
        lists MCC codes.
      title: Mcc
    type_:VendorName1:
      type: string
      description: >-
        Primary name for vendor. Required for new vendor. Allowed characters are
        letters, numbers, spaces, and the following symbols `. , ' & ( )
      title: VendorName1
    type_:VendorName2:
      type: string
      description: >-
        Secondary name for vendor. If provided, allowed characters are the same
        as the `name1` field. Letters, numbers, spaces, and `. , ' & ( )
      title: VendorName2
    type_:PayeeName:
      type: string
      description: Alternative name used to receive paper check.
      title: PayeeName
    type_:VendorPaymentMethodString:
      type: string
      description: |-
        The vendor's preferred payment method. Can be one of:
        - `"managed"` - Managed payment method
        - `"vcard"` - Virtual card payment method
        - `"check"` - Check payment method
        - `"ach"` - ACH payment method
      title: VendorPaymentMethodString
    type_:VendorPhone:
      type: string
      description: >-
        Vendor's phone number. Phone number can't contain non-digit characters
        like hyphens or parentheses.
      title: VendorPhone
    type_:Remitaddress1:
      type: string
      description: >-
        Remittance street address. Used for mailing paper checks. Required if
        any remittance address field is provided. Allowed characters are
        letters, numbers, spaces, and `. ,
      title: Remitaddress1
    type_:Remitaddress2:
      type: string
      description: >-
        Remittance address additional line, such as a suite or unit number. Used
        for mailing paper checks. Always optional.
      title: Remitaddress2
    type_:Remitcity:
      type: string
      description: >-
        Remittance address city. Used for mailing paper checks. Required if any
        remittance address field is provided.
      title: Remitcity
    type_:Remitcountry:
      type: string
      description: >-
        Remittance address country. Used for mailing paper checks. Must be `US`
        or `CA`. Defaults to `US` if not provided.
      title: Remitcountry
    type_:RemitEmail:
      type: string
      format: email
      description: >-
        Remittance email address. Used for sending virtual cards and other
        information about payouts.
      title: RemitEmail
    type_:Remitstate:
      type: string
      description: >-
        Remittance address state or province. Used for mailing paper checks.
        Required if any remittance address field is provided. Must be a valid US
        state or Canadian province abbreviation.
      title: Remitstate
    type_:Remitzip:
      type: string
      description: >-
        Remittance address ZIP or postal code. Used for mailing paper checks.
        Required if any remittance address field is provided. For US addresses,
        use five digits or ZIP+4 format.
      title: Remitzip
    type_:Vendorstatus:
      type: integer
      description: |-
        Vendor's status.
        Allowed values:

          - `0` Inactive

          - `1` Active

          - `-99` Deleted
      title: Vendorstatus
    type_:VendorData:
      type: object
      properties:
        vendorNumber:
          $ref: '#/components/schemas/type_:VendorNumber'
        AdditionalData:
          $ref: '#/components/schemas/type_:AdditionalData'
        address1:
          $ref: '#/components/schemas/type_:AddressNullable'
          description: >-
            Vendor's street address. If any address field is provided, this
            field is required along with `city`, `state`, and `zip`. Allowed
            characters are letters, numbers, spaces, and `. ,
        address2:
          $ref: '#/components/schemas/type_:AddressAddtlNullable'
          description: >-
            Additional line for vendor's address, such as a suite or unit
            number. Always optional.
        billingData:
          $ref: '#/components/schemas/type_:BillingData'
          description: Object containing vendor's bank information.
        city:
          type: string
          description: Vendor's city. Required if any address field is provided.
        contacts:
          $ref: '#/components/schemas/type_:ContactsField'
          description: Array of objects describing the vendor's contacts.
        country:
          type: string
          description: >-
            Vendor's country. Must be `US` or `CA`. Defaults to `US` if not
            provided.
        customField1:
          type: string
          description: Custom field 1 for vendor
        customField2:
          type: string
          description: Custom field 2 for vendor
        customerVendorAccount:
          type: string
          description: Account number of paypoint in the vendor side.
        ein:
          $ref: '#/components/schemas/type_:VendorEin'
        email:
          $ref: '#/components/schemas/type_:Email'
          description: Vendor's email address. Required for vCard.
        internalReferenceId:
          type: integer
          format: int64
          description: Internal identifier for global vendor account.
        locationCode:
          $ref: '#/components/schemas/type_:LocationCode'
        mcc:
          $ref: '#/components/schemas/type_:Mcc'
        name1:
          $ref: '#/components/schemas/type_:VendorName1'
        name2:
          $ref: '#/components/schemas/type_:VendorName2'
        payeeName1:
          $ref: '#/components/schemas/type_:PayeeName'
        payeeName2:
          $ref: '#/components/schemas/type_:PayeeName'
        paymentMethod:
          $ref: '#/components/schemas/type_:VendorPaymentMethodString'
        phone:
          $ref: '#/components/schemas/type_:VendorPhone'
        remitAddress1:
          $ref: '#/components/schemas/type_:Remitaddress1'
        remitAddress2:
          $ref: '#/components/schemas/type_:Remitaddress2'
        remitCity:
          $ref: '#/components/schemas/type_:Remitcity'
        remitCountry:
          $ref: '#/components/schemas/type_:Remitcountry'
        remitEmail:
          $ref: '#/components/schemas/type_:RemitEmail'
        remitState:
          $ref: '#/components/schemas/type_:Remitstate'
        remitZip:
          $ref: '#/components/schemas/type_:Remitzip'
        state:
          type: string
          description: >-
            Vendor's state or province. Required if any address field is
            provided. Must be a valid US state abbreviation (such as `CA`, `NY`)
            or Canadian province abbreviation (such as `ON`, `BC`), depending on
            the `country` value.
        vendorStatus:
          $ref: '#/components/schemas/type_:Vendorstatus'
        zip:
          type: string
          description: >-
            Vendor's ZIP or postal code. Required if any address field is
            provided. For US addresses, use five digits (`12345`) or ZIP+4
            format (`12345-6789`).
        defaultMethodId:
          type: string
          description: Identifier for the vendor's default stored payment method.
        attachment:
          $ref: '#/components/schemas/type_:FileContent'
          description: >-
            PDF invoice attachment for AI-powered vendor enrichment.

            When this feature is enabled and you include an attachment, the
            invoice is scanned and extracted vendor information is merged into
            the request.

            Fields in the request body take precedence over extracted data.

            If the scan fails, vendor creation proceeds with the original
            request data.


            See the [vendor enrichment
            guide](/guides/pay-out-vendor-enrichment-overview) for details.

            Contact Payabli to enable this feature.
      title: VendorData
    type_bill:BillOutData:
      type: object
      properties:
        accountingField1:
          $ref: '#/components/schemas/type_:AccountingField'
        accountingField2:
          $ref: '#/components/schemas/type_:AccountingField'
        additionalData:
          $ref: '#/components/schemas/type_:AdditionalDataString'
        attachments:
          $ref: '#/components/schemas/type_:Attachments'
          description: >-
            An array of bill images. Attachments aren't required, but we
            strongly recommend including them. Including a bill image can make
            payouts smoother and prevent delays. You can include either the
            Base64-encoded file content, or you can include an fURL to a public
            file. The maximum file size for image uploads is 30 MB.


            When vendor enrichment is enabled and the first attachment is a PDF,
            the invoice is scanned and extracted vendor contact information and
            bill details (invoice number, amount due, due date) are merged into
            the request. Fields in the request body take precedence over
            extracted data. If the scan fails, bill creation proceeds with the
            original request data. See the [vendor enrichment
            guide](/guides/pay-out-vendor-enrichment-overview) for details.
            Contact Payabli to enable this feature.
        billDate:
          type: string
          format: date
          description: 'Date of bill. Accepted formats: YYYY-MM-DD, MM/DD/YYYY.'
        billItems:
          $ref: '#/components/schemas/type_:Billitems'
        billNumber:
          type: string
          description: Unique identifier for the bill. Required when adding a bill.
        comments:
          $ref: '#/components/schemas/type_:Comments'
        discount:
          type: number
          format: double
          description: Discount amount applied to the bill.
        dueDate:
          type: string
          format: date
          description: 'Due date of bill. Accepted formats: YYYY-MM-DD, MM/DD/YYYY.'
        endDate:
          type: string
          format: date
          description: >-
            End Date for scheduled bills. Applied only in `Mode` = 1. Accepted
            formats: YYYY-MM-DD, MM/DD/YYYY
        frequency:
          $ref: '#/components/schemas/type_:Frequency'
          description: Frequency for scheduled bills. Applied only in `Mode` = 1.
        lotNumber:
          type: string
          description: Lot number associated with the bill.
        mode:
          type: integer
          description: 'Bill mode: value `0` for one-time bills, `1` for scheduled bills.'
        netAmount:
          type: number
          format: double
          description: Net Amount owed in bill. Required when adding a bill.
        scheduledOptions:
          $ref: '#/components/schemas/type_bill:BillOutDataScheduledOptions'
          description: Options for scheduled bills.
        status:
          $ref: '#/components/schemas/type_:Billstatus'
        terms:
          $ref: '#/components/schemas/type_:Terms'
        totalAmount:
          type: number
          format: double
          description: Total amount of the bill.
        vendor:
          $ref: '#/components/schemas/type_:VendorData'
          description: >-
            The vendor associated with the bill. Although you can create a
            vendor in a create bill request, Payabli recommends creating a
            vendor separately and passing a valid `vendorNumber` here. At
            minimum, the `vendorNumber` is required. 
      title: BillOutData
    type_:Responsecode:
      type: integer
      description: >-
        Code for the response. Learn more in [API Response
        Codes](/developers/api-reference/api-responses).
      title: Responsecode
    type_:PageIdentifier:
      type: string
      description: Auxiliary validation used internally by payment pages and components.
      title: PageIdentifier
    type_:RoomIdNotInUse:
      type: integer
      format: int64
      description: Field not in use on this endpoint. It always returns `0`.
      title: RoomIdNotInUse
    type_:IsSuccess:
      type: boolean
      description: >-
        Boolean indicating whether the operation was successful. A `true` value
        indicates success. A `false` value indicates failure.
      title: IsSuccess
    type_:ResponseText:
      type: string
      description: 'Response text for operation: ''Success'' or ''Declined''.'
      title: ResponseText
    type_:Responsedatanonobject:
      oneOf:
        - type: string
        - type: integer
      description: The response data.
      title: Responsedatanonobject
    type_bill:BillResponse:
      type: object
      properties:
        responseCode:
          $ref: '#/components/schemas/type_:Responsecode'
        pageIdentifier:
          $ref: '#/components/schemas/type_:PageIdentifier'
        roomId:
          $ref: '#/components/schemas/type_:RoomIdNotInUse'
        isSuccess:
          $ref: '#/components/schemas/type_:IsSuccess'
        responseText:
          $ref: '#/components/schemas/type_:ResponseText'
        responseData:
          $ref: '#/components/schemas/type_:Responsedatanonobject'
          description: >-
            If `isSuccess` = true, this contains the bill identifier. If
            `isSuccess` = false, this contains the reason for the error.  
      required:
        - responseText
      title: BillResponse
    type_:Responsedata:
      type: object
      additionalProperties:
        description: Any type
      description: The object containing the response data.
      title: Responsedata
    type_:PayabliApiResponse:
      type: object
      properties:
        isSuccess:
          $ref: '#/components/schemas/type_:IsSuccess'
        responseData:
          $ref: '#/components/schemas/type_:Responsedata'
        responseText:
          $ref: '#/components/schemas/type_:ResponseText'
      required:
        - responseText
      title: PayabliApiResponse
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: requestToken

```

## SDK Code Examples

```typescript CreateBill
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.bill.addBill("8cfec329267", {
        body: {
            accountingField1: "MyInternalId",
            attachments: [
                {
                    filename: "my-doc.pdf",
                    ftype: "pdf",
                    furl: "https://mysite.com/my-doc.pdf",
                },
            ],
            billDate: "2024-07-01",
            billItems: [
                {
                    itemCost: 5,
                    itemCategories: [
                        "deposits",
                    ],
                    itemCommodityCode: "010",
                    itemDescription: "Deposit for materials",
                    itemMode: 0,
                    itemProductCode: "M-DEPOSIT",
                    itemProductName: "Materials deposit",
                    itemQty: 1,
                    itemTaxAmount: 7,
                    itemTaxRate: 0.075,
                    itemTotalAmount: 123,
                    itemUnitOfMeasure: "SqFt",
                },
            ],
            billNumber: "ABC-123",
            comments: "Deposit for materials",
            dueDate: "2024-07-01",
            endDate: "2024-07-01",
            frequency: "monthly",
            mode: 0,
            netAmount: 3762.87,
            status: -99,
            terms: "NET30",
            vendor: {
                vendorNumber: "1234-A",
            },
        },
    });
}
main();

```

```python CreateBill
from payabli import payabli, FileContent, BillItem, VendorData
import datetime

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.bill.add_bill(
    entry="8cfec329267",
    accounting_field_1="MyInternalId",
    attachments=[
        FileContent(
            filename="my-doc.pdf",
            ftype="pdf",
            furl="https://mysite.com/my-doc.pdf",
        )
    ],
    bill_date=datetime.date.fromisoformat("2024-07-01"),
    bill_items=[
        BillItem(
            item_cost=5,
            item_categories=[
                "deposits"
            ],
            item_commodity_code="010",
            item_description="Deposit for materials",
            item_mode=0,
            item_product_code="M-DEPOSIT",
            item_product_name="Materials deposit",
            item_qty=1,
            item_tax_amount=7,
            item_tax_rate=0.075,
            item_total_amount=123,
            item_unit_of_measure="SqFt",
        )
    ],
    bill_number="ABC-123",
    comments="Deposit for materials",
    due_date=datetime.date.fromisoformat("2024-07-01"),
    end_date=datetime.date.fromisoformat("2024-07-01"),
    frequency="monthly",
    mode=0,
    net_amount=3762.87,
    status=-99,
    terms="NET30",
    vendor=VendorData(
        vendor_number="1234-A",
    ),
)

```

```csharp CreateBill
using PayabliPayabliApi;
using System.Threading.Tasks;
using System.Collections.Generic;
using System;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayabliPayabliApiClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Bill.AddBillAsync(
            "8cfec329267",
            new AddBillRequest {
                Body = new BillOutData {
                    AccountingField1 = "MyInternalId",
                    Attachments = new List<FileContent>(){
                        new FileContent {
                            Filename = "my-doc.pdf",
                            Ftype = FileContentFtype.Pdf,
                            Furl = "https://mysite.com/my-doc.pdf"
                        },
                    }
                    ,
                    BillDate = DateOnly.Parse("2024-07-01"),
                    BillItems = new List<BillItem>(){
                        new BillItem {
                            ItemCost = 5,
                            ItemCategories = new List<string>(){
                                "deposits",
                            }
                            ,
                            ItemCommodityCode = "010",
                            ItemDescription = "Deposit for materials",
                            ItemMode = 0,
                            ItemProductCode = "M-DEPOSIT",
                            ItemProductName = "Materials deposit",
                            ItemQty = 1,
                            ItemTaxAmount = 7,
                            ItemTaxRate = 0.075,
                            ItemTotalAmount = 123,
                            ItemUnitOfMeasure = "SqFt"
                        },
                    }
                    ,
                    BillNumber = "ABC-123",
                    Comments = "Deposit for materials",
                    DueDate = DateOnly.Parse("2024-07-01"),
                    EndDate = DateOnly.Parse("2024-07-01"),
                    Frequency = Frequency.Monthly,
                    Mode = 0,
                    NetAmount = 3762.87,
                    Status = -99,
                    Terms = "NET30",
                    Vendor = new VendorData {
                        VendorNumber = "1234-A"
                    }
                }
            }
        );
    }

}

```

```go CreateBill
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Bill/single/8cfec329267"

	payload := strings.NewReader("{\n  \"accountingField1\": \"MyInternalId\",\n  \"attachments\": [\n    {\n      \"filename\": \"my-doc.pdf\",\n      \"ftype\": \"pdf\",\n      \"furl\": \"https://mysite.com/my-doc.pdf\"\n    }\n  ],\n  \"billDate\": \"2024-07-01\",\n  \"billItems\": [\n    {\n      \"itemCost\": 5,\n      \"itemCategories\": [\n        \"deposits\"\n      ],\n      \"itemCommodityCode\": \"010\",\n      \"itemDescription\": \"Deposit for materials\",\n      \"itemMode\": 0,\n      \"itemProductCode\": \"M-DEPOSIT\",\n      \"itemProductName\": \"Materials deposit\",\n      \"itemQty\": 1,\n      \"itemTaxAmount\": 7,\n      \"itemTaxRate\": 0.075,\n      \"itemTotalAmount\": 123,\n      \"itemUnitOfMeasure\": \"SqFt\"\n    }\n  ],\n  \"billNumber\": \"ABC-123\",\n  \"comments\": \"Deposit for materials\",\n  \"dueDate\": \"2024-07-01\",\n  \"endDate\": \"2024-07-01\",\n  \"frequency\": \"monthly\",\n  \"mode\": 0,\n  \"netAmount\": 3762.87,\n  \"status\": -99,\n  \"terms\": \"NET30\",\n  \"vendor\": {\n    \"vendorNumber\": \"1234-A\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby CreateBill
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Bill/single/8cfec329267")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"accountingField1\": \"MyInternalId\",\n  \"attachments\": [\n    {\n      \"filename\": \"my-doc.pdf\",\n      \"ftype\": \"pdf\",\n      \"furl\": \"https://mysite.com/my-doc.pdf\"\n    }\n  ],\n  \"billDate\": \"2024-07-01\",\n  \"billItems\": [\n    {\n      \"itemCost\": 5,\n      \"itemCategories\": [\n        \"deposits\"\n      ],\n      \"itemCommodityCode\": \"010\",\n      \"itemDescription\": \"Deposit for materials\",\n      \"itemMode\": 0,\n      \"itemProductCode\": \"M-DEPOSIT\",\n      \"itemProductName\": \"Materials deposit\",\n      \"itemQty\": 1,\n      \"itemTaxAmount\": 7,\n      \"itemTaxRate\": 0.075,\n      \"itemTotalAmount\": 123,\n      \"itemUnitOfMeasure\": \"SqFt\"\n    }\n  ],\n  \"billNumber\": \"ABC-123\",\n  \"comments\": \"Deposit for materials\",\n  \"dueDate\": \"2024-07-01\",\n  \"endDate\": \"2024-07-01\",\n  \"frequency\": \"monthly\",\n  \"mode\": 0,\n  \"netAmount\": 3762.87,\n  \"status\": -99,\n  \"terms\": \"NET30\",\n  \"vendor\": {\n    \"vendorNumber\": \"1234-A\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java CreateBill
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/Bill/single/8cfec329267")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"accountingField1\": \"MyInternalId\",\n  \"attachments\": [\n    {\n      \"filename\": \"my-doc.pdf\",\n      \"ftype\": \"pdf\",\n      \"furl\": \"https://mysite.com/my-doc.pdf\"\n    }\n  ],\n  \"billDate\": \"2024-07-01\",\n  \"billItems\": [\n    {\n      \"itemCost\": 5,\n      \"itemCategories\": [\n        \"deposits\"\n      ],\n      \"itemCommodityCode\": \"010\",\n      \"itemDescription\": \"Deposit for materials\",\n      \"itemMode\": 0,\n      \"itemProductCode\": \"M-DEPOSIT\",\n      \"itemProductName\": \"Materials deposit\",\n      \"itemQty\": 1,\n      \"itemTaxAmount\": 7,\n      \"itemTaxRate\": 0.075,\n      \"itemTotalAmount\": 123,\n      \"itemUnitOfMeasure\": \"SqFt\"\n    }\n  ],\n  \"billNumber\": \"ABC-123\",\n  \"comments\": \"Deposit for materials\",\n  \"dueDate\": \"2024-07-01\",\n  \"endDate\": \"2024-07-01\",\n  \"frequency\": \"monthly\",\n  \"mode\": 0,\n  \"netAmount\": 3762.87,\n  \"status\": -99,\n  \"terms\": \"NET30\",\n  \"vendor\": {\n    \"vendorNumber\": \"1234-A\"\n  }\n}")
  .asString();
```

```php CreateBill
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/Bill/single/8cfec329267', [
  'body' => '{
  "accountingField1": "MyInternalId",
  "attachments": [
    {
      "filename": "my-doc.pdf",
      "ftype": "pdf",
      "furl": "https://mysite.com/my-doc.pdf"
    }
  ],
  "billDate": "2024-07-01",
  "billItems": [
    {
      "itemCost": 5,
      "itemCategories": [
        "deposits"
      ],
      "itemCommodityCode": "010",
      "itemDescription": "Deposit for materials",
      "itemMode": 0,
      "itemProductCode": "M-DEPOSIT",
      "itemProductName": "Materials deposit",
      "itemQty": 1,
      "itemTaxAmount": 7,
      "itemTaxRate": 0.075,
      "itemTotalAmount": 123,
      "itemUnitOfMeasure": "SqFt"
    }
  ],
  "billNumber": "ABC-123",
  "comments": "Deposit for materials",
  "dueDate": "2024-07-01",
  "endDate": "2024-07-01",
  "frequency": "monthly",
  "mode": 0,
  "netAmount": 3762.87,
  "status": -99,
  "terms": "NET30",
  "vendor": {
    "vendorNumber": "1234-A"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```swift CreateBill
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "accountingField1": "MyInternalId",
  "attachments": [
    [
      "filename": "my-doc.pdf",
      "ftype": "pdf",
      "furl": "https://mysite.com/my-doc.pdf"
    ]
  ],
  "billDate": "2024-07-01",
  "billItems": [
    [
      "itemCost": 5,
      "itemCategories": ["deposits"],
      "itemCommodityCode": "010",
      "itemDescription": "Deposit for materials",
      "itemMode": 0,
      "itemProductCode": "M-DEPOSIT",
      "itemProductName": "Materials deposit",
      "itemQty": 1,
      "itemTaxAmount": 7,
      "itemTaxRate": 0.075,
      "itemTotalAmount": 123,
      "itemUnitOfMeasure": "SqFt"
    ]
  ],
  "billNumber": "ABC-123",
  "comments": "Deposit for materials",
  "dueDate": "2024-07-01",
  "endDate": "2024-07-01",
  "frequency": "monthly",
  "mode": 0,
  "netAmount": 3762.87,
  "status": -99,
  "terms": "NET30",
  "vendor": ["vendorNumber": "1234-A"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Bill/single/8cfec329267")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```