Back to Home

Documentation

Everything you need to know to get the most out of DiscountFlow. Find guides, tutorials, and API references.

Quick Start
API References
FAQs

API References

Overview

API References
/
API Endpoints
/
Mutations

Mutations

Object: ApprovalRequest

createApprovalRequest

Creates an approval request. The user_id is automatically set to the tenant owner.

mutation {
  createApprovalRequest(input: {
    sales_contact: "John Smith"
    request_type: "standard"
    request_date: "2026-03-24"
    sales_region: "NA"
    customer_name: "Acme Corp"
    project_name: "Q2 Expansion"
    account_number: "ACME-001"
    end_customer_name: "Acme Industries"
    expected_delivery_date: "2026-06-01"
  }) {
    id
    customer_name
    status
    created_at
  }
}

updateApprovalRequest

mutation {
  updateApprovalRequest(id: "01ABC123", input: {
    customer_name: "Acme Corporation"
    status: "submitted"
  }) {
    id
    customer_name
    status
    updated_at
  }
}

Note: Approving or declining individual request detail entries (opportunities) is not available through the API.

deleteApprovalRequest

Soft-deletes the approval request (it remains in the database but is excluded from queries).

mutation {
  deleteApprovalRequest(id: "01ABC123") {
    id
    customer_name
  }
}

archiveApprovalRequest

Sets the request's status to archived without deleting it.

mutation {
  archiveApprovalRequest(id: "01ABC123") {
    id
    status
  }
}