# Gas station

Automatic fee sponsorship service for Ripple Custody platform

## Get sponsor configuration for an account

 - [GET /v1/domains/{domainId}/account/{accountId}/sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorcontroller_getsponsor.md)

## Create a sponsor configuration

 - [POST /v1/domains/{domainId}/account/{accountId}/sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorcontroller_createsponsor.md)

## Update a sponsor configuration

 - [PUT /v1/domains/{domainId}/account/{accountId}/sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorcontroller_updatesponsor.md)

## Delete a sponsor configuration

 - [DELETE /v1/domains/{domainId}/account/{accountId}/sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorcontroller_deletesponsor.md)

## List all sponsor (gas station) accounts in a domain

 - [GET /v1/domains/{domainId}/sponsors](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_listsponsors.md)

## Find which gas station sponsors a specific account

 - [GET /v1/domains/{domainId}/sponsors/account/{accountId}/sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_getaccountsponsor.md): Returns the sponsorship status for the given account, following the sponsorship hierarchy: 1) Domain-level sponsor for the account domain, 2) Parent domain sponsors (if includeSubDomains=true), 3) Account-level sponsor. Returns isSponsored=false if no sponsor is found.

## List gas stations that could sponsor a specific account

 - [GET /v1/domains/{domainId}/sponsors/account/{accountId}/valid-sponsors](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_getvalidsponsors.md): Returns the gas stations that could be chosen as sponsor for the given account: every sponsor in the account domain or one of its ancestor domains, excluding the account itself. If the account is already effectively sponsored, returns isSponsored=true with the existing sponsor and an empty items list (an entity is only sponsored once), unless includeAll=true, in which case items still lists the lineage candidates (the current sponsor may appear among them).

## Resolve domain-wide sponsorship for a domain

 - [GET /v1/domains/{domainId}/sponsors/domain-sponsor](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_getdomainsponsor.md): Returns whether the domain is sponsored domain-wide, without requiring an account ID. Resolution follows the sponsorship hierarchy: 1) Domain-level sponsor for the domain itself, 2) Parent domain sponsors that have includeSubDomains=true. Account-level sponsorships are NOT considered. Returns isSponsored=false if no domain-wide sponsor is found.

## List accounts in a domain with their sponsorship status

 - [GET /v1/domains/{domainId}/sponsors/sponsored-accounts](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_listsponsoredaccounts.md): Returns all accounts within the domain along with whether each account is currently sponsored by a Gas Station.

## List sub-domains in a domain with their sponsorship status

 - [GET /v1/domains/{domainId}/sponsors/sponsored-domains](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorscontroller_listsponsoreddomains.md): Returns all sub-domains within the domain along with whether each sub-domain is currently sponsored by a Gas Station.

## List sponsorable domains

 - [GET /v1/domains/{domainId}/account/{entityId}/sponsorable-domains](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_getsponsorabledomains.md)

## Add sponsored domains

 - [POST /v1/domains/{domainId}/account/{entityId}/sponsored-domains](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_addsponsoreddomains.md)

## List sponsorable accounts

 - [GET /v1/domains/{domainId}/account/{entityId}/sponsorable-accounts](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_getsponsorableaccounts.md)

## Add sponsored accounts

 - [POST /v1/domains/{domainId}/account/{entityId}/sponsored-accounts](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_addsponsoredaccounts.md)

## Add a single sponsored account (idempotent)

 - [PUT /v1/domains/{domainId}/account/{entityId}/sponsored-accounts/domains/{sponsoredAccountDomainId}/accounts/{sponsoredAccountId}](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_addsponsoredaccount.md)

## Remove a single sponsored account

 - [DELETE /v1/domains/{domainId}/account/{entityId}/sponsored-accounts/domains/{sponsoredAccountDomainId}/accounts/{sponsoredAccountId}](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/sponsorlistcontroller_removesponsoredaccount.md)

## Get audit events for sponsorship configuration changes

 - [GET /v1/domains/{domainId}/sponsor/events](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/eventcontroller_getevents.md)

## Liveness check

 - [GET /v1/health](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/healthcontroller_liveness.md)

## Readiness check

 - [GET /v1/ready](https://docs.ripple.com/products/custody/reference/api/openapi/gas-station/healthcontroller_readiness.md)

