> ## 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.

# Forwarding end-user context

> Optional headers that tell Ripio the IP address, user agent and device of the end user behind each request, for traceability and fraud prevention.

When you integrate via the API, every request reaches Ripio from **your** servers. Ripio does not see the end user's own network or device, so it cannot tell two customers on the same phone apart, or notice that an operation comes from somewhere unusual for that customer.

Three optional headers fill that gap. You send them with the requests your customers trigger, and Ripio records them against the customer for **traceability** and **fraud prevention**.

| Header | What to send | Limit |
| - | - | - |
| `X-Ripio-User-Ip` | The public IP address of the end user's device, IPv4 or IPv6 | 45 characters |
| `X-Ripio-User-Agent` | The `User-Agent` of the end user's browser or app | 500 characters, longer values are truncated |
| `X-Ripio-User-Device-Id` | A stable identifier of the end user's device, as your app defines it | 200 characters, longer values are truncated |

> [!NOTE]
>
> The headers are **optional**. A request without them works exactly the same: nothing is rejected, and nothing about the customer's experience changes. Sending them is recommended, because it gives Ripio's risk checks the information they would otherwise not have.

## Send the end user's values, never your server's

This is the one thing to get right. The values describe **the person operating**, so they have to come from their device:

1. **Capture them on your frontend** — the browser or app the customer is using.
2. **Forward them to your backend** with the customer's request.
3. **Send them to Ripio** in these headers when your backend calls the API.

Do **not** fill them from your own server: its IP address, the user agent of your HTTP client, or a fixed identifier would make every customer look like the same machine — a datacenter — and turn the signal into noise. If you cannot get a value from the customer's device, leave that header out. Each header is independent, so sending only the ones you have is fine.

> [!WARNING]
>
> Ripio never uses the address your request comes from as the customer's IP: for an API integration, that address is your infrastructure. `X-Ripio-User-Ip` is the only way the customer's IP reaches Ripio.

The values are **declared by you**: Ripio records them as you send them, as the context of your customer's request. Send a valid IPv4 or IPv6 address in `X-Ripio-User-Ip`; an invalid one does not fail the request, but none of the three values of that request is recorded.

## Example

```http theme={null}
POST /api/v1/onramp/ HTTP/1.1
Host: skala.ripio.com
Authorization: Bearer <access_token>
Content-Type: application/json
X-Ripio-User-Ip: 203.0.113.24
X-Ripio-User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
X-Ripio-User-Device-Id: 8d3f2c1a-6b7e-4f9a-a1d2-3c4b5e6f7a8b

{
  "customerId": "8142b065-79c4-4f48-9e33-11b17bc658d4",
  "quoteId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "depositAddress": "0x4e88BBeFF059BDDF5BF90ee0816E86eDf4214b32",
  "externalRef": "e6c4f1ec-899f-43b5-8479-c2529e3f9c70"
}
```

## Where they are recorded

The headers can be sent on any request, but they are recorded on the actions a customer takes — the ones where knowing who is behind the request matters:

| Action | Endpoint |
| - | - |
| Create an on-ramp order or session | [`POST /api/v1/onramp/`](https://docs.ripio.com/ramps-api/on-ramp/create-on-ramp-order) · [`POST /api/v1/onrampSession/`](https://docs.ripio.com/ramps-api/on-ramp/create-on-ramp-session) |
| Create an off-ramp order or session | [`POST /api/v1/offramp/`](https://docs.ripio.com/ramps-api/off-ramp/create-off-ramp-order) · [`POST /api/v1/offrampSession/`](https://docs.ripio.com/ramps-api/off-ramp/create-off-ramp-session) |
| Submit KYC information | [`POST /api/v1/customers/{customerId}/kyc/`](https://docs.ripio.com/ramps-api/kyc/submit-kyc-information) |
| Validate a KYC one-time code | [`POST /api/v1/customers/{customerId}/kyc/otp/validate/`](https://docs.ripio.com/ramps-api/kyc/validate-kyc-otp) · `POST /api/v1/customers/{customerId}/otp/` |
| Accept the Terms & Conditions | [`POST /api/v1/customers/{customerId}/acceptTerms/`](https://docs.ripio.com/ramps-api/customers/accept-terms) |
| Create a deposit or destination account | [`POST /api/v1/customers/{customerId}/fiatAccount/`](https://docs.ripio.com/ramps-api/customers/create-deposit-account) · [`POST /api/v1/fiatAccounts/`](https://docs.ripio.com/ramps-api/fiat-accounts/create-fiat-account) |
| Request a refund | The four customer-scoped refund endpoints — see [Refunds](https://docs.ripio.com/ramps-api/refunds/overview.md) |
| Submit the investor profile (Brazilian accounts) | [`POST /api/v1/customers/{customerId}/investorProfile/`](https://docs.ripio.com/ramps-api/investor-profile/submit-investor-profile) |

They are recorded only when the request succeeds: a rejected request leaves no record. On any other endpoint the headers are accepted and ignored, so it is safe to attach them to every call your backend makes on a customer's behalf.

## Widget integrations

Partners on the [Ramps widget](https://docs.ripio.com/ramps-api/widget/overview.md) do not need any of this: the widget captures the end user's context itself and sends it with every operation.


## Related topics

- [Off-Ramp integration](https://docs.ripio.com/ramps-api/guides/off-ramp-integration.md)
- [Accept Terms and Conditions](https://docs.ripio.com/ramps-api/customers/accept-terms.md)
- [Create Deposit Account](https://docs.ripio.com/ramps-api/customers/create-deposit-account.md)
- [On-Ramp integration](https://docs.ripio.com/ramps-api/guides/on-ramp-integration.md)
- [Validate KYC OTP](https://docs.ripio.com/ramps-api/kyc/validate-kyc-otp.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.