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:

IdentifierDescriptionSource
partnerIdUnique partner identifier (max 20 chars)Provided by your commercial focal point
redemptionCodeUnique redemption code for the product or service (max 50 chars, alphanumeric)Provided by your commercial focal point
client_idOAuth client identifier from the registered app in the development portalProvided after the app creation in the development portal
client_secretOAuth client secret from the registered app in the development portalProvided after the app creation in the development portal
Important

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:

FlowUsed ForToken Format
Flow A — Auth0 PKCE (member-bound)Create RedeemJWT in Authorization: Bearer <token>
Flow B — Portal API Client Credentials (partner-level)GET Redeem, Cancel RedeemUUID 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:

{
  "client_id": "YOUR_CLIENT_ID_B2C_FROM_AUTH0",
  "redirect_uri": "YOUR_REDIRECT_URI",
  "external_user_id": "PARTNER_INTERNAL_USER_ID",
  "country": "cl",
  "lang": "es"
}

Response:

{
  "url": "https://auth.st.latamairlines.com/authorize?...",
  "state": "1489c760-e5e2-45cf-82ce-b518a8e38738",
  "codeVerifier": "OS7yYdFuH1b8e-Va99Vhbtg9TlLUAATwUMbNRsusRYo"
}
Important

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:

{
  "grant_type": "authorization_code",
  "client_id": "YOUR_CLIENT_ID_B2C_FROM_AUTH0",
  "code": "CODE_FROM_CALLBACK",
  "redirect_uri": "YOUR_REDIRECT_URI",
  "code_verifier": "CODE_VERIFIER_FROM_STEP_1"
}

Response:

{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "v1.Mc8...",
  "token_type": "Bearer",
  "expires_in": 86400
}

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:

{
  "access_token": "a0459255-597c-48ad-83a6-6e0da50a324d",
  "token_type": "Bearer",
  "expires_in": 3600
}

2.1.3 Authentication Summary

StepEndpointPurpose
Flow A — Step 1POST /account-linking/authorizeGet authorization URL + codeVerifier
Flow A — Step 2(browser)Member logs in; callback returns code
Flow A — Step 3POST /oauth/token (authorization_code)Exchange code + codeVerifier → JWT access_token
Flow A — RenewalPOST /oauth/token (refresh_token)Renew JWT — contact LATAM Pass Support
Flow BPOST /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):

HeaderValue
Content-Typeapplication/json
x-latam-testLatamPass (sandbox only)
AuthorizationBearer <JWT_ACCESS_TOKEN>

Flow B — Portal API Client Credentials (GET Redeem, Cancel Redeem):

HeaderValue
Content-Typeapplication/json
x-latam-testLatamPass (sandbox only)
Access_token<UUID_ACCESS_TOKEN>
client_id<YOUR_CLIENT_ID>

4. Build Your Request

Create Redemption — POST /redeem

Required fields:

FieldTypeConstraints
partnerIdStringMax 20 chars
partnerTransactionIdStringMax 100 chars
milesIntegerMin 1, max 3,000,000
redemptionCodeStringMax 50 chars
descriptionStringMax 500 chars

Optional fields:

FieldTypeNotes
correlationIdUUIDAuto-generated if not provided

cURL example:

curl https://api.latampass.com/sandbox/v1/customer/eloyalty/partner/redeem \
  --request POST \
  --header 'x-latam-test: LatamPass' \
  --header 'Authorization: Bearer <YOUR_JWT_ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{
    "description": "Demo API redeem",
    "miles": 15,
    "redemptionCode": "13X9CRYM",
    "partnerId": "LPS",
    "partnerTransactionId": "TXN-TEST-1769171650"
  }'

5. Cancel Redemption — POST /redeem/cancel

Required fields:

FieldTypeConstraints
correlationIdUUIDMust correspond to a PROCESSED redeem
descriptionStringMax 500 chars
milesNumberMin 1, max 3.000.000; it cannot exceed original redeem miles

cURL example:

curl https://api.latampass.com/sandbox/v1/customer/eloyalty/partner/redeem/cancel \
  --request POST \
  --header 'x-latam-test: LatamPass' \
  --header 'Access_token: <YOUR_UUID_ACCESS_TOKEN>' \
  --header 'client_id: <YOUR_CLIENT_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "correlationId": "ec909ee0-d890-44f4-b3f9-01797d591bc2",
    "description": "Customer requested cancellation",
    "miles": 15
  }'

6. Get Redemption Status — GET /redeem

Query parameter:

ParameterTypeDescription
correlationIdUUIDThe identifier of the redemption to query

cURL example:

curl 'https://api.latampass.com/sandbox/v1/customer/eloyalty/partner/redeem?correlationId=ec909ee0-d890-44f4-b3f9-01797d591bc2' \
  --request GET \
  --header 'x-latam-test: LatamPass' \
  --header 'Access_token: <YOUR_UUID_ACCESS_TOKEN>' \
  --header 'client_id: <YOUR_CLIENT_ID>' \
  --header 'Content-Type: application/json'

7. Handle the Response

HTTP StatusMeaningAction Required
201 CreatedRequest accepted for processing (Create and Cancel). This is not the final business result.Store the correlationId from the response and await the webhook notification.
4xxClient-side error (invalid request, missing fields, unauthorized).Log the full response with correlationId. Do not retry without first correcting the request.
500 Internal Server ErrorServer-side error.Retry with the same data. If the issue persists, contact LATAM Pass Support.
Important

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.

OperationFinal States
Create RedeemPROCESSED, ERROR, CANCELLED
Cancel RedeemREFUNDED, 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

IssueCauseSolution
401 UnauthorizedInvalid or expired access tokenRe-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 configurationContact LATAM Pass Support to configure b2b_client_id.
400 Bad Request (Create)Missing required fields or invalid valuesVerify description, miles, redemptionCode, partnerId, and partnerTransactionId are present and valid.
400 Bad Request (Cancel)correlationId not found, or cancellation miles exceed original totalUse a valid correlationId from a PROCESSED redeem; miles must be ≤ original total.
422 UnprocessableRedeem not in PROCESSED status (Cancel only)Only redeems with status PROCESSED can be cancelled.
405 Method Not AllowedWrong HTTP method usedUse POST for create/cancel operations; GET for status queries.
500 Internal Server ErrorServer-side errorRetry 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
  • ✅ 201 response interpreted as acceptance, not completion
  • ✅ 4xx responses logged with correlationId; 500 responses retried with the same data
  • ✅ Create Redeem validated end-to-end (POST → correlationId → Webhook PROCESSED / ERROR / CANCELLED)
  • ✅ GET Redeem validated (GET by correlationId → correct status returned)
  • ✅ Cancel flow validated (create → PROCESSED → cancel → Webhook REFUNDED / CANCELLED / ERROR)
  • ✅ Error handling implemented for validation errors, not-found cases, invalid status, and amount exceeding original total
  • ✅ correlationId stored persistently and used for GET and cancel operations
  • ✅ Webhook endpoint configured and actively listening
Important

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:

  1. Complete integration in Sandbox — run all test scenarios: Create Redeem, Get Redeem Status, and Cancel Redeem.
  2. 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

FeatureSandboxProduction
Base URLhttps://api.latampass.com/sandboxhttps://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 TokenPOST .../sandbox/oauth/access-tokenPOST .../oauth/access-token
DataTest data only. No impact on real member accounts.Live data. All transactions are real and final.
PurposeDevelopment, integration testing, certification.Live commercial use.
x-latam-test HeaderActive. Can trigger specific mock scenarios.Ignored. No effect.
SupportBusiness hours for integration issues.24/7 for critical production issues.

Production Endpoints

MethodEndpointDescription
POSThttps://api.latampass.com/oauth/access-tokenPortal API token (client credentials — Flow B)
POSThttps://api.latampass.com/v1/customer/eloyalty/partner/redeemCreate Redeem
GEThttps://api.latampass.com/v1/customer/eloyalty/partner/redeemGet Redeem Status
POSThttps://api.latampass.com/v1/customer/eloyalty/partner/redeem/cancelCancel Redeem