> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-colombia.wallib.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-colombia.wallib.io/_mcp/server.

# Third Authentication

POST https://third/v1/authentication
Content-Type: application/json

Authenticates a provider and returns a JWT token used to authorize subsequent API requests.

Send the provider's **email** and **password** in the request body along with the **x-api-key** header. On success, the response includes a **JWT token** that must be passed as a Bearer token in all protected endpoints.

**Headers**
- `x-api-key`: Your API key credential.

**Body fields**
- `email`: The provider's registered email address.
- `password`: The provider's account password.

Reference: https://docs-colombia.wallib.io/wallib-payments-api-colombia/third-authentication

## Request

### Headers

- `x-api-key` (string, optional)

### Body (application/json)

- `email` (string, required)
- `password` (string, required)

## Response

### 201

Created

- `id` (integer, required)
- `email` (string, required)
- `token` (string, required)
- `refreshToken` (string, required)
- `expiresAt` (datetime, required)

## Examples

**Request**

```json
{
  "email": "{{EMAIL_PROVIDER}}",
  "password": "{{PASSWORD_PROVIDER}}"
}
```

**Response**

```json
{
  "id": 50057,
  "email": "374908131@wallib.com",
  "token": "eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJpc3N1ZXIubW9vbiIsImp0aSI6IjUwMTQ2ZGY2LTE4YWItNGRhZS1hYzkyLTVhZGZkNjcyM2IzMSIsImlhdCI6MTc0MTI2NzIxOCwiZXhwIjoxNzQxMjc0NDE4LCJzdWIiOiJhcHAubWFpbiIsImF1ZCI6Ik1BSU4iLCJtb2QiOlsiQVVUSF9TU09fTUFJTiJdLCJwZXIiOlsiQVVUSF9TU09fTUFJTl9DUkVBVEVfQUNDRVNTX1RPS0VOIl0sInVzZXIiOnsiZmlyc3RuYW1lIjoiU3RyaWtlIiwiY29tcGFuaWVzIjpbeyJpZCI6MSwidGltZXpvbmUiOiJBbWVyaWNhL0JvZ290YSIsIm5hbWUiOiJpc3N1ZXIubW9vbiJ9XSwicGhvbmUiOiIrMTMxMjM0MDU0MzkiLCJpZCI6NDU3LCJlbWFpbCI6IjM3NDkwODEzMUB3YWxsaWIuY29tIiwiY291bnRyeV9pZCI6MSwibGFzdG5hbWUiOiJXYWxsZXQifX0.uWUC7zJaeQCPnDEhIFx1twmGOOb4otKCHLkPLhhzPgboYPGJz_wqqMWpqqaKDfvL4PhHXh2VAv7W_iLNDGBrcA",
  "refreshToken": "6a13b0601acddd811a214e7eeaf854ed1d2ce9ae35772f6580bd0d73f1a8d2ae6de0b2e8c261ab3f0161f5ae9fc9b5298854504acb6831e0a6a414b388ba5b97",
  "expiresAt": "2025-03-06T14:20:19"
}
```

**SDK Code**

```python Third Authentication_example
import requests

url = "https://third/v1/authentication"

payload = {
    "email": "{{EMAIL_PROVIDER}}",
    "password": "{{PASSWORD_PROVIDER}}"
}
headers = {
    "x-api-key": "{{X_API_KEY}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Third Authentication_example
const url = 'https://third/v1/authentication';
const options = {
  method: 'POST',
  headers: {'x-api-key': '{{X_API_KEY}}', 'Content-Type': 'application/json'},
  body: '{"email":"{{EMAIL_PROVIDER}}","password":"{{PASSWORD_PROVIDER}}"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Third Authentication_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://third/v1/authentication"

	payload := strings.NewReader("{\n  \"email\": \"{{EMAIL_PROVIDER}}\",\n  \"password\": \"{{PASSWORD_PROVIDER}}\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "{{X_API_KEY}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Third Authentication_example
require 'uri'
require 'net/http'

url = URI("https://third/v1/authentication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{X_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"{{EMAIL_PROVIDER}}\",\n  \"password\": \"{{PASSWORD_PROVIDER}}\"\n}"

response = http.request(request)
puts response.read_body
```

```java Third Authentication_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://third/v1/authentication")
  .header("x-api-key", "{{X_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"{{EMAIL_PROVIDER}}\",\n  \"password\": \"{{PASSWORD_PROVIDER}}\"\n}")
  .asString();
```

```php Third Authentication_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://third/v1/authentication', [
  'body' => '{
  "email": "{{EMAIL_PROVIDER}}",
  "password": "{{PASSWORD_PROVIDER}}"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '{{X_API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp Third Authentication_example
using RestSharp;

var client = new RestClient("https://third/v1/authentication");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "{{X_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"{{EMAIL_PROVIDER}}\",\n  \"password\": \"{{PASSWORD_PROVIDER}}\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Third Authentication_example
import Foundation

let headers = [
  "x-api-key": "{{X_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = [
  "email": "{{EMAIL_PROVIDER}}",
  "password": "{{PASSWORD_PROVIDER}}"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://third/v1/authentication")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```