createPaymentForRequestSession
Overview
This mutation takes the required inputs and creates a payment session based on the requested payment.
Special Considerations
N/A
Inputs
createPaymentForRequestSessionArgs
Required Data
paymentRequestId: string
paymentSessionType: PaymentSessionType
Returns
Promise<CreatePaymentForRequestResult>
A promise containing either a success message:
message: string
or a call for more data:
dataNeeded: dataNeededForPayment
balanceRefreshRequired: balanceRefresh
Example
Running this mutation:
mutation {
createPaymentForRequest (data: {
paymentRequestId: "ckb8bx8js00re0772mykjh0ve"
paymentSessionType: MAKE_PAYMENT
}) {
... on SuccessResult {
message
}
... on ActionRequiredForPayment {
dataNeeded {
idUpload
personalTaxId
}
balanceRefreshRequired {
providerAccountId
bankAccountId
type
}
}
}
}
Gives us:
{
"data": {
"createPaymentForRequestSession": {
"message": "Payment for request session created!"
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
You cannot pay yourself. (I-4902)
- You've attempted to create a payment session request from yourself
There was an issue accessing your bank account information. (I-4903)
- Bank information may not be available from the requested payment