confirm_user_request
The requester accepts the admin's quote and splits each fee: corporate_amount is paid by the
company, and the rest of the fee's price by the requester. It moves the request out of ISSUED in
the status flow — to AWAITING_PERSONAL_PAYMENT when the
requester keeps a part, or to CONFIRMED when the company pays everything.
It is a GraphQL mutation returning UserRequest. Only the user who created the request can
call it, and only while the request is ISSUED.
Input
input: ConfirmUserRequestInput!
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The user request to confirm. |
fees new | [ConfirmUserRequestFeeInput!] | No | The company's share of each fee. A fee left out is paid fully by the company. |
corporate_amount removed | Decimal | — | Replaced by each fee's corporate_amount. Sending it now fails the request. |
ConfirmUserRequestFeeInput:
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | A fee id from the request's fees. |
corporate_amount | Decimal | Yes | The company's share, from 0 to the fee's price, in the request's currency. 0 means the requester pays the whole fee. |
The request's totals follow from the fees:
corporate_amountis the sum of the fees'corporate_amount.personal_amountisamount - corporate_amount: what the requester pays withbegin_personal_payment.- A request quoted before fees existed has no fees to send: the company pays its whole
amount.
mutation {
confirm_user_request(input: {
id: "3JMY..."
fees: [
{ id: "3Jwm...seat", corporate_amount: 100000 }
{ id: "3Jwm...other", corporate_amount: 0 }
]
}) {
id code status amount currency corporate_amount personal_amount
fees { id fee_type price corporate_amount }
}
}
What happens next
| Split | Status after confirming | Next |
|---|---|---|
The requester keeps a part (personal_amount > 0) | AWAITING_PERSONAL_PAYMENT | The requester pays it with begin_personal_payment; the request then moves to CONFIRMED |
| The company pays everything | CONFIRMED | See below |
From CONFIRMED:
| Company's share | Result |
|---|---|
| Above 0, and the company's policy needs approval | Goes to the company's approvers, level by level. RESOLVED once every level approves, REJECTED if one rejects. Track it with booking_request_progress. |
| 0, or the policy needs no approval | RESOLVED right away |
The response reports the status confirm set, so it can say CONFIRMED when the request has already
moved on to RESOLVED. Refetch the request before rendering its status.
Errors
| Error | Meaning |
|---|---|
user_request_fee_not_found | A fee id isn't one of the request's fees. |
duplicate_user_request_fee | The same fee id was sent twice. |
invalid_corporate_amount | A fee's corporate_amount is negative. |
corporate_amount_exceeds_price | A fee's corporate_amount is more than its price. |
<status>_user_request | The request isn't ISSUED — for example confirmed_user_request. |
unauthorized | The caller didn't create the request. |
not_found | Unknown id. |
It can also return Middleware Errors. All user request errors are listed together in User Request Errors.