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
/
API Endpoints
/
Update approval request

Update approval request

Update existing approval request details

updateApprovalRequest

Updates an existing approval request by ID. Only fields included in input are changed.

Note: Approving or declining individual line items (opportunities) is not available through the API.

Method

POST

Path

/graphql

Authentication

Bearer Token

Request Body Schema

Content-type: application/json

Variables

NameTypeRequiredDescription
idIDRequiredThe approval request ID to update
input.sales_contactStringOptionalName of the sales contact
input.request_typeStringOptionalType of request
input.request_dateDateOptionalDate of the request (Y-m-d)
input.sales_regionStringOptionalSales region
input.validity_periodStringOptionalHow long the approval remains valid
input.customer_nameStringOptionalCustomer name
input.project_nameStringOptionalProject name
input.account_numberStringOptionalCustomer account number
input.end_customer_nameStringOptionalEnd customer name
input.rep_firmStringOptionalRepresentative firm name
input.expected_delivery_dateDateOptionalExpected delivery date (Y-m-d)
input.statusStringOptionalRequest status (e.g. "submitted", "pending")
input.other_detailsJSONOptionalArbitrary additional data

Example Payload

{
  "query": "mutation ($id: ID!, $input: UpdateApprovalRequestInput!) { updateApprovalRequest(id: $id, input: $input) { id customer_name status updated_at } }",
  "variables": {
    "id": "01JNQX4KZB7WNVR3MPXT6A0010",
    "input": {
      "customer_name": "Acme Corporation",
      "status": "submitted"
    }
  }
}

Response

Returns the updated ApprovalRequest object.

Example Response

{
  "data": {
    "updateApprovalRequest": {
      "id": "01JNQX4KZB7WNVR3MPXT6A0010",
      "customer_name": "Acme Corporation",
      "status": "submitted",
      "updated_at": "2026-06-03 09:45:00"
    }
  }
}

Errors

Example Response

{
  "errors": [
    {
      "message": "Unauthenticated."
    }
  ]
}