Skip to main content

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!

FieldTypeRequiredDescription
idStringYesThe user request to confirm.
fees new[ConfirmUserRequestFeeInput!]NoThe company's share of each fee. A fee left out is paid fully by the company.
corporate_amount removedDecimal—Replaced by each fee's corporate_amount. Sending it now fails the request.

ConfirmUserRequestFeeInput:

FieldTypeRequiredDescription
idStringYesA fee id from the request's fees.
corporate_amountDecimalYesThe 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_amount is the sum of the fees' corporate_amount.
  • personal_amount is amount - corporate_amount: what the requester pays with begin_personal_payment.
  • A request quoted before fees existed has no fees to send: the company pays its whole amount.
Mutation
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​

SplitStatus after confirmingNext
The requester keeps a part (personal_amount > 0)AWAITING_PERSONAL_PAYMENTThe requester pays it with begin_personal_payment; the request then moves to CONFIRMED
The company pays everythingCONFIRMEDSee below

From CONFIRMED:

Company's shareResult
Above 0, and the company's policy needs approvalGoes 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 approvalRESOLVED right away
Refetch after confirming

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​

ErrorMeaning
user_request_fee_not_foundA fee id isn't one of the request's fees.
duplicate_user_request_feeThe same fee id was sent twice.
invalid_corporate_amountA fee's corporate_amount is negative.
corporate_amount_exceeds_priceA fee's corporate_amount is more than its price.
<status>_user_requestThe request isn't ISSUED — for example confirmed_user_request.
unauthorizedThe caller didn't create the request.
not_foundUnknown id.

It can also return Middleware Errors. All user request errors are listed together in User Request Errors.