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

# Step 2 of Pay with Points - Complete transaction

POST https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption
Content-Type: application/json

POST /loyalty/v2/paywithpoints/redemption will complete the Pay with Points transaction. To complete the transaction, you will supply:Points Selection: Specifying the number of the Points selected by the Card Member as payment.Amount Information: Providing amount for selected points.Critical Note: To ensure the best experience to Card Members, the expected behavior of the system for all scenarios in which a 500, timeout (or other non-specified error) is received when submitting the POST /loyalty/v2/paywithpoints/redemption update, is for the Card Member to receive a message indicating a successful completion of Pay with Points. The error condition must then be resolved asynchronously to any remaining purchase process.Example: The current basket's checkout process should complete as though everything was successful, while a retry to Pay with Points is made in the background.If Pay with Points is unable to be completed, a notification will be sent by the American Express to the Card Member.

Reference: https://developer.americanexpress.ferndocs.com/payment-services/global-pay-with-points-v-2/api-reference/pay-with-points-v-2

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Exchange your API key and secret for a bearer token, then send it as `Authorization: Bearer <token>`.

## Servers

- `https://apigwsandboxm.americanexpress.com` (https://apigwsandboxm.americanexpress.com, default)
- `https://apigwm.americanexpress.com` (Production)

## Request

### Headers

- `X-AMEX-API-KEY` (string, required) — A unique Consumer Developer key for Enterprise Web Proxy authentication. Please see the API key, [https://developer.americanexpress.com/documentation#api-key](https://developer.americanexpress.com/documentation#api-key)
- `Authorization` (string, required) — The OAuth2 Bearer token that the API Consumer use to gain access to the American Express API. The value provided here is the response of the Access Token API.
- `client_id` (string, required) — Merchant Identification Code: This is a unique ID assigned to each Merchant when onboarding to the Pay with Points program.Note: You will be able to access the client_id from your Application Keys when moving to both the Sandbox and Production environments. A standard Sandbox key is available within the Test Data section below.
- `message_id` (string, required) — A unique ID generated by the Merchant for each /loyalty/v2/paywithpoints/eligibility. The scope of uniqueness is limited to the Merchant.The same message_id should never be re-used across different transactions.
- `partner_country_code` (string, required) — The numeric geographical code (geocode) to represent country and dependent areas
- `channel_id` (enum, optional) — The channel from which the redemption transaction originated. Used for reporting and analytics purposes only.
  - Allowed values: `ECOMMERCE`, `POS`, `DIGITAL_PAY`, `SCAN_GO`

### Body (application/json)

This endpoint expects a PayWithPointsRequest.

- `account_key` (AccountKey, required) — The consumer can use any of the following types of identification methods for this API.
- `amount` (Amount, required) — A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.
- `points_needed` (double, required) — The number of Points the Card Member has approved to be used toward the purchase.
- `requestor_order_id` (string, optional) — The message_id header value received in the request.
- `charge_id` (string, optional) — A unique transaction identifier for the Card charge.
- `charge_id_type` (enum, optional) — The type of the transaction for the Card charge.
  - Allowed values: `TID`, `AR_Trans_ID`, `ROC_Reference_Number`, `AuthID`
- `basket_amount` (Amount, optional) — A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.
- `conversion_rate` (double, optional) — The points conversion rate.
- `merchant_service_establishment_id` (string, optional) — The Merchant Store Number if applicable.Note: This field is applicable only for non-USA market partners. The partners can choose to send this field, but it is not required.This field is non-applicable for USA market partners.
- `merchant_name` (enum, optional) — The Merchant Name if applicable.Note: This field is applicable only for non-USA market partners. The partners can choose to send this field, but it is not required.This field is non-applicable for USA market partners.
  - Allowed values: `ABC`, `XYZ`, `INC`
- `merchant_pricing_code` (string, optional) — The Merchant pricing code passed in request. This is configured by the American Express and shared to the Partner at the time of onboarding.Note: This field is mandatory only for non-USA market partners.This field is non-mandatory for USA market partners.
- `fraud_check` (FraudCheck, optional) — Depending on the terms of your agreement in participating with Pay with Points, the cid, exp_month, and exp_year properties may also be required.

## Response

### 200

Pay with points response

- `id` (string, optional) — The internal transaction ID generated for the processing request.
- `requestor_order_id` (string, optional) — The message_id header value received in the request.
- `account_key` (AccountKey, optional) — The consumer can use any of the following types of identification methods for this API.
- `charge_id` (string, optional) — A unique transaction identifier for the Card charge.
- `charge_id_type` (enum, optional) — The type of the transaction for the Card charge.
  - Allowed values: `TID`, `AR_Trans_ID`, `ROC_Reference_Number`, `AuthID`
- `amount` (Amount, optional) — A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.
- `points_needed` (double, optional) — The number of Points the Card Member has approved to be used toward the purchase.
- `conversion_rate` (double, optional) — The points conversion rate.
- `merchant_service_establishment_id` (string, optional) — The Merchant Store Number if applicable.Note: This field is applicable only for non-USA market partners. The partners can choose to send this field, but it is not required.This field is non-applicable for USA market partners.
- `merchant_name` (enum, optional) — The Merchant Name if applicable.Note: This field is applicable only for non-USA market partners. The partners can choose to send this field, but it is not required.This field is non-applicable for USA market partners.
  - Allowed values: `ABC`, `XYZ`, `INC`
- `merchant_pricing_code` (string, optional) — The Merchant pricing code passed in request. This is configured by the American Express and shared to the Partner at the time of onboarding.Note: This field is mandatory only for non-USA market partners.This field is non-mandatory for USA market partners.
- `_embedded` (Embedded, optional) — This object embeds the reward program account information like current balance, tier code, reward unit, minimum and maximum dollar amount limits per transaction.

## Errors

### 400 Bad Request Error

Bad request

- `list of APIError`

### 500 Internal Server Error

Internal error

- `list of APIError`

## Types

### AccountKey

The consumer can use any of the following types of identification methods for this API.

### Amount

A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.

- `value` (double, required) — The transaction amount that will be used to validate whether sufficient points are available.Note: Exclude currency indicators.
- `currency_code` (string, required) — The currency code of the given amount.
- `currency_description` (string, optional) — The currency description of the given amount.

### FraudCheck

Depending on the terms of your agreement in participating with Pay with Points, the cid, exp_month, and exp_year properties may also be required.

- `postal_code` (string, optional) — The billing postal code of the Card.Based on your agreement with Pay with Points, this property may be required.
- `cid` (string, optional) — The Card Identification Number.Based on your agreement with Pay with Points, this property may be required.
- `csc` (string, optional) — The Card Security code.Based on your agreement with Pay with Points, this property may be required.
- `exp_month` (string, optional) — The Card expiration month. Both digits are required.Based on your agreement with Pay with Points, this property may be required.
- `exp_year` (string, optional) — The Card expiration year. Four digits are required.Based on your agreement with Pay with Points, this property may be required.

### Embedded

This object embeds the reward program account information like current balance, tier code, reward unit, minimum and maximum dollar amount limits per transaction.

- `current_balance` (string, optional) — The total Points available before redemption.
- `amount_balance` (string, optional) — The amount equivalent to total available Points before redemption.
- `currency_code` (string, optional) — The currency code of the given amount.
- `tier_code` (string, optional) — The tier code representation of the reward program name. Used in USA market only.
- `tier_description` (enum, optional) — The tier code description.
  - Allowed values: `Express`, `First`
- `reward_unit` (enum, optional) — The reward unit of the reward program for this account.
  - Allowed values: `Points`, `CASH`
- `min_reward_spend` (Amount, optional) — A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.
- `max_reward_spend` (Amount, optional) — A generic object for any amount that is related to a specific transaction.Note: It is mandatory in case of Single-step scenario.

### APIError

This object represents error details occurred during the API processing. The error could be account/transaction validations or internal processing errors like temporary unavailability of the other back end systems.

- `error_code` (string, optional) — The error code that uniquely identifies the error condition. This code can be used for troubleshooting, support inquiries, and programmatic error handling.
- `user_message` (string, optional) — The error message is a human readable message. The message explains the issue in clear, non-technical language and may provide guidance on corrective actions when applicable.
- `developer_message` (string, optional) — The developer message is technical error description intended for developers and support teams. Provides diagnostic information, internal error identifiers, or system-specific details that can assist with debugging and root-cause analysis.
- `more_information` (string, optional) — The more information provides additional context related to the error, such as validation details, business rule violations, processing status, or supplementary information that may help consumers understand and resolve the issue.

### AccountKey0

The American Express reward account number of the reward program.

- `account_id` (string, required) — The American Express reward account number of the reward program.

### AccountKey1

The American Express Account Number.This field must always be consistent across the /loyalty/v2/paywithpoints/eligibility and /loyalty/v2/paywithpoints/redemption calls.

- `card_number` (string, required) — The American Express Account Number.This field must always be consistent across the /loyalty/v2/paywithpoints/eligibility and /loyalty/v2/paywithpoints/redemption calls.

### AccountKey2

This object represents another form of the real Card Number.

- `virtual_card_number` (VirtualCardNumber, required) — This object represents another form of the real Card Number.

### VirtualCardNumber

This object represents another form of the real Card Number.

- `token_number` (string, required) — The encrypted or another form of Card Number.
- `token_reference_id` (string, optional) — A unique identifier obtained from the American Express Wallet Hub.

## Examples

### Points based response

**Response**

```json
{
  "id": "e6ebce8b-8856-5ee0-99d3-135124cacac1",
  "requestor_order_id": "708ff3ba-6e2a-4756-9cc6-ddd6859808db",
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "amount": {
    "value": 1.23,
    "currency_code": "840"
  },
  "points_needed": 176,
  "conversion_rate": 0.007,
  "merchant_pricing_code": "MRSP",
  "_embedded": {
    "current_balance": "1575073",
    "amount_balance": "11025.51",
    "currency_code": "840",
    "tier_code": "MR",
    "reward_unit": "Points",
    "min_reward_spend": {
      "value": 0.01,
      "currency_code": "840",
      "currency_description": "US"
    },
    "max_reward_spend": {
      "value": 69999999.99,
      "currency_code": "840",
      "currency_description": "US"
    }
  }
}
```

**SDK Code**

```python Points based response
import requests

url = "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

headers = {
    "Authorization": "Bearer <token>",
    "X-AMEX-API-KEY": "X-AMEX-API-KEY",
    "client_id": "client_id",
    "message_id": "message_id",
    "partner_country_code": "partner_country_code"
}

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

print(response.json())
```

```javascript Points based response
const url = 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'X-AMEX-API-KEY': 'X-AMEX-API-KEY',
    client_id: 'client_id',
    message_id: 'message_id',
    partner_country_code: 'partner_country_code'
  }
};

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

```go Points based response
package main

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

func main() {

	url := "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-AMEX-API-KEY", "X-AMEX-API-KEY")
	req.Header.Add("client_id", "client_id")
	req.Header.Add("message_id", "message_id")
	req.Header.Add("partner_country_code", "partner_country_code")

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

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

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

}
```

```ruby Points based response
require 'uri'
require 'net/http'

url = URI("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-AMEX-API-KEY"] = 'X-AMEX-API-KEY'
request["client_id"] = 'client_id'
request["message_id"] = 'message_id'
request["partner_country_code"] = 'partner_country_code'

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

```java Points based response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")
  .header("Authorization", "Bearer <token>")
  .header("X-AMEX-API-KEY", "X-AMEX-API-KEY")
  .header("client_id", "client_id")
  .header("message_id", "message_id")
  .header("partner_country_code", "partner_country_code")
  .asString();
```

```php Points based response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-AMEX-API-KEY' => 'X-AMEX-API-KEY',
    'client_id' => 'client_id',
    'message_id' => 'message_id',
    'partner_country_code' => 'partner_country_code',
  ],
]);

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

```csharp Points based response
using RestSharp;

var client = new RestClient("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("X-AMEX-API-KEY", "X-AMEX-API-KEY");
request.AddHeader("client_id", "client_id");
request.AddHeader("message_id", "message_id");
request.AddHeader("partner_country_code", "partner_country_code");
IRestResponse response = client.Execute(request);
```

```swift Points based response
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "X-AMEX-API-KEY": "X-AMEX-API-KEY",
  "client_id": "client_id",
  "message_id": "message_id",
  "partner_country_code": "partner_country_code"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Cash based response

**Response**

```json
{
  "id": "94db27a2-0e17-5cac-a9fc-a078fe294d54",
  "requestor_order_id": "166ce3e1-62a8-44fc-a254-70e581730112",
  "account_key": {
    "account_id": "1R00000000",
    "card_number": "374200000000004"
  },
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "amount": {
    "value": 0.2,
    "currency_code": "840"
  },
  "points_needed": 0.2,
  "conversion_rate": 1,
  "merchant_pricing_code": "AMZR",
  "_embedded": {
    "current_balance": "65905.80",
    "amount_balance": "65905.80",
    "currency_code": "840",
    "tier_code": "BL",
    "reward_unit": "CASH",
    "min_reward_spend": {
      "value": 0.01,
      "currency_code": "840",
      "currency_description": "US"
    },
    "max_reward_spend": {
      "value": 999999,
      "currency_code": "840",
      "currency_description": "US"
    }
  }
}
```

**SDK Code**

```python Cash based response
import requests

url = "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

headers = {
    "Authorization": "Bearer <token>",
    "X-AMEX-API-KEY": "X-AMEX-API-KEY",
    "client_id": "client_id",
    "message_id": "message_id",
    "partner_country_code": "partner_country_code"
}

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

print(response.json())
```

```javascript Cash based response
const url = 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'X-AMEX-API-KEY': 'X-AMEX-API-KEY',
    client_id: 'client_id',
    message_id: 'message_id',
    partner_country_code: 'partner_country_code'
  }
};

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

```go Cash based response
package main

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

func main() {

	url := "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-AMEX-API-KEY", "X-AMEX-API-KEY")
	req.Header.Add("client_id", "client_id")
	req.Header.Add("message_id", "message_id")
	req.Header.Add("partner_country_code", "partner_country_code")

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

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

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

}
```

```ruby Cash based response
require 'uri'
require 'net/http'

url = URI("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-AMEX-API-KEY"] = 'X-AMEX-API-KEY'
request["client_id"] = 'client_id'
request["message_id"] = 'message_id'
request["partner_country_code"] = 'partner_country_code'

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

```java Cash based response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")
  .header("Authorization", "Bearer <token>")
  .header("X-AMEX-API-KEY", "X-AMEX-API-KEY")
  .header("client_id", "client_id")
  .header("message_id", "message_id")
  .header("partner_country_code", "partner_country_code")
  .asString();
```

```php Cash based response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-AMEX-API-KEY' => 'X-AMEX-API-KEY',
    'client_id' => 'client_id',
    'message_id' => 'message_id',
    'partner_country_code' => 'partner_country_code',
  ],
]);

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

```csharp Cash based response
using RestSharp;

var client = new RestClient("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("X-AMEX-API-KEY", "X-AMEX-API-KEY");
request.AddHeader("client_id", "client_id");
request.AddHeader("message_id", "message_id");
request.AddHeader("partner_country_code", "partner_country_code");
IRestResponse response = client.Execute(request);
```

```swift Cash based response
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "X-AMEX-API-KEY": "X-AMEX-API-KEY",
  "client_id": "client_id",
  "message_id": "message_id",
  "partner_country_code": "partner_country_code"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Points based request

**Request**

```json
{
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "amount": {
    "value": 1.23,
    "currency_code": "840"
  },
  "points_needed": 176,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": {
    "value": 5,
    "currency_code": "840"
  }
}
```

**Response**

```json
{
  "id": "e6ebce8b-8856-5ee0-99d3-135124cacac1",
  "requestor_order_id": "708ff3ba-6e2a-4756-9cc6-ddd6859808db",
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "amount": {
    "value": 1.23,
    "currency_code": "840"
  },
  "points_needed": 176,
  "conversion_rate": 0.007,
  "merchant_pricing_code": "MRSP",
  "_embedded": {
    "current_balance": "1575073",
    "amount_balance": "11025.51",
    "currency_code": "840",
    "tier_code": "MR",
    "reward_unit": "Points",
    "min_reward_spend": {
      "value": 0.01,
      "currency_code": "840",
      "currency_description": "US"
    },
    "max_reward_spend": {
      "value": 69999999.99,
      "currency_code": "840",
      "currency_description": "US"
    }
  }
}
```

**SDK Code**

```python Points based request
import requests

url = "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

payload = {
    "account_key": {
        "account_id": "1M00000000",
        "card_number": "374200000000004"
    },
    "amount": {
        "value": 1.23,
        "currency_code": "840"
    },
    "points_needed": 176,
    "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "charge_id_type": "AuthID",
    "basket_amount": {
        "value": 5,
        "currency_code": "840"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "X-AMEX-API-KEY": "X-AMEX-API-KEY",
    "client_id": "client_id",
    "message_id": "message_id",
    "partner_country_code": "partner_country_code",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Points based request
const url = 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'X-AMEX-API-KEY': 'X-AMEX-API-KEY',
    client_id: 'client_id',
    message_id: 'message_id',
    partner_country_code: 'partner_country_code',
    'Content-Type': 'application/json'
  },
  body: '{"account_key":{"account_id":"1M00000000","card_number":"374200000000004"},"amount":{"value":1.23,"currency_code":"840"},"points_needed":176,"charge_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","charge_id_type":"AuthID","basket_amount":{"value":5,"currency_code":"840"}}'
};

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

```go Points based request
package main

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

func main() {

	url := "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

	payload := strings.NewReader("{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 1.23,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 176,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-AMEX-API-KEY", "X-AMEX-API-KEY")
	req.Header.Add("client_id", "client_id")
	req.Header.Add("message_id", "message_id")
	req.Header.Add("partner_country_code", "partner_country_code")
	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 Points based request
require 'uri'
require 'net/http'

url = URI("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-AMEX-API-KEY"] = 'X-AMEX-API-KEY'
request["client_id"] = 'client_id'
request["message_id"] = 'message_id'
request["partner_country_code"] = 'partner_country_code'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 1.23,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 176,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}"

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

```java Points based request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")
  .header("Authorization", "Bearer <token>")
  .header("X-AMEX-API-KEY", "X-AMEX-API-KEY")
  .header("client_id", "client_id")
  .header("message_id", "message_id")
  .header("partner_country_code", "partner_country_code")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 1.23,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 176,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}")
  .asString();
```

```php Points based request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption', [
  'body' => '{
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "amount": {
    "value": 1.23,
    "currency_code": "840"
  },
  "points_needed": 176,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": {
    "value": 5,
    "currency_code": "840"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-AMEX-API-KEY' => 'X-AMEX-API-KEY',
    'client_id' => 'client_id',
    'message_id' => 'message_id',
    'partner_country_code' => 'partner_country_code',
  ],
]);

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

```csharp Points based request
using RestSharp;

var client = new RestClient("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("X-AMEX-API-KEY", "X-AMEX-API-KEY");
request.AddHeader("client_id", "client_id");
request.AddHeader("message_id", "message_id");
request.AddHeader("partner_country_code", "partner_country_code");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 1.23,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 176,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Points based request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "X-AMEX-API-KEY": "X-AMEX-API-KEY",
  "client_id": "client_id",
  "message_id": "message_id",
  "partner_country_code": "partner_country_code",
  "Content-Type": "application/json"
]
let parameters = [
  "account_key": [
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  ],
  "amount": [
    "value": 1.23,
    "currency_code": "840"
  ],
  "points_needed": 176,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": [
    "value": 5,
    "currency_code": "840"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")! 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()
```

### Cash based request

**Request**

```json
{
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "amount": {
    "value": 0.2,
    "currency_code": "840"
  },
  "points_needed": 0.2,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": {
    "value": 5,
    "currency_code": "840"
  }
}
```

**Response**

```json
{
  "id": "e6ebce8b-8856-5ee0-99d3-135124cacac1",
  "requestor_order_id": "708ff3ba-6e2a-4756-9cc6-ddd6859808db",
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "amount": {
    "value": 1.23,
    "currency_code": "840"
  },
  "points_needed": 176,
  "conversion_rate": 0.007,
  "merchant_pricing_code": "MRSP",
  "_embedded": {
    "current_balance": "1575073",
    "amount_balance": "11025.51",
    "currency_code": "840",
    "tier_code": "MR",
    "reward_unit": "Points",
    "min_reward_spend": {
      "value": 0.01,
      "currency_code": "840",
      "currency_description": "US"
    },
    "max_reward_spend": {
      "value": 69999999.99,
      "currency_code": "840",
      "currency_description": "US"
    }
  }
}
```

**SDK Code**

```python Cash based request
import requests

url = "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

payload = {
    "account_key": {
        "account_id": "1M00000000",
        "card_number": "374200000000004"
    },
    "amount": {
        "value": 0.2,
        "currency_code": "840"
    },
    "points_needed": 0.2,
    "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "charge_id_type": "AuthID",
    "basket_amount": {
        "value": 5,
        "currency_code": "840"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "X-AMEX-API-KEY": "X-AMEX-API-KEY",
    "client_id": "client_id",
    "message_id": "message_id",
    "partner_country_code": "partner_country_code",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Cash based request
const url = 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption';
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'X-AMEX-API-KEY': 'X-AMEX-API-KEY',
    client_id: 'client_id',
    message_id: 'message_id',
    partner_country_code: 'partner_country_code',
    'Content-Type': 'application/json'
  },
  body: '{"account_key":{"account_id":"1M00000000","card_number":"374200000000004"},"amount":{"value":0.2,"currency_code":"840"},"points_needed":0.2,"charge_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","charge_id_type":"AuthID","basket_amount":{"value":5,"currency_code":"840"}}'
};

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

```go Cash based request
package main

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

func main() {

	url := "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption"

	payload := strings.NewReader("{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 0.2,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 0.2,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-AMEX-API-KEY", "X-AMEX-API-KEY")
	req.Header.Add("client_id", "client_id")
	req.Header.Add("message_id", "message_id")
	req.Header.Add("partner_country_code", "partner_country_code")
	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 Cash based request
require 'uri'
require 'net/http'

url = URI("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-AMEX-API-KEY"] = 'X-AMEX-API-KEY'
request["client_id"] = 'client_id'
request["message_id"] = 'message_id'
request["partner_country_code"] = 'partner_country_code'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 0.2,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 0.2,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}"

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

```java Cash based request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")
  .header("Authorization", "Bearer <token>")
  .header("X-AMEX-API-KEY", "X-AMEX-API-KEY")
  .header("client_id", "client_id")
  .header("message_id", "message_id")
  .header("partner_country_code", "partner_country_code")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 0.2,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 0.2,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}")
  .asString();
```

```php Cash based request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption', [
  'body' => '{
  "account_key": {
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  },
  "amount": {
    "value": 0.2,
    "currency_code": "840"
  },
  "points_needed": 0.2,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": {
    "value": 5,
    "currency_code": "840"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-AMEX-API-KEY' => 'X-AMEX-API-KEY',
    'client_id' => 'client_id',
    'message_id' => 'message_id',
    'partner_country_code' => 'partner_country_code',
  ],
]);

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

```csharp Cash based request
using RestSharp;

var client = new RestClient("https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("X-AMEX-API-KEY", "X-AMEX-API-KEY");
request.AddHeader("client_id", "client_id");
request.AddHeader("message_id", "message_id");
request.AddHeader("partner_country_code", "partner_country_code");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_key\": {\n    \"account_id\": \"1M00000000\",\n    \"card_number\": \"374200000000004\"\n  },\n  \"amount\": {\n    \"value\": 0.2,\n    \"currency_code\": \"840\"\n  },\n  \"points_needed\": 0.2,\n  \"charge_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n  \"charge_id_type\": \"AuthID\",\n  \"basket_amount\": {\n    \"value\": 5,\n    \"currency_code\": \"840\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Cash based request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "X-AMEX-API-KEY": "X-AMEX-API-KEY",
  "client_id": "client_id",
  "message_id": "message_id",
  "partner_country_code": "partner_country_code",
  "Content-Type": "application/json"
]
let parameters = [
  "account_key": [
    "account_id": "1M00000000",
    "card_number": "374200000000004"
  ],
  "amount": [
    "value": 0.2,
    "currency_code": "840"
  ],
  "points_needed": 0.2,
  "charge_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "charge_id_type": "AuthID",
  "basket_amount": [
    "value": 5,
    "currency_code": "840"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://apigwsandboxm.americanexpress.com/loyalty/v2/paywithpoints/redemption")! 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()
```