Closed or Posted status directly through the API.
This service facilitates the automated creation of credit notes to adjust or cancel issued invoices.
| HTTP | Operation | Type | Object | DTO Why-DTOs? | 
|---|---|---|---|---|
| (Mutation Why 200?) | generateCreditNote | 
      GenerateCreditNoteGLDtoInput | 
    
Closed or Posted status directly through the API.
This service facilitates the automated creation of credit notes to adjust or cancel issued invoices.
lines block is provided in the request, a partial credit note can be generated, specifying the affected products and quantities to be deducted.Closed or Posted status can be processed.Invoice Details: Specify the details of the invoice for which a credit note is being created.
The service returns a GenerateCreditNoteOutputGLDto object containing the following fields:
| Key | Value | 
|---|---|
Authorization | 
      Bearer Current access Token How to find? | 
X-TenantId | 
      Current tenant id How to find? | 
X-OrganizationId | 
      Current organization Id How to find? | 
x-api-key | 
      Primary or secondary subscription key of your app How to find? | 
If only the invoice ID is provided, a credit note is generated for the entire invoice amount.
mutation($input: GenerateCreditNoteGLDtoInput!) {
  generateCreditNote(input: $input) {
    id
  }
}
{
  "input": {
    "id": "7af9f050-4a34-4a0b-a1af-30fe00a38abc"
  }
}
{
    "data": {
        "generateCreditNote": {
            "id": "0e1987c3-f762-4906-8b26-42e4a4c36079"
        }
    }
}
If a lines block is provided, a partial credit note is generated, specifying which products, quantities, and amounts are affected.
mutation($input: GenerateCreditNoteGLDtoInput!) {
  generateCreditNote(input: $input) {
    id
  }
}
{
  "input": {
    "id": "7af9f050-4a34-4a0b-a1af-30fe00a38abc",
    "lines": [
      {
        "productId": "e9d05ca3-79f8-4f50-ad2e-14dfa3d5604e",
        "quantity": 1.00
      },
      {
        "productId": "a3f29b17-5c2d-4d8e-91f1-9b8dcf1a8d3c",
        "quantity": 2.50
      }
    ]
  }
}
{
    "data": {
        "generateCreditNote": {
            "id": "3b12a8d2-9b4d-4c6d-8e47-10f6e2d9e7fa"
        }
    }
}_
| Fields | Type | Description | 
|---|---|---|
| id  | 
      UUID | Unique identifier of the invoice  | 
    
| lines[] | Array | (Optional) List of specific invoice lines for partial credit | 
| Fields | Type | Description | 
|---|---|---|
| productId  | 
      UUID | Unique identifier of the product  | 
    
| quantity  | 
      Decimal | Mandatory quantity of the product to be credited  | 
    
| unitPrice | Decimal | Optional unit price of the product in the credit note  | 
    
| Fields | Type | Description | 
|---|---|---|
| id | UUID | Unique identifier of the credit note created |