Get an invoice

The Get invoice endpoint can be used to retrieve a single invoice object from the Helcim system based on the invoiceId value. The invoiceId is returned in the response from the Create invoice endpoint.

Get invoice requests

The Get invoice endpoint takes a single path parameter value of the invoiceId, in order to return the relevant invoice object in the Helcim system.

Review Get Invoice API Reference

📘

Using an invoiceNumber to retrieve an invoice

Approved Helcim payment responses will return the invoiceNumber value, rather than an invoiceId. This should be passed as a query parameter to the Get invoices endpoint to retrieve the associated invoice object.

// Example Get invoice request

const options = {
  method: 'GET',
  headers: {
    accept: 'application/json',
    'api-token': 'YOUR_API_TOKEN'
  }
};

fetch('https://api.helcim.com/v2/invoices/39549794', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Potential responses

The Get invoice endpoint will respond to all requests with either:

  • A JSON response containing the invoice object for the relevant invoiceId value.
// Example invoice object returned in response
{
  "invoiceId": 39538739,
  "invoiceNumber": "INV1465",
  "token": "7b353eafe7ed260f3dcfe7",
  "tipAmount": 0,
  "depositAmount": 0,
  "notes": "",
  "dateCreated": "2024-07-15 10:43:17",
  "dateUpdated": "2024-07-15 10:43:17",
  "datePaid": "0000-00-00 00:00:00",
  "dateIssued": "2024-07-15 10:43:17",
  "status": "DUE",
  "customerId": 0,
  "amount": 265,
  "currency": "CAD",
  "type": "INVOICE",
  "convenienceFee": 0,
  "orderFields": [],
  "billingAddress": [],
  "shipping": {
    "amount": 0,
    "details": "",
    "address": {
      "name": "",
      "street1": "",
      "street2": "",
      "city": "",
      "province": "",
      "country": "",
      "postalCode": "",
      "phone": "",
      "email": ""
    }
  },
  "pickup": {
    "date": "0000-00-00 00:00:00",
    "name": ""
  },
  "tax": {
    "amount": 0,
    "details": ""
  },
  "discounts": {
    "amount": 0,
    "details": ""
  },
  "lineItems": [
    {
      "sku": "ITM1434",
      "description": "Red Hat",
      "quantity": 1,
      "price": 265,
      "total": 265,
      "taxAmount": 0,
      "discountAmount": 0
    }
  ]
}
  • An error response if an object with that invoiceId value does not exist
// Example error response for request with invalid invoiceId

{
  "errors": "invoice does not exist"
}