updateRefundSession
Overview
This mutation takes inputs and updates the current refund session accordingly.
Special Considerations
- All fields must be updated before the refund session can be submitted.
Inputs
MutationUpdateRefundSessionArgs
Required Data
amount: Float description: String message: String (Optional) valueDate: DateTime quoteBasis: String (Optional) reason: RefundReason
Returns
Promise<UpdateRefundSessionResult>
A promise containing either a success message:
message: string
or a call for more data:
dataNeeded: dataNeededForPayment
balanceRefreshRequired: balanceRefresh
Example
Running this mutation:
mutation {
updateRefundSession(data: {
amount: 5,
description: "test",
message: "Testing",
valueDate: "2020-06-16",
quoteBasis: "Arbitrary",
reason: DUPLICATE
}) {
...on SuccessResult {
message
}
...on ActionRequiredForPayment {
dataNeeded {
idUpload
personalTaxId
}
balanceRefreshRequired {
bankAccountId
providerAccountId
type
}
}
}
}
Gives us:
{
"data": {
"updateRefundSession": {
"message": "Refund session successfully updated"
}
}
}
or
{
"data": {
"updateRefundSession": {
"dataNeeded": {
"idUpload": false,
"personalTaxId": false
}
balanceRefreshRequired {
"bankAccountId": "1233"
"providerAccountId": "1234"
"type": USER_BALANCE_REFRESH_REQUIRED
}
}
}
}
Common Errors
When running this mutation some of the common errors encountered include:
This is not a valid refund session. (I-4718)
- The current refund session is not valid. Try to make a new session.
You cannot refund more than the original payment. Try an amount equal or less than the refundable amount. (I-4728)
- The amount input is greater than the original payment.
You have reached your maximum refund attempts for this payment. (I-4720)
- Too many attempts have been made for this refund.