# Ripple Collections (alpha)

The Ripple Collection APIs are used to manage collections, manage payment channels, manage partners and settlements.
## API Environments
The Ripple Collection APIs offers the following environments:
| <div style="width:90px">Environment</div>  | Base URL                      | Description                               |
| ------------------------------------------ | ----------------------------- | ----------------------------------------- |
| Sandbox                                    | `https://docs.ripple.com/products/collections/_mock/api/collections` | Sandbox environment with mock data which does not require auth.|
| UAT                                       | `https://api.test.ripple.com` | UAT environment with simulated transactions. |
| Production                                 | `https://api.ripple.com`      | Production environment                    |

For guides on API authentication, idempotency, and webhook verification, see the sidebar. 

Version: 0.0.1

## Servers

```
https://api.test.ripple.com
```

```
https://api.ripple.com
```

## Security

### Bearer

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

[Ripple Collections (alpha)](https://docs.ripple.com/_bundle/products/collections/@v0/api/collections.yaml)

## Authentication

Endpoints for authentication

### Request an access token

 - [POST /v2/oauth/token](https://docs.ripple.com/products/collections/v0/api/collections/authentication/authenticate.md): Request an access token for authentication with Ripple APIs.

You need to request a token for the environment you want to authenticate with.

Note: The length of the access token isn't fixed, hence it can vary. Avoid validating tokens based on character length.

Tutorials

* Learn how to Request an access token.

#### Environments

| Environment | Domain | Description |
| --- | --- | --- |
| UAT | api.test.ripple.com | UAT environment with simulated transactions. |
| Production | api.ripple.com | Production environment |

### Test access token

 - [GET /v2/oauth/token/test](https://docs.ripple.com/products/collections/v0/api/collections/authentication/testauthtoken.md): Test if an access token can be used for authentication with Ripple APIs and how much time remains on it.

## Collection Links

Endpoints for managing one-time collection links

### List collections

 - [GET /v0/collections/links](https://docs.ripple.com/products/collections/v0/api/collections/collection-links/listcollections.md): Retrieves a list of collections, filterable by query parameters.

### Create a collection

 - [POST /v0/collections/links](https://docs.ripple.com/products/collections/v0/api/collections/collection-links/createcollection.md): Creates a new payment link for a collection.

### Get collection details

 - [GET /v0/collections/links/{collection_id}](https://docs.ripple.com/products/collections/v0/api/collections/collection-links/getcollectionbyid.md): Retrieves the details of a specific collection by its ID.

### Cancel a collection

 - [POST /v0/collections/links/cancel](https://docs.ripple.com/products/collections/v0/api/collections/collection-links/cancelcollection.md): API to cancel a payment collection.

## Collection Channels

Endpoints for managing persistent collection channels

### List channels

 - [GET /v0/collections/channels](https://docs.ripple.com/products/collections/v0/api/collections/collection-channels/listchannels.md): Retrieves a list of channels, filterable by query parameters.

### Create a channel

 - [POST /v0/collections/channels](https://docs.ripple.com/products/collections/v0/api/collections/collection-channels/createchannel.md): Creates a new payment channel between payer and beneficiary.

### Get channel details

 - [GET /v0/collections/channels/{channel_id}](https://docs.ripple.com/products/collections/v0/api/collections/collection-channels/getchannelbyid.md): Retrieves the details of a specific channel by its ID.

## Partners

Endpoints for managing partners who can transact

### List partners

 - [GET /v0/collections/partners](https://docs.ripple.com/products/collections/v0/api/collections/partners/listpartners.md): Retrieves a list of partners, filterable by ID or type.

### Create a partner

 - [POST /v0/collections/partners](https://docs.ripple.com/products/collections/v0/api/collections/partners/createpartner.md): This API allows users to add new parties who can transact.

### Get partner by ID

 - [GET /v0/collections/partners/{partner_id}](https://docs.ripple.com/products/collections/v0/api/collections/partners/getpartnerbyid.md): This API allows users to retrieve a specific partner by their ID.

### Update a partner

 - [PUT /v0/collections/partners/{partner_id}](https://docs.ripple.com/products/collections/v0/api/collections/partners/updatepartner.md): API to update a partner to use in collections API.

## Settlements

Endpoints for managing settlements

### List settlements

 - [GET /v0/collections/settlements](https://docs.ripple.com/products/collections/v0/api/collections/settlements/listsettlements.md): API to fetch first party payouts (settlements).

### Get settlement by ID

 - [GET /v0/collections/settlements/{settlement_id}](https://docs.ripple.com/products/collections/v0/api/collections/settlements/getsettlementbyid.md): API to fetch a first party payout (settlement to our customer).

## Transactions

Endpoints for viewing transactions across collection links and channels

### List Transactions

 - [GET /v0/collections/transactions](https://docs.ripple.com/products/collections/v0/api/collections/transactions/listtransactions.md): API to fetch transactions across collections links or channels (transactions).

### Get transaction by ID

 - [GET /v0/collections/transactions/{transaction_id}](https://docs.ripple.com/products/collections/v0/api/collections/transactions/gettransactionbyid.md): API to fetch a transaction (payment from a payer to beneficiary)

## Webhooks

Endpoints for managing webhook registrations

### List webhooks

 - [GET /v0/collections/webhooks](https://docs.ripple.com/products/collections/v0/api/collections/webhooks/listwebhooks.md)

### Create webhooks

 - [POST /v0/collections/webhooks](https://docs.ripple.com/products/collections/v0/api/collections/webhooks/createwebhooks.md): Creates one webhook per event type supplied.

### Get a webhook

 - [GET /v0/collections/webhooks/{webhook_id}](https://docs.ripple.com/products/collections/v0/api/collections/webhooks/getwebhook.md)

### Update a webhook

 - [PUT /v0/collections/webhooks/{webhook_id}](https://docs.ripple.com/products/collections/v0/api/collections/webhooks/updatewebhook.md)

### Delete a webhook

 - [DELETE /v0/collections/webhooks/{webhook_id}](https://docs.ripple.com/products/collections/v0/api/collections/webhooks/deletewebhook.md)

