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
/
Queries

Queries

Object: ApprovalRequest

approvalRequests

Paginated list of approval requests with optional filters.

Arguments:

ArgumentTypeDefaultDescription
filter.statusStringExact match (e.g. "pending", "approved", "denied")
filter.customer_nameStringPartial match on customer name
filter.sales_regionStringExact match on sales region
filter.request_typeStringExact match on request type
filter.request_date_fromDateRequests on or after this date (Y-m-d)
filter.request_date_toDateRequests on or before this date (Y-m-d)
firstInt15Items per page
pageInt1Page number
{
  approvalRequests(
    filter: { status: "pending", customer_name: "Acme" }
    first: 10
    page: 1
  ) {
    data {
      id
      sales_contact
      request_type
      request_date
      sales_region
      validity_period
      customer_name
      project_name
      account_number
      end_customer_name
      rep_firm
      expected_delivery_date
      reviewed_by
      review_date
      status
      other_details
      created_at
      updated_at
      opportunities {
        id
        partnumber
        quote_quantity
        requested_price
        competitor_name
        competitor_product
        requested_discount
        loa
        approved_price
        approval_level
        approved_discount
        pii_cost
        pii_margin_requested_price
        pii_margin_approved_price
        tariff_surcharge
        review_date
        status
        other_details
        product {
          id
          partnumber
          description
          list_price
        }
      }
    }
    paginatorInfo {
      currentPage
      lastPage
      total
    }
  }
}

approvalRequest

Find a single approval request by ID, including its line items (opportunities).

{
  approvalRequest(id: "01ABC123") {
    id
    customer_name
    status
    request_date
    opportunities {
      id
      partnumber
      requested_price
      approved_price
      status
      product {
        partnumber
        description
        list_price
      }
    }
  }
}

opportunities returns Request Detail records nested under the request — see that page for the full field list. Request Detail has no top-level query of its own.