> For the complete documentation index, see [llms.txt](https://plexo.gitbook.io/rest-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plexo.gitbook.io/rest-api/tools/api-explorer.md).

# API Explorer

Interactive API reference with live testing capabilities powered by OpenAPI 3.1.

## Overview

The API Explorer provides a fully interactive interface to explore and test the Plexo Payment Gateway API. You can:

* 📖 Browse all API endpoints with complete documentation
* 🧪 Test API calls directly from your browser
* 🔐 Configure authentication credentials
* 📝 Generate code examples in multiple languages
* 📊 View request/response examples
* ⚡ Get instant feedback on API responses

## Getting Started

### 1. Get API Credentials

Before testing the API, you'll need:

* **Username** and **Password** (Basic Authentication)
* **Merchant ID** (provided during onboarding)
* **Test Environment Access**

Don't have credentials? [Contact Support](mailto:soporte@plexo.com.uy) or [Request Access](https://plexo.com/contact)

### 2. Configure Authentication

1. Click on any endpoint below
2. Click the **"Authorize"** button (🔒 icon)
3. Enter your username and password
4. Click **"Authorize"** to save credentials

Your credentials are stored locally in your browser and never sent to our documentation servers.

### 3. Test an Endpoint

1. Select an endpoint from the list
2. Fill in required parameters
3. Click **"Try it out"**
4. View the response

***

## Interactive API Reference

{% hint style="info" %}
**OpenAPI Specification**: GitBook imports the live testing OpenAPI document from <https://api.testing.plexo.com.uy/openapi/v2.json>. For interactive browsing, use Scalar on the environment you are targeting.
{% endhint %}

***

## Alternative: Full API Documentation

For a complete, browsable view of the live API contract, visit:

**Scalar UI**: <https://api.plexo.com.uy/scalar/v2>

Scalar provides:

* Complete API documentation with all endpoints
* Advanced search with keyboard shortcuts (Ctrl/Cmd + K)
* Request history and favorites
* Multiple environment support
* Code generation in 8+ languages
* Dark mode support
* Request/response examples for every endpoint

***

## Code Examples

### Quick Start: Create a Customer

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "https://api.plexo.com.uy/v1/customers" \
  -u "username:password" \
  -H "Content-Type: application/json" \
  -d '{
    "referenceId": "customer-12345",
    "email": "john.doe@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+1-555-0123"
  }'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const credentials = btoa('username:password');

const response = await fetch('https://api.plexo.com.uy/v1/customers', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    referenceId: 'customer-12345',
    email: 'john.doe@example.com',
    firstName: 'John',
    lastName: 'Doe',
    phone: '+1-555-0123'
  })
});

const customer = await response.json();
console.log('Customer created:', customer.id);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.post(
    'https://api.plexo.com.uy/v1/customers',
    auth=('username', 'password'),
    json={
        'referenceId': 'customer-12345',
        'email': 'john.doe@example.com',
        'firstName': 'John',
        'lastName': 'Doe',
        'phone': '+1-555-0123'
    }
)

customer = response.json()
print(f"Customer created: {customer['id']}")
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

var client = new HttpClient();
var credentials = Convert.ToBase64String(
    Encoding.ASCII.GetBytes("username:password")
);
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Basic", credentials);

var customer = new
{
    referenceId = "customer-12345",
    email = "john.doe@example.com",
    firstName = "John",
    lastName = "Doe",
    phone = "+1-555-0123"
};

var response = await client.PostAsJsonAsync(
    "https://api.plexo.com.uy/v1/customers",
    customer
);

var result = await response.Content.ReadFromJsonAsync<Customer>();
Console.WriteLine($"Customer created: {result.Id}");
```

{% endtab %}
{% endtabs %}

***

## Authentication Guide

### Basic Authentication

All API requests require Basic Authentication:

```
Authorization: Basic <base64(username:password)>
```

**Example**:

```
username: john@merchant.com
password: secure_password_123
Base64: am9obkBtZXJjaGFudC5jb206c2VjdXJlX3Bhc3N3b3JkXzEyMw==
Header: Authorization: Basic am9obkBtZXJjaGFudC5jb206c2VjdXJlX3Bhc3N3b3JkXzEyMw==
```

### Testing with Try It Out

1. Click **"Authorize"** button (🔒 icon)
2. Enter your **username** in the Username field
3. Enter your **password** in the Password field
4. Click **"Authorize"**
5. Close the dialog

Your credentials are now set for all API calls in this session.

### Security Notes

{% hint style="warning" %}
**Never use production credentials** when testing in the API Explorer. Always use test environment credentials.
{% endhint %}

* Credentials are stored in your browser's local storage
* Credentials are NOT sent to GitBook or documentation servers
* API requests go directly from your browser to api.plexo.com.uy
* Clear credentials by clicking "Logout" or clearing browser data

[View Complete Authentication Guide →](/rest-api/getting-started/authentication.md)

***

## Common Use Cases

### Use Case 1: Create Customer and Process Payment

```mermaid
sequenceDiagram
    participant You
    participant API
    participant Payment System

    You->>API: POST /v1/customers
    API-->>You: Customer ID
    You->>API: POST /v1/sessions (tokenization)
    API-->>You: Session URL
    Note over You: User completes 3DS in browser
    You->>API: POST /v1/payments (with token)
    API->>Payment System: Process payment
    Payment System-->>API: Authorization
    API-->>You: Payment successful
```

**Steps**:

1. Create customer: `POST /v1/customers`
2. Create tokenization session: `POST /v1/sessions`
3. User completes 3DS authentication
4. Create payment with token: `POST /v1/payments`

[View Full Tutorial →](/rest-api/payments/first-payment.md)

### Use Case 2: Capture Pre-Authorized Payment

```mermaid
sequenceDiagram
    participant You
    participant API

    You->>API: POST /v1/payments (authorize only)
    API-->>You: Payment authorized
    Note over You: Verify order, ship product
  You->>API: POST /v1/payments/{id}/captures
    API-->>You: Payment captured
```

**Steps**:

1. Create payment with `capture: false`
2. Verify order and ship product
3. Capture payment: `POST /v1/payments/{id}/captures`

[View Payment Lifecycle Guide →](/rest-api/core-concepts/transaction-lifecycle.md)

### Use Case 3: Process Refund

**Steps**:

1. Get payment details: `GET /v1/payments/{id}`
2. Process refund: `POST /v1/payments/{id}/refunds`

[View Refunds Guide →](/rest-api/core-concepts/transaction-lifecycle.md)

***

## Rate Limits

Interactive API testing is subject to rate limits:

| Endpoint Category       | Rate Limit   | Time Window |
| ----------------------- | ------------ | ----------- |
| **Customer Operations** | 100 requests | 1 minute    |
| **Session Creation**    | 50 requests  | 1 minute    |
| **Payment Processing**  | 30 requests  | 1 minute    |
| **Read Operations**     | 200 requests | 1 minute    |

If you exceed rate limits, you'll receive a `429 Too Many Requests` response.

For production use with higher limits, [contact our sales team](mailto:soporte@plexo.com.uy).

***

## Troubleshooting

### Common Issues

**❌ 401 Unauthorized**

* Check your username and password
* Ensure credentials are for the test environment
* Click "Authorize" to set credentials

**❌ 404 Not Found**

* Verify the endpoint URL is correct
* Check the API version (v1 vs v2)
* Ensure resource ID exists

**❌ 400 Bad Request**

* Validate request body format (must be valid JSON)
* Check required fields are present
* Verify field types match schema

**❌ 429 Too Many Requests**

* You've exceeded rate limits
* Wait 60 seconds before retrying
* Reduce request frequency

**❌ CORS Error**

* This should not occur in GitBook
* If testing locally, use Scalar UI instead
* Contact support if issue persists

[View Complete Troubleshooting Guide →](/rest-api/reference/error-codes.md)

***

## Additional Resources

### Documentation

* [Getting Started Guide](/rest-api/payments/first-payment.md) - First API integration
* [Authentication Guide](/rest-api/getting-started/authentication.md) - Complete auth documentation
* [API Reference](/rest-api/api-reference/api-reference.md) - Detailed endpoint documentation
* [Code Examples](/rest-api/tools/code-examples.md) - Multi-language snippets

### Tools

* [Postman Collection](/rest-api/tools/postman-collection.md) - Download complete collection
* [Scalar UI](https://api.plexo.com.uy/scalar/v2) - Advanced API explorer
* [API Changelog](https://github.com/plexouy/gitbook-public-docs/blob/main/api-rest/en/release-notes/changelog.md) - Track API changes

### Support

* **Email**: <soporte@plexo.com.uy>
* **Documentation Issues**: [GitHub Issues](https://github.com/plexouy/gitbook-public-docs/issues)
* **Status Page**: [status.plexo.com](https://status.plexo.com)

***

## Feedback

Help us improve the API Explorer!

**Found an issue?** [Report it on GitHub](https://github.com/plexouy/gitbook-public-docs/issues) **Have a suggestion?** [Share your feedback](https://github.com/plexouy/gitbook-public-docs/discussions) **Need help?** [Contact Support](mailto:soporte@plexo.com.uy)

***

**Last Updated**: December 11, 2025 **API Version**: v1 **Powered By**: GitBook OpenAPI Integration + Scalar UI
