> 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.

# Generate QR code for a link in SVG and PNG format

GET https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/{domain}/{guid}

Reference: https://developer.americanexpress.ferndocs.com/personalized-services/dotamex/api-reference/generate-qr-code-for-a-link-in-svg-and-png-format

## Servers

- `https://apigw-dev.americanexpress.com/dotamex/v1/empurl` (E1, default)
- `https://apigw-qa.americanexpress.com/dotamex/v1/empurl` (E2)
- `https://apigw.americanexpress.com/dotamex/v1/empurl` (E3)
- `https://apigwm-qa.americanexpress.com/dotamex/v1/empurl` (Sandbox)
- `https://apigwm.americanexpress.com/dotamex/v1/empurl` (Production)

## Request

### Path parameters

- `domain` (string, required) — This is the domain specified when the shortUrl was registered.
- `guid` (string, required) — The shortUrl path.

### Query parameters

- `qr` (boolean, required) — This indicates that Amex is generating a QR code.
- `qrLength` (string, required) — This indicates the length of the QR code.
- `qrWidth` (string, required) — This indicates the width of the QR code.
- `qrEc` (string, required) — This is the level of damage the QR code can suffer and still be scannable. The levels available are Q(15%), M(25%), and H(30%).
- `primaryColor` (string, required) — This indicates the color of the QR code. The colors available are Blue and Black.
- `svg` (boolean, optional) — This is to indicate that you are generating the QR code in SVG format. QR code can also be generated in PNG format. SVG formats are better for responsive behavior due to their scalability and lack of quality degradation. An SVG QR code is great for printing at the highest quality.
- `branded` (boolean, required) — This will add the American Express logo in the center of the QR code.

## Response

### 200

Success response.

- File download.

## Errors

### 500 Internal Server Error

Internal server error.

- `any`

## Examples

**SDK Code**

```python
import requests

url = "https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345"

querystring = {"branded":"true","primaryColor":"Blue","qr":"true","qrEc":"Q","qrLength":"200","qrWidth":"200"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200';
const options = {method: 'GET'};

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

```go
package main

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

func main() {

	url := "https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200"

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

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

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

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

}
```

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

url = URI("https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200")

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

request = Net::HTTP::Get.new(url)

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

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

HttpResponse<String> response = Unirest.get("https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200');

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

```csharp
using RestSharp;

var client = new RestClient("https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://apigw-dev.americanexpress.com/dotamex/v1/empurl/qrCode/go/test12345?branded=true&primaryColor=Blue&qr=true&qrEc=Q&qrLength=200&qrWidth=200")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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