Skip to main content

Get Invoice by ID API

POST /getInvoiceById

Description

This endpoint retrieves details of a specific invoice based on its unique identifier.

Request

Endpoint: /getInvoiceById

Method: POST

Body:

query getInvoiceById ($invoiceId: Int!) {
getInvoiceById (invoiceId: $invoiceId) {
id
firstName
lastName
clientCompanyName
address
taxId
email
phoneNumber
groupId
amountForGroup
multiLogin
amountForMultiLogin
totalAmount
paymentMethod
paymentDate
invoiceDate
updateDate
}
}

GraphQL Variables:

{
"invoiceId": 0
}

Example Request

cURL:

curl --location 'YOUR_API_ENDPOINT' \
--header 'Content-Type: application/json' \
--data '{"query":"query getInvoiceById ($invoiceId: Int!) {\n getInvoiceById (invoiceId: $invoiceId) {\n id\n firstName\n lastName\n clientCompanyName\n address\n taxId\n email\n phoneNumber\n groupId\n amountForGroup\n multiLogin\n amountForMultiLogin\n totalAmount\n paymentMethod\n paymentDate\n invoiceDate\n updateDate\n }\n}","variables":{"invoiceId":0}}'

Response

The response will include:

  • id: Unique identifier of the invoice.
  • firstName: First name of the client.
  • lastName: Last name of the client.
  • clientCompanyName: Company name of the client.
  • address: Address of the client.
  • taxId: Tax identification number of the client.
  • email: Email address of the client.
  • phoneNumber: Phone number of the client.
  • groupId: Group ID associated with the invoice.
  • amountForGroup: Amount billed for the group.
  • multiLogin: Number of multi-logins billed.
  • amountForMultiLogin: Amount billed for multi-logins.
  • totalAmount: Total amount of the invoice.
  • paymentMethod: Method used for payment.
  • paymentDate: Date when the payment was made.
  • invoiceDate: Date when the invoice was issued.
  • updateDate: Date when the invoice was last updated.

Errors

  • 400 Bad Request: Invalid invoiceId provided.
  • 404 Not Found: Invoice with the given invoiceId does not exist.
  • 500 Internal Server Error: Server error while processing the request.

Notes

  • Ensure that invoiceId provided is valid; otherwise, the response may be an error or empty.
  • The response includes sensitive client information. Ensure proper access controls and permissions are in place.
  • If the invoice with the given ID does not exist, the response should handle this gracefully, potentially returning an error or an empty result.