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

Update approval leavel

Update existing approval level

updateApprovalLevel

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

Method

POST

Path

/graphql

Authentication

Bearer Token

Request Body Schema

Content-type: application/json

Variables

NameTypeRequiredDescription
idIDRequiredThe approval level ID to update
input.nameStringOptionalDisplay name
input.codeStringOptionalShort code identifier
input.rankIntOptionalNumeric rank
input.threshold_price_requestedFloatOptionalMaximum requested price this level can handle
input.threshold_price_approvedFloatOptionalMaximum price this level can approve
input.descriptionStringOptionalDescription

Example Payload

{
  "query": "mutation ($id: ID!, $input: UpdateApprovalLevelInput!) { updateApprovalLevel(id: $id, input: $input) { id name threshold_price_requested threshold_price_approved } }",
  "variables": {
    "id": "01JNQX4KZB7WNVR3MPXT6A0002",
    "input": {
      "threshold_price_requested": 15000.0,
      "threshold_price_approved": 12000.0
    }
  }
}

Response

Returns the updated ApprovalLevel object.

Example Response

{
  "data": {
    "updateApprovalLevel": {
      "id": "01JNQX4KZB7WNVR3MPXT6A0002",
      "name": "Manager",
      "threshold_price_requested": 15000.0,
      "threshold_price_approved": 12000.0
    }
  }
}

Errors

Example Response

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