> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ripio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Terms and Conditions

> How to manage Terms and Conditions acceptance for customers when integrating via the Ramps API.

## Overview

The Partner integrating with Ripio via API shall be responsible for ensuring that their customers explicitly accept Ripio's Terms and Conditions (T\&C) prior to performing any on-ramp or off-ramp operations.

## How it works

When T\&C acceptance is required, attempting to create an on-ramp or off-ramp session without a prior acceptance will return an error:

```json theme={null}
{
  "code": 20039,
  "type": "TermsAndConditionsNotAcceptedException",
  "detail": {
    "message": "Customer '<external_ref> - <email>' has not accepted the current Terms and Conditions."
  },
  "status": 400
}
```

## Checking acceptance status

Before showing the T\&C screen to a customer, check whether they have already accepted the currently active Terms and Conditions. This avoids presenting the acceptance screen unnecessarily to returning customers.

```http theme={null}
GET /api/v1/customers/{customerId}/termsAcceptance/
```

**Response example — customer has already accepted:**

```json theme={null}
{
  "termsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "country": "AR",
  "version": "1.0",
  "url": "https://example.com/terms/v1.0",
  "accepted": true,
  "acceptedAt": "2024-06-01T12:00:00Z"
}
```

**Response example — customer has not yet accepted:**

```json theme={null}
{
  "termsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "country": "AR",
  "version": "1.0",
  "url": "https://example.com/terms/v1.0",
  "accepted": false,
  "acceptedAt": null
}
```

When `accepted` is `true`, proceed directly with on-ramp or off-ramp operations. When `accepted` is `false`, display the T\&C document (via `url`) and record the customer's acceptance before continuing.

<Note>
  When no active Terms and Conditions exist for the account's country, `accepted` is always `true` and
  the term fields (`termsId`, `version`, `url`) are `null`. The customer is not blocked and no
  acceptance is required.
</Note>

## Acceptance Flow

### 1. Get the active Terms and Conditions

Retrieve the current active T\&C for your account's country. This returns a `termsId` that you'll need in the next step.

```http theme={null}
GET /api/v1/termsAndConditions/
```

**Response example:**

```json theme={null}
{
  "termsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "country": "AR",
  "version": "1.0",
  "url": "https://example.com/terms/v1.0"
}
```

Show the T\&C document (via `url`) to the customer and collect their acceptance.

### 2. Record the customer's acceptance

Once the customer has accepted, send the acceptance record to the API including the `termsId`, the customer's IP address, and optionally their user agent.

```http theme={null}
POST /api/v1/customers/{customerId}/acceptTerms/
```

**Request body:**

```json theme={null}
{
  "termsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "ipAddress": "192.168.1.100",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
```

**Response example (`201 Created`):**

```json theme={null}
{
  "termsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "ipAddress": "192.168.1.100",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
  "acceptedAt": "2024-06-01T12:00:00Z"
}
```

After a successful acceptance, the customer can proceed with on-ramp and off-ramp operations normally.
