---
title: Delegated authorization
url: amazon-pay-checkout/delegated-authorization.html
---

Add an Authorization token as a header when calling Amazon Pay APIs to make delegated requests on behalf of other another party. The header key is: `X-Amz-Pay-AuthToken`.

Supported operations:

<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#ustab" data-toggle="tab">US</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#eutab" data-toggle="tab">EU / UK</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#jptab" data-toggle="tab">JP</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="ustab" markdown="block">   
<div markdown="block">
**Create Authorization Token** - GET https://pay-api.amazon.com/:version/authorizationTokens/:mwsAuthToken?merchantId=:merchantId
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="eutab" markdown="block">
<div markdown="block">
**Create Authorization Token** - GET https://pay-api.amazon.eu/:version/authorizationTokens/:mwsAuthToken?merchantId=:merchantId
</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="jptab" markdown="block">
<div markdown="block">
**Create Authorization Token** - GET https://pay-api.amazon.jp/:version/authorizationTokens/:mwsAuthToken?merchantId=:merchantId
</div>
  </div>
</div>
  
### Create Authorization Token

Create Authorization Token to exchange a mwsAuthToken for an Authorization token.

#### Request


#### Request body

```
curl "https://pay-api.amazon.com/:version/authorizationTokens/:mwsAuthToken?merchantId=:merchantId"
-X GET
-H Authorization: AMZN-PAY-RSASSA-PSS-V2 PublicKeyId=f4fc06fc-c5a7-11e7-abc4-cec278b6b50a, SignedHeaders=content-type;x-amz-pay-date;x-amz-pay-region, Signature=4164128ec5d1b9da1700167ab2ccda8125f472c8bb9de447cebf5d741ee317c8

```

#### Request parameters

<table width="100%" border="1">
    <tbody>
        <tr id='cJS9CAFNCvt'>
            <td id='s:cJS9CAFNCvt;cJS9CAwLlhz' style='vertical-align: top; font-weight: bold; width: 30%;' class='bold'>Name
                <br /></td>
            <td id='s:cJS9CAFNCvt;cJS9CAhKPAZ' style='vertical-align: top; font-weight: bold; width: 20%;' class='bold'>Location
                <br /></td>
            <td id='s:cJS9CAFNCvt;cJS9CAJ9HKU' style='vertical-align: top; font-weight: bold; width: 50%;' class='bold'>Description
                <br /></td>
        </tr>
        <tr id='cJS9CA0EwNI'>
            <td id='s:cJS9CA0EwNI;cJS9CAwLlhz' style='vertical-align: top;'>mwsAuthToken<br><b>(required)</b><br><br>Type: string
                <br /></td>
            <td id='s:cJS9CA0EwNI;cJS9CAhKPAZ' style='vertical-align: top;'>Path Parameter
                <br /></td>
            <td id='s:cJS9CA0EwNI;cJS9CAJ9HKU' style='vertical-align: top;'>The MWS Auth Token that the solution provider currently uses to make V1 API calls on behalf of the merchant.
                <br /></td>
        </tr>
        <tr id='cJS9CA0EwNI'>
            <td id='s:cJS9CA0EwNI;cJS9CAwLlhz' style='vertical-align: top;'>merchantId<br><b>(required)</b><br><br>Type: string
                <br /></td>
            <td id='s:cJS9CA0EwNI;cJS9CAhKPAZ' style='vertical-align: top;'>Query Parameter
                <br /></td>
            <td id='s:cJS9CA0EwNI;cJS9CAJ9HKU' style='vertical-align: top;'>The Amazon Pay merchant Id. 
                <br /></td>
        </tr>
    </tbody>
</table>


#### Response

Returns <a href="https://restfulapi.net/http-status-200-ok" target="_blank" rel="noopener noreferrer">HTTP 200 (OK) status</a> if the operation was successful.

```
HTTP/1.1 200 OK 
Host: pay-api.amazon.com
Content-type: application/json
{
  "authorizationToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
```
 
#### Error codes

Generic errors can be found <a href="../amazon-pay-api-v2/error-handling.md" target="_blank" rel="noopener noreferrer">here</a>. 

<table width="100%" border="1">
  <tr id='cJS9CAJQpxB'>
      <td id='s:cJS9CAJQpxB;cJS9CA6QF8P' style='vertical-align: top; font-weight: bold; width: 30%;' class='bold'>HTTP status code
          <br /></td>
      <td id='s:cJS9CAJQpxB;cJS9CAU3pPK' style='vertical-align: top; font-weight: bold; width: 20%;' class='bold'>Reason code
          <br /></td>
      <td id='s:cJS9CAJQpxB;cJS9CA9q6gX' style='vertical-align: top; font-weight: bold; width: 50%;' class='bold'>Error description
          <br /></td>
  </tr>
  <tr>
     <td>
        <strong>400</strong>
     </td>
     <td>
        InvalidHeaderValue
     </td>
     <td>
         You submitted an invalid value for at least one of the header parameters of your API call. 
         <br/><br/>
         For details, check the message element in the API response.
     </td>
  </tr>
  <tr>
     <td>
        <strong>400</strong>
     </td>
     <td>
        InvalidParameterValue
     </td>
     <td>
         You submitted an invalid value for at least one of the parameters of your API call.
         <br/> <br/>
         For details, check the message element in the API response.
     </td>
  </tr>
  <tr>
     <td>
        <strong>400</strong>
     </td>
     <td>
        InvalidRequestFormat
     </td>
     <td>
        You submitted a request in invalid JSON format. Please validate request body format.
     </td>
  </tr>
  <tr>
     <td>
        <strong>401</strong>
     </td>
     <td>
        UnauthorizedAccess
     </td>
     <td>
        The specified seller account is not authorized to execute this request.
     </td>
  </tr>
  <tr>
     <td>
        <strong>403</strong>
     </td>
     <td>
        InvalidRequestSignature
     </td>
     <td>
        The signature in the Authorization header of your API call is invalid.
        <br/><br/>
        For details, check the message element in the API response.
     </td>
  </tr>
  <tr>
    <td>
      <strong>403</strong>
    </td>
    <td>
      InvalidAuthorizationToken
    </td>
    <td>
      The token and merchantId combination specified is invalid.
    </td>
  </tr>
  <tr>
     <td>
        <strong>404</strong>
     </td>
     <td>
        ResourceNotFound
     </td>
     <td>
        Couldn’t find requested resource.
     </td>
  </tr>
  <tr>
     <td>
        <strong>405</strong>
     </td>
     <td>
        RequestNotSupported
     </td>
     <td>
        HTTP method not supported.
        <br/><br/>
        For details, check the message element in the API response.
     </td>
  </tr>
  <tr>
     <td>
        <strong>500</strong>
     </td>
     <td>
        InternalServerError
     </td>
     <td>
        There was an unknown error in the service.
     </td>
  </tr>
  <tr>
     <td>
        <strong>503</strong>
     </td>
     <td>
        ServiceUnavailable
     </td>
     <td>
        The service is currently unable to handle the request, due to a temporary overloading or maintenance.
     </td>
  </tr>
</table>






