Refresh Token
POST /openapi/v1/auth/refresh
Refresh the Access Token using the Refresh Token when the Access Token expires.
Payload before encryption:
{
"refresh_token": "eyJhbGciO…"
}
| Field | Required | Description |
|---|---|---|
refresh_token | ✅ | JWT Refresh Token received from the Login API |
- cURL
- Python
- Go
- JavaScript
curl --location '<base_url>/openapi/v1/auth/refresh' \
--header 'Partner-Code: YOUR_PARTNER_CODE' \
--header 'Content-Type: application/json' \
--data '{
"data": ENCRYPTED_PAYLOAD
}'
import requests
url = "<base_url>/openapi/v1/auth/refresh"
payload = {"data": "ENCRYPTED_PAYLOAD"}
headers = {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "<base_url>/openapi/v1/auth/refresh"
body := strings.NewReader(`{"data":"ENCRYPTED_PAYLOAD"}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Set("Partner-Code", "YOUR_PARTNER_CODE")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}
const response = await fetch("<base_url>/openapi/v1/auth/refresh", {
method: "POST",
headers: {
"Partner-Code": "YOUR_PARTNER_CODE",
"Content-Type": "application/json",
},
body: JSON.stringify({ data: "ENCRYPTED_PAYLOAD" }),
});
const result = await response.text();
console.log(result);
Request
Headers
| Name | Required | Description |
|---|---|---|
Partner-Code | ✅ | Merchant identifier code (provided by TCONNECT) |
Content-Type | ✅ | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
data | string | ✅ | AES-256-CBC encrypted payload as Hexadecimal |
Response
200 — Token refresh successful
| Field | Type | Description |
|---|---|---|
access_token | string | New JWT used to authenticate requests |
expires_in | integer | New access_token lifetime in seconds |
refresh_token | string | New refresh token |
refresh_expires_in | integer | New refresh_token lifetime in seconds |
token_type | string | Always "Bearer" |