Update Invoice API
POST /updateInvoice
Description
This API endpoint allows for updating invoice details. You can modify various attributes of an invoice, such as client information and invoice amounts.
Request Body
The request utilizes GraphQL to perform the updateInvoice
mutation.
Mutation:
mutation updateInvoice ($invoiceUpdate: InvoiceUpdate) {
updateInvoice (invoiceUpdate: $invoiceUpdate) {
id
firstName
lastName
clientCompanyName
address
taxId
email
phoneNumber
groupId
amountForGroup
multiLogin
amountForMultiLogin
totalAmount
paymentMethod
paymentDate
invoiceDate
updateDate
}
}
Variables:
{
"invoiceUpdate": {
"id": <Invoice_Id>,
"clientCompanyName": "<Company_Name>",
"address": "<Company_Address>",
"email": "<Company_Email>",
"phoneNumber": "<Company_Phone_Number>",
"taxId": "<Company_Tax_Id>",
"companyRegistrationNumber": "<Registration_Number>"
}
}
- id (Int): The ID of the invoice to be updated.
- clientCompanyName (String): The name of the client's company.
- address (String): The address of the client's company.
- email (String): The email address of the client's company.
- phoneNumber (String): The phone number of the client's company.
- taxId (String): The tax ID of the client's company.
- companyRegistrationNumber (String): The company registration number.
Response:
-
Success (200 OK):
- If the update is successful, the response will include the updated invoice details.
{
"data": {
"updateInvoice": {
"id": <Invoice_Id>,
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"clientCompanyName": "<Updated_Company_Name>",
"address": "<Updated_Company_Address>",
"taxId": "<Updated_Tax_Id>",
"email": "<Updated_Company_Email>",
"phoneNumber": "<Updated_Company_Phone_Number>",
"groupId": "<Group_Id>",
"amountForGroup": "<Amount_For_Group>",
"multiLogin": "<Multi_Login_Details>",
"amountForMultiLogin": "<Amount_For_Multi_Login>",
"totalAmount": "<Total_Amount>",
"paymentMethod": "<Payment_Method>",
"paymentDate": "<Payment_Date>",
"invoiceDate": "<Invoice_Date>",
"updateDate": "<Update_Date>"
}
}
} -
Error (4XX/5XX):
- If there is an issue with updating the invoice, the response will include an appropriate error message and status code.
Note:
Make sure to provide valid details for the invoice being updated. This API updates the invoice with the given ID based on the provided attributes.