Skip to content
GitHub

Viewing and revoking grants

Grants are the mechanism in Open Payments by which your account holders give permission to a client application to access their accounts and send payments on their behalf. Providing your account holders the ability to view and revoke grants is not required to implement and operate Rafiki, but allowing them to do so is critical to providing an optimal user experience.

View grants

Use the Grants GraphQL query to look up all grants associated with a wallet address.

query Grants(
$after: String
$before: String
$first: Int
$last: Int
$filter: GrantFilter
) {
grants(
after: $after
before: $before
first: $first
last: $last
filter: $filter
) {
edges {
cursor
node {
id
client
createdAt
state
access {
createdAt
id
identifier
limits {
interval
receiveAmount {
assetScale
value
assetCode
}
receiver
debitAmount {
assetCode
assetScale
value
}
}
actions
type
}
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}

Revoke a grant

Use the revokeGrant GraphQL mutation to revoke a particular grant.

mutation revokeGrant($input: RevokeGrantInput!) {
revokeGrant(input: $input) {
id
}
}