Options

Find Invoice by invoice number

joshalexandrejoshalexandre Member Posts: 2

Hello Wave

Firstly - thank you so much for the API - it's awesome and has enabled us to automate and scale our billing process :-)

Quick feature request:
Please can you add the ability to find invoices by invoice number?

Example query:
query ($businessId: ID!, $invoiceNo: String!) { business(id: $businessId) { id invoices(page: 1, pageSize: 50, invoiceNumber: $invoiceNo) { edges { node { id status invoiceNumber invoiceDate customer { id name } } } } } }

Tagged:

Comments

  • Options
    PaulCPaulC Member Posts: 186 ✭✭✭

    Hi @joshalexandre,

    Thank you for your suggestion. That would be a good feature.

    I will add this to our list of possible enhancements for the next time the team is touching the Invoice API.

  • Options
    RobVGRobVG Member Posts: 53 admin

    Hey @joshalexandre,

    Good news! We have released your feature suggestion. You can now filter a list of invoices to find all invoices where the filter parameter is contained within the invoice number.

    Example query:

    query InvoicesWithInvoiceNumber ($businessId: ID!, $invoiceNumber: String!) {
      business(id: $businessId) {
        id
        name
        invoices(invoiceNumber: $invoiceNumber, sort: [CREATED_AT_ASC]) {
          pageInfo {
            currentPage
            totalPages
            totalCount
          }
          edges {
            node {
              id
              invoiceNumber
              createdAt
            }
          }
        }
      }
    }
    
    

    Example variables:

    {
      "businessId": "Real ID here",
      "invoiceNumber": "21"
    }
    

    Example response:

    {
      "data": {
        "business": {
          "id": "Real ID here",
          "name": "Demo",
          "invoices": {
            "pageInfo": {
              "currentPage": 1,
              "totalPages": 1,
              "totalCount": 4
            },
            "edges": [
              {
                "node": {
                  "id": "Real ID here",
                  "invoiceNumber": "21",
                  "createdAt": "2019-01-01T13:38:12.000Z"
                }
              },
              {
                "node": {
                  "id": "Real ID here",
                  "invoiceNumber": "210",
                  "createdAt": "2019-03-21T13:38:12.000Z"
                }
              },
              {
                "node": {
                  "id": "Real ID here",
                  "invoiceNumber": "211",
                  "createdAt": "2019-03-21T13:38:13.000Z"
                }
              },
              {
                "node": {
                  "id": "Real ID here",
                  "invoiceNumber": "212",
                  "createdAt": "2020-05-12T20:22:58.233Z"
                }
              }
            ]
          }
        }
      }
    }
    

    Hope that helps! :smiley:

  • Options
    joshalexandrejoshalexandre Member Posts: 2

    @RobVG said:
    Hey @joshalexandre,

    Good news! We have released your feature suggestion. You can now filter a list of invoices to find all invoices where the filter parameter is contained within the invoice number.

    Thanks so much @RobVG! Really appreciate the work you are doing and look forward to using this feature :-)

Sign In or Register to comment.