Quickstart
1. Essential Prerequisites
Before making your first API call, ensure you have all required identifiers and credentials in place.
1.1 Obtain Business Identifiers
You need the following identifiers to operate the Redeem API. These are provided during the onboarding process:
| Identifier | Description | Source |
|---|---|---|
partnerId | Unique partner identifier (max 20 chars) | Provided by your commercial focal point |
redemptionCode | Unique redemption code for the product or service (max 50 chars, alphanumeric) | Provided by your commercial focal point |
client_id | OAuth client identifier from the registered app in the development portal | Provided after the app creation in the development portal |
client_secret | OAuth client secret from the registered app in the development portal | Provided after the app creation in the development portal |
If the Partner ID or Redemption Code is missing, contact the Commercial Team responsible for the partner to obtain the required identifier before proceeding. For any other missing identifiers, contact LATAM Pass Support before proceeding.
2. Authentication Setup (Auth)
The Redeem API uses two distinct authentication flows depending on the operation:
| Flow | Used For | Token Format |
|---|---|---|
| Flow A — Auth0 PKCE (member-bound) | Create Redeem | JWT in Authorization: Bearer <token> |
| Flow B — Portal API Client Credentials (partner-level) | GET Redeem, Cancel Redeem | UUID in Access_token: <uuid> + client_id header |
2.1. Obtain Authentication
2.1.1 Flow A — Auth0 PKCE (member-bound)
This flow links a specific member's account and is required for Create Redeem.
Step 1 — Initiate Account Linking (Authorize)
POST https://sandbox.api.latam.com/api/xp-api-login-management/v1/account-linking/authorize
Request body:
Response:
Save the codeVerifier server-side immediately. It cannot be recovered if lost and is required in Step 3.
Step 2 — Member Authentication (Browser)
Open the url returned in Step 1 in a browser. After the member logs in, LATAM redirects to your redirect_uri with the authorization code:
<YOUR_REDIRECT_URI>?code=urb-YpG50oh6zYFJQL8UdF0oV6E1dZHTR1lXq7yvQew_i&state=1489c760-e5e2-45cf-82ce-b518a8e38738
Always verify that the returned state matches the value from Step 1 to prevent CSRF attacks. The authorization code is only the value of the code parameter — do not include state.
Step 3 — Exchange Code for Access Token
POST https://sandbox.api.latam.com/api/xp-api-login-management/v1/oauth/token
Request body:
Response:
Use the access_token in the Authorization: Bearer header for all Flow A requests. Token renewal via refresh_token is also available — contact LATAM Pass Support if you need more details.
2.1.2 Flow B — Portal API Client Credentials (partner-level)
This flow authenticates at the partner level and is used for GET Redeem and Cancel Redeem operations. As a prerequisite, when creating your application in the Developer Portal, select the Redeem PNA API from the Developer Portal.
Once the application has been created, obtain an access token using the following endpoint and details.
POST https://api.latampass.com/sandbox/oauth/access-token
Request headers:
Authorization: Basic <base64(client_id:client_secret)>
Content-Type: application/x-www-form-urlencoded
client_id: YOUR_CLIENT_ID
Request body:
grant_type=client_credentials
Response:
2.1.3 Authentication Summary
| Step | Endpoint | Purpose |
|---|---|---|
| Flow A — Step 1 | POST /account-linking/authorize | Get authorization URL + codeVerifier |
| Flow A — Step 2 | (browser) | Member logs in; callback returns code |
| Flow A — Step 3 | POST /oauth/token (authorization_code) | Exchange code + codeVerifier → JWT access_token |
| Flow A — Renewal | POST /oauth/token (refresh_token) | Renew JWT — contact LATAM Pass Support |
| Flow B | POST /sandbox/oauth/access-token (client_credentials) | Get Portal API UUID token for partner-level operations |
3. Configure Request Headers
Use the appropriate set of headers based on the operation you are performing.
Flow A — Auth0 PKCE (Create Redeem):
| Header | Value |
|---|---|
Content-Type | application/json |
x-latam-test | LatamPass (sandbox only) |
Authorization | Bearer <JWT_ACCESS_TOKEN> |
Flow B — Portal API Client Credentials (GET Redeem, Cancel Redeem):
| Header | Value |
|---|---|
Content-Type | application/json |
x-latam-test | LatamPass (sandbox only) |
Access_token | <UUID_ACCESS_TOKEN> |
client_id | <YOUR_CLIENT_ID> |
4. Build Your Request
Create Redemption — POST /redeem
Required fields:
| Field | Type | Constraints |
|---|---|---|
partnerId | String | Max 20 chars |
partnerTransactionId | String | Max 100 chars |
miles | Integer | Min 1, max 3,000,000 |
redemptionCode | String | Max 50 chars |
description | String | Max 500 chars |
Optional fields:
| Field | Type | Notes |
|---|---|---|
correlationId | UUID | Auto-generated if not provided |
cURL example:
5. Cancel Redemption — POST /redeem/cancel
Required fields:
| Field | Type | Constraints |
|---|---|---|
correlationId | UUID | Must correspond to a PROCESSED redeem |
description | String | Max 500 chars |
miles | Number | Min 1, max 3.000.000; it cannot exceed original redeem miles |
cURL example:
6. Get Redemption Status — GET /redeem
Query parameter:
| Parameter | Type | Description |
|---|---|---|
correlationId | UUID | The identifier of the redemption to query |
cURL example:
7. Handle the Response
| HTTP Status | Meaning | Action Required |
|---|---|---|
201 Created | Request accepted for processing (Create and Cancel). This is not the final business result. | Store the correlationId from the response and await the webhook notification. |
4xx | Client-side error (invalid request, missing fields, unauthorized). | Log the full response with correlationId. Do not retry without first correcting the request. |
500 Internal Server Error | Server-side error. | Retry with the same data. If the issue persists, contact LATAM Pass Support. |
A 201 response means the request was accepted for asynchronous processing. The final outcome (success or failure) is delivered via webhook.
Verify the Final Transaction Status
The Redeem API processes transactions asynchronously. The final result is delivered through one of two mechanisms:
Webhook (recommended) — configure an HTTPS endpoint on your side. The API sends a POST request to your endpoint with the correlationId and final status when processing completes.
| Operation | Final States |
|---|---|
| Create Redeem | PROCESSED, ERROR, CANCELLED |
| Cancel Redeem | REFUNDED, CANCELLED, ERROR |
Polling (alternative) — use the GET endpoint with the correlationId to query the current transaction status at any time. Only use polling if a webhook notification is not received after 24 hours.
Issues and Solutions
| Issue | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid or expired access token | Re-authenticate. For Flow A, repeat Steps 1–3. For Flow B, request a new token. |
403 Forbidden — "App not authorized" | Portal API app missing b2b_client_id configuration | Contact LATAM Pass Support to configure b2b_client_id. |
400 Bad Request (Create) | Missing required fields or invalid values | Verify description, miles, redemptionCode, partnerId, and partnerTransactionId are present and valid. |
400 Bad Request (Cancel) | correlationId not found, or cancellation miles exceed original total | Use a valid correlationId from a PROCESSED redeem; miles must be ≤ original total. |
422 Unprocessable | Redeem not in PROCESSED status (Cancel only) | Only redeems with status PROCESSED can be cancelled. |
405 Method Not Allowed | Wrong HTTP method used | Use POST for create/cancel operations; GET for status queries. |
500 Internal Server Error | Server-side error | Retry with the same data. If it persists, contact LATAM Pass Support. |
8. Integration Checklist
Use this checklist to confirm your integration is complete and correct before requesting production access.
- ✅ Both authentication flows configured (Flow A and Flow B)
- ✅ Portal API app configured with
b2b_client_id - ✅
201response interpreted as acceptance, not completion - ✅
4xxresponses logged withcorrelationId;500responses retried with the same data - ✅ Create Redeem validated end-to-end (
POST→correlationId→ WebhookPROCESSED/ERROR/CANCELLED) - ✅ GET Redeem validated (
GETbycorrelationId→ correct status returned) - ✅ Cancel flow validated (create →
PROCESSED→ cancel → WebhookREFUNDED/CANCELLED/ERROR) - ✅ Error handling implemented for validation errors, not-found cases, invalid status, and amount exceeding original total
- ✅
correlationIdstored persistently and used for GET and cancel operations - ✅ Webhook endpoint configured and actively listening
If you have successfully completed all items, you are ready to request production access. Follow the Production Access Guide below for next steps.
9. Production Access Guide
Before requesting production access, the following prerequisites must be met:
- All integration tests completed in Sandbox (create, get status, cancel)
- No open technical issues between your systems and LATAM Pass
- Integration approved by LATAM Pass Support via ticket
Steps to go live:
- Complete integration in Sandbox — run all test scenarios: Create Redeem, Get Redeem Status, and Cancel Redeem.
- Request production approval — open a ticket at the Support Center. LATAM Pass Support will verify that services are properly configured and may request evidence of completed sandbox transactions.
The production application remains in Pending status until the approval process is complete.
Environments: Sandbox vs. Production
| Feature | Sandbox | Production |
|---|---|---|
| Base URL | https://api.latampass.com/sandbox | https://api.latampass.com |
| Create Redeem | .../sandbox/v1/customer/eloyalty/partner/redeem | .../v1/customer/eloyalty/partner/redeem |
| Cancel Redeem | .../sandbox/v1/customer/eloyalty/partner/redeem/cancel | .../v1/customer/eloyalty/partner/redeem/cancel |
| Get Redeem Status | .../sandbox/v1/customer/eloyalty/partner/redeem?correlationId={uuid} | .../v1/customer/eloyalty/partner/redeem?correlationId={uuid} |
| Portal API Token | POST .../sandbox/oauth/access-token | POST .../oauth/access-token |
| Data | Test data only. No impact on real member accounts. | Live data. All transactions are real and final. |
| Purpose | Development, integration testing, certification. | Live commercial use. |
x-latam-test Header | Active. Can trigger specific mock scenarios. | Ignored. No effect. |
| Support | Business hours for integration issues. | 24/7 for critical production issues. |
Production Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | https://api.latampass.com/oauth/access-token | Portal API token (client credentials — Flow B) |
POST | https://api.latampass.com/v1/customer/eloyalty/partner/redeem | Create Redeem |
GET | https://api.latampass.com/v1/customer/eloyalty/partner/redeem | Get Redeem Status |
POST | https://api.latampass.com/v1/customer/eloyalty/partner/redeem/cancel | Cancel Redeem |