This feature is currently under development and, although not available in the current version, its preliminary documentation is provided to give you a preview of the enhancements that will be included in an upcoming update.

HTTP Operation Type Object DTO Why-DTOs?
(Mutation Why 200?) linkRelatedSalesDocument LinkRelatedSalesDocumentInput

Description

The LinkRelatedSalesDocument service allows you to establish a relationship between two existing sales documents, when the transformation is allowed (see the transformation table).
As soon as a sales document is created, an entry is automatically added in RelatedSalesDocument for it.
This action updates the related record by setting the originId with the identifier of the origin document.

img

Functionality

Response

The service returns the identifiers of the linked related sales document, along with its updated fields.

GraphQL Mutation
mutation($input: LinkRelatedSalesDocumentInput!) {
  linkRelatedSalesDocument(input: $input) {
    documentId
    documentType
    originId
    originDocumentType
  }
}
GraphQL Variables
{
  "input": {
    "documentId": "33333333-aaaa-bbbb-cccc-444444444444",
    "originId": "11111111-aaaa-bbbb-cccc-222222222222"
  }
}
Example Response
{
  "data": {
    "linkRelatedSalesDocument": {
      "documentId": "33333333-aaaa-bbbb-cccc-444444444444",
      "documentType": "ORDER",
      "originId": "11111111-aaaa-bbbb-cccc-222222222222",
      "originDocumentType": "QUOTE",
    }
  }
}

linkRelatedSalesDocument Input parameters

Fields Type Description
documentId UUID Unique identifier of the sales document to link
originId UUID Unique identifier of the origin sales document (the source)

linkRelatedSalesDocument Response

Fields Type Description
documentId UUID Id of the target sales document
documentType
  • QUOTE
  • NONE
  • ORDER
  • DELIVERY_NOTE
  • INVOICE
  • CREDIT_NOTE
  • ADVANCE_INVOICE
  • SALES_INVOICE_TEMPLATE
Type of the target sales document
originId UUID Id of the origin sales document
originDocumentType
  • QUOTE
  • NONE
  • ORDER
  • DELIVERY_NOTE
  • INVOICE
  • CREDIT_NOTE
  • ADVANCE_INVOICE
  • SALES_INVOICE_TEMPLATE
Type of the origin sales document
Info
  • The mutation only succeeds if the transformation between the originDocumentType and documentType is allowed.
  • Otherwise, an error is returned.
  • The logic is consistent with the allowed transformations table.