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

# Create One Invoice

> Create a new invoice.

**Integration notes:**
- `POST` errors with `400 Uniqueness violation` on duplicate `(sourceSystem, sourceSystemId)`. Use `PUT` for updates.
- `balance` is `NOT NULL` with no server-side default — for a new invoice it should equal `totalAmount`.
- `totalAmount` (and other monetary fields) are integer cents, not float dollars.
- The invoice number field is `number` (not `invoiceNumber`) and the issue date is `issueDate` (not `invoiceDate`).

See [Integration patterns](/integration-patterns).



## OpenAPI

````yaml /api-reference/openapi.json post /api/rest/invoices
openapi: 3.1.0
info:
  description: >-
    Upwell is Accounts Receivable automation software for the logistics
    industry. We serve freight brokers, carriers, factors, and anyone who needs
    to get transportation invoices paid.


    Learn more at:


    - [Upwell.com](https://upwell.com)
  title: Upwell REST API
  version: 3.30.2
  termsOfService: https://upwell.com/legal
  contact:
    name: Upwell
    url: https://upwell.com
    email: contact@upwell.com
servers:
  - url: https://api.upwell.com
    description: Production server
  - url: https://staging.api.upwell.com
    description: Staging server
security: []
tags:
  - name: Invoice Approval
    description: Endpoints for managing customer invoice approval workflow
paths:
  /api/rest/invoices:
    post:
      tags:
        - Invoices
      summary: Create One Invoice
      description: >-
        Create a new invoice.


        **Integration notes:**

        - `POST` errors with `400 Uniqueness violation` on duplicate
        `(sourceSystem, sourceSystemId)`. Use `PUT` for updates.

        - `balance` is `NOT NULL` with no server-side default — for a new
        invoice it should equal `totalAmount`.

        - `totalAmount` (and other monetary fields) are integer cents, not float
        dollars.

        - The invoice number field is `number` (not `invoiceNumber`) and the
        issue date is `issueDate` (not `invoiceDate`).


        See [Integration patterns](/integration-patterns).
      parameters:
        - description: >-
            Your API key will be used for authentication of the request.
            `Authorization: YOUR_API_KEY`
          in: header
          name: authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                input:
                  $ref: '#/components/schemas/InvoicesInsertInput'
              type: object
        description: >-
          Query parameters can also be provided in the request body as a JSON
          object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  createInvoice:
                    description: columns and relationships of "invoices"
                    nullable: true
                    properties:
                      balance:
                        $ref: '#/components/schemas/bigint'
                      companyDivision:
                        nullable: true
                        title: String
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/timestamptz'
                      customerId:
                        nullable: true
                        title: String
                        type: string
                      customerReferenceNumber:
                        nullable: true
                        title: String
                        type: string
                      dueDate:
                        $ref: '#/components/schemas/date'
                      id:
                        nullable: false
                        title: String
                        type: string
                      invoiceLineItems:
                        items:
                          description: columns and relationships of "invoice_line_items"
                          nullable: false
                          properties:
                            createdAt:
                              $ref: '#/components/schemas/timestamptz'
                            id:
                              nullable: false
                              title: String
                              type: string
                            item:
                              nullable: true
                              title: String
                              type: string
                            remoteId:
                              nullable: true
                              title: String
                              type: string
                            sourceSystem:
                              nullable: true
                              title: String
                              type: string
                            sourceSystemId:
                              nullable: true
                              title: String
                              type: string
                            totalAmount:
                              nullable: true
                              title: Int
                              type: integer
                            updatedAt:
                              $ref: '#/components/schemas/timestamptz'
                          title: InvoiceLineItems
                          type: object
                        nullable: false
                        type: array
                      invoiceShipments:
                        items:
                          description: columns and relationships of "invoice_shipments"
                          nullable: false
                          properties:
                            shipment:
                              description: columns and relationships of "shipments"
                              nullable: false
                              properties:
                                consigneeAddress:
                                  description: columns and relationships of "addresses"
                                  nullable: true
                                  properties:
                                    city:
                                      nullable: true
                                      title: String
                                      type: string
                                    companyName:
                                      nullable: true
                                      title: String
                                      type: string
                                    country:
                                      $ref: '#/components/schemas/CountryCodeEnum'
                                    id:
                                      nullable: false
                                      title: String
                                      type: string
                                    name:
                                      nullable: true
                                      title: String
                                      type: string
                                    phoneNumber:
                                      nullable: true
                                      title: String
                                      type: string
                                    stateOrProvince:
                                      nullable: true
                                      title: String
                                      type: string
                                    streetLine1:
                                      nullable: true
                                      title: String
                                      type: string
                                    streetLine2:
                                      nullable: true
                                      title: String
                                      type: string
                                    zipOrPostalCode:
                                      nullable: true
                                      title: String
                                      type: string
                                  title: Addresses
                                  type: object
                                createdAt:
                                  $ref: '#/components/schemas/timestamptz'
                                currency:
                                  $ref: '#/components/schemas/CurrencyCodeEnum'
                                customerId:
                                  nullable: true
                                  title: String
                                  type: string
                                deliveredAt:
                                  $ref: '#/components/schemas/timestamp'
                                id:
                                  nullable: false
                                  title: String
                                  type: string
                                invoiceId:
                                  nullable: true
                                  title: String
                                  type: string
                                loadDescription:
                                  nullable: true
                                  title: String
                                  type: string
                                pickupAddress:
                                  description: columns and relationships of "addresses"
                                  nullable: true
                                  properties:
                                    city:
                                      nullable: true
                                      title: String
                                      type: string
                                    companyName:
                                      nullable: true
                                      title: String
                                      type: string
                                    country:
                                      $ref: '#/components/schemas/CountryCodeEnum'
                                    id:
                                      nullable: false
                                      title: String
                                      type: string
                                    name:
                                      nullable: true
                                      title: String
                                      type: string
                                    phoneNumber:
                                      nullable: true
                                      title: String
                                      type: string
                                    stateOrProvince:
                                      nullable: true
                                      title: String
                                      type: string
                                    streetLine1:
                                      nullable: true
                                      title: String
                                      type: string
                                    streetLine2:
                                      nullable: true
                                      title: String
                                      type: string
                                    zipOrPostalCode:
                                      nullable: true
                                      title: String
                                      type: string
                                  title: Addresses
                                  type: object
                                pickupAt:
                                  $ref: '#/components/schemas/timestamp'
                                shipmentId:
                                  nullable: false
                                  title: String
                                  type: string
                                status:
                                  nullable: true
                                  title: String
                                  type: string
                                stops:
                                  items:
                                    description: columns and relationships of "stops"
                                    nullable: false
                                    properties:
                                      address:
                                        description: columns and relationships of "addresses"
                                        nullable: true
                                        properties:
                                          city:
                                            nullable: true
                                            title: String
                                            type: string
                                          companyName:
                                            nullable: true
                                            title: String
                                            type: string
                                          country:
                                            $ref: '#/components/schemas/CountryCodeEnum'
                                          id:
                                            nullable: false
                                            title: String
                                            type: string
                                          name:
                                            nullable: true
                                            title: String
                                            type: string
                                          phoneNumber:
                                            nullable: true
                                            title: String
                                            type: string
                                          stateOrProvince:
                                            nullable: true
                                            title: String
                                            type: string
                                          streetLine1:
                                            nullable: true
                                            title: String
                                            type: string
                                          streetLine2:
                                            nullable: true
                                            title: String
                                            type: string
                                          zipOrPostalCode:
                                            nullable: true
                                            title: String
                                            type: string
                                        title: Addresses
                                        type: object
                                      id:
                                        nullable: false
                                        title: String
                                        type: string
                                      metadata:
                                        nullable: true
                                        title: String
                                        type: string
                                      pieceCount:
                                        nullable: true
                                        title: Int
                                        type: integer
                                      sequenceNumber:
                                        nullable: true
                                        title: Int
                                        type: integer
                                      stopType:
                                        nullable: true
                                        title: String
                                        type: string
                                      weightAmount:
                                        $ref: '#/components/schemas/float8'
                                      weightUnit:
                                        nullable: true
                                        title: String
                                        type: string
                                    title: Stops
                                    type: object
                                  nullable: false
                                  type: array
                                trailerNumber:
                                  nullable: true
                                  title: String
                                  type: string
                                updatedAt:
                                  $ref: '#/components/schemas/timestamptz'
                                volume:
                                  $ref: '#/components/schemas/float8'
                                volumeUnit:
                                  nullable: true
                                  title: String
                                  type: string
                                weight:
                                  $ref: '#/components/schemas/float8'
                                weightUnit:
                                  nullable: true
                                  title: String
                                  type: string
                              title: Shipments
                              type: object
                          title: InvoiceShipments
                          type: object
                        nullable: false
                        type: array
                      issueDate:
                        $ref: '#/components/schemas/date'
                      metadata:
                        $ref: '#/components/schemas/jsonb'
                      missingDocuments:
                        nullable: true
                        title: String
                        type: string
                      number:
                        nullable: false
                        title: String
                        type: string
                      portalSlug:
                        nullable: true
                        title: String
                        type: string
                      referenceNumbers:
                        $ref: '#/components/schemas/jsonb'
                      sourceSystem:
                        nullable: true
                        title: String
                        type: string
                      sourceSystemId:
                        nullable: true
                        title: String
                        type: string
                      status:
                        $ref: '#/components/schemas/InvoiceStatusEnum'
                      totalAmount:
                        $ref: '#/components/schemas/bigint'
                      totalTaxAmount:
                        $ref: '#/components/schemas/bigint'
                      updatedAt:
                        $ref: '#/components/schemas/timestamptz'
                    title: Invoices
                    type: object
          description: Responses for POST /api/rest/invoices
components:
  schemas:
    InvoicesInsertInput:
      description: input type for inserting data into table "invoices"
      nullable: false
      properties:
        approvedToSend:
          nullable: true
          title: Boolean
          type: boolean
        balance:
          $ref: '#/components/schemas/bigint'
          description: >-
            The balance of the invoice. This should be in cents. For example,
            $100.00 should be represented as 10000.
        billOfLadingNumber:
          nullable: true
          title: String
          type: string
        billToCustomer:
          type: object
          description: CustomersObjRelInsertInput (simplified)
        billToCustomerId:
          nullable: true
          title: String
          type: string
        carrierProNumber:
          nullable: true
          title: String
          type: string
        checkOrAchNumber:
          nullable: true
          title: String
          type: string
        companyDivision:
          nullable: true
          title: String
          type: string
        createdFromEmailMessageId:
          nullable: true
          title: String
          type: string
        customerId:
          nullable: true
          title: String
          type: string
        customerPoNumber:
          nullable: true
          title: String
          type: string
        customerReferenceNumber:
          nullable: true
          title: String
          type: string
        debitsUpdatedAt:
          $ref: '#/components/schemas/timestamp'
        deliveryDate:
          $ref: '#/components/schemas/date'
        documentExceptions:
          $ref: '#/components/schemas/jsonb'
        dueDate:
          $ref: '#/components/schemas/date'
        exceptions:
          type: object
          description: ExceptionsArrRelInsertInput (simplified)
        externallyManaged:
          nullable: true
          title: Boolean
          type: boolean
        fileAssociations:
          type: object
          description: FileAssociationsArrRelInsertInput (simplified)
        fileAssociationsUpdatedAt:
          $ref: '#/components/schemas/timestamp'
        finalCheckPassedAt:
          $ref: '#/components/schemas/timestamptz'
        invoiceErrors:
          type: object
          description: InvoiceErrorsArrRelInsertInput (simplified)
        invoiceLineItems:
          type: object
          description: InvoiceLineItemsArrRelInsertInput (simplified)
        invoicePriorityActions:
          type: object
          description: InvoicePriorityActionsArrRelInsertInput (simplified)
        invoiceSnooze:
          type: object
          description: InvoiceSnoozesObjRelInsertInput (simplified)
        invoiceSnoozes:
          type: object
          description: InvoiceSnoozesArrRelInsertInput (simplified)
        issueDate:
          $ref: '#/components/schemas/date'
        lastUpdatedByEmailMessageId:
          nullable: true
          title: String
          type: string
        lineItemsLastUpdatedAt:
          $ref: '#/components/schemas/timestamptz'
        listBillDeliveryInvoices:
          type: object
          description: ListBillDeliveryInvoicesArrRelInsertInput (simplified)
        metadata:
          $ref: '#/components/schemas/jsonb'
        number:
          nullable: true
          title: String
          type: string
        paidDate:
          $ref: '#/components/schemas/timestamptz'
        paymentLineItems:
          type: object
          description: PaymentLineItemsArrRelInsertInput (simplified)
        portalException:
          nullable: true
          title: String
          type: string
        portalInvoiceStatuses:
          type: object
          description: PortalInvoiceStatusesArrRelInsertInput (simplified)
        portalSlug:
          nullable: true
          title: String
          type: string
        receivedAt:
          $ref: '#/components/schemas/timestamp'
        receivedFromPortalSlug:
          nullable: true
          title: String
          type: string
        referenceNumbers:
          $ref: '#/components/schemas/jsonb'
        scacCode:
          nullable: true
          title: String
          type: string
        scheduledPaymentDate:
          $ref: '#/components/schemas/date'
        sentAt:
          $ref: '#/components/schemas/timestamp'
        sentToPortalSlug:
          nullable: true
          title: String
          type: string
        shipDate:
          $ref: '#/components/schemas/date'
        sourceSystem:
          nullable: true
          title: String
          type: string
        sourceSystemId:
          nullable: true
          title: String
          type: string
        splitLineage:
          type: object
          description: InvoiceSplitLineageObjRelInsertInput (simplified)
        status:
          $ref: '#/components/schemas/InvoiceStatusEnum'
          enum:
            - created
            - open
            - sent
            - viewed
            - paid
            - part-paid
            - disputed
            - overdue
            - cancelled
            - write-off
            - refunded
            - send-error
        supportingDocPacketBuiltAgainstAt:
          $ref: '#/components/schemas/timestamp'
        totalAmount:
          $ref: '#/components/schemas/bigint'
          description: >-
            The total amount of the invoice. This should be in cents. For
            example, $100.00 should be represented as 10000.
        totalTaxAmount:
          $ref: '#/components/schemas/bigint'
          description: >-
            The total tax amount of the invoice. This should be in cents. For
            example, $100.00 should be represented as 10000.
      title: InvoicesInsertInput
      type: object
    bigint:
      nullable: false
      title: bigint
    timestamptz:
      nullable: false
      title: timestamptz
      type: string
      format: date-time
      description: >-
        A timestamp with timezone in ISO 8601 format, such as
        2024-12-16T21:57:14.525733+00:00
    date:
      nullable: false
      title: date
      type: string
      format: date
      description: A date string, such as 2024-02-03 (YYYY-MM-DD)
    CountryCodeEnum:
      enum:
        - AD
        - AE
        - AF
        - AG
        - AL
        - AM
        - AO
        - AR
        - AT
        - AU
        - AZ
        - BA
        - BB
        - BD
        - BE
        - BF
        - BG
        - BH
        - BI
        - BJ
        - BN
        - BO
        - BR
        - BS
        - BT
        - BW
        - BY
        - BZ
        - CA
        - CD
        - CF
        - CG
        - CH
        - CI
        - CL
        - CM
        - CN
        - CO
        - CR
        - CU
        - CV
        - CY
        - CZ
        - DE
        - DJ
        - DK
        - DM
        - DO
        - DZ
        - EC
        - EE
        - EG
        - ER
        - ES
        - ET
        - FI
        - FJ
        - FM
        - FR
        - GA
        - GB
        - GD
        - GE
        - GH
        - GM
        - GN
        - GQ
        - GR
        - GT
        - GW
        - GY
        - HK
        - HN
        - HR
        - HT
        - HU
        - ID
        - IE
        - IL
        - IN
        - IQ
        - IR
        - IS
        - IT
        - JM
        - JO
        - JP
        - KE
        - KG
        - KH
        - KI
        - KM
        - KN
        - KP
        - KR
        - KW
        - KZ
        - LA
        - LB
        - LC
        - LI
        - LK
        - LR
        - LS
        - LT
        - LU
        - LV
        - LY
        - MA
        - MC
        - MD
        - ME
        - MG
        - MH
        - MK
        - ML
        - MM
        - MN
        - MO
        - MR
        - MT
        - MU
        - MV
        - MW
        - MX
        - MY
        - MZ
        - NA
        - NE
        - NG
        - NI
        - NL
        - 'NO'
        - NP
        - NR
        - NZ
        - OM
        - PA
        - PE
        - PG
        - PH
        - PK
        - PL
        - PR
        - PS
        - PT
        - PW
        - PY
        - QA
        - RO
        - RS
        - RU
        - RW
        - SA
        - SB
        - SC
        - SD
        - SE
        - SG
        - SI
        - SK
        - SL
        - SM
        - SN
        - SO
        - SR
        - SS
        - ST
        - SV
        - SY
        - SZ
        - TD
        - TG
        - TH
        - TJ
        - TL
        - TM
        - TN
        - TO
        - TR
        - TT
        - TV
        - TW
        - TZ
        - UA
        - UG
        - US
        - UY
        - UZ
        - VA
        - VC
        - VE
        - VN
        - VU
        - WS
        - YE
        - ZA
        - ZM
        - ZW
      nullable: false
      title: CountryCodeEnum
    CurrencyCodeEnum:
      enum:
        - AED
        - AUD
        - BRL
        - CAD
        - CHF
        - CNY
        - EGP
        - EUR
        - GBP
        - HKD
        - IDR
        - INR
        - JPY
        - KRW
        - MXN
        - MYR
        - NZD
        - QAR
        - SAR
        - SGD
        - THB
        - TRY
        - TWD
        - USD
        - VND
        - ZAR
      nullable: false
      title: CurrencyCodeEnum
    timestamp:
      nullable: false
      title: timestamp
    float8:
      nullable: false
      title: float8
    jsonb:
      nullable: false
      title: jsonb
    InvoiceStatusEnum:
      enum:
        - APPROVED
        - CANCELLED
        - CREATED
        - DELIVERED
        - DISPUTED
        - DRAFT
        - OPEN
        - OVERDUE
        - PAID
        - PART_PAID
        - PORTAL_EXCEPTION
        - PORTAL_RESOLVED
        - PROCESSING
        - REFUNDED
        - REJECTED
        - SEND_ERROR
        - SENT
        - VIEWED
        - WRITE_OFF
      nullable: false
      title: InvoiceStatusEnum

````