---
title: Get info post-checkout
url: amazon-pay-checkout/get-info-post-checkout.html
---

After a successful checkout, <a href="../amazon-pay-api-v2/charge-permission.md#get-charge-permission" target="_blank" rel="noopener noreferrer">Get Charge Permission</a> to retrieve buyer info and their shipping address. You can only retrieve details for 30 days after the time that a one time Charge Permission is created. See the <a href="../amazon-pay-api-v2/charge-permission.md" target="_blank" rel="noopener noreferrer">API reference guide</a> for more details.

<script>
  function keySpecifics(){
    const keyQuery = "?environmentSpecificKeys=";
    const currentSetting = window.location.search?.split("?environmentSpecificKeys=")[1] ?? 'false';
    const newSetting = currentSetting === 'false' ? 'true' : 'false';
    window.location = window.location.origin + window.location.pathname + keyQuery + newSetting // +  window.location.hash (not included as it feels weird to jump down)
  }
</script>
<div style="display:none" class="environmentSpecificKeys">
  <div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> If your publicKeyId <b>_does not_</b> have an environment prefix (does not begin with 'SANDBOX' or 'LIVE') follow <a href='#' onclick='keySpecifics()' rel='noopener noreferrer'>these instructions</a> instead.</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
  <div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> If your publicKeyId has an environment prefix (for example: SANDBOX-AFVX7ULWSGBZ5535PCUQOY7B) follow <a href='#' onclick='keySpecifics()' rel='noopener noreferrer'>these instructions</a> instead.</div>
</div>


#### Request


<div style="display:none" class="environmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/:version/chargePermissions/:chargePermissionId"<br />
-X GET<br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<code style="color:black">
curl "https://pay-api.amazon.com/:environment/:version/chargePermissions/:chargePermissionId"<br />
-X GET<br />
-H "authorization:Px2e5oHhQZ88vVhc0DO%2FsShHj8MDDg%3DEXAMPLESIGNATURE"<br />
-H "x-amz-pay-date:20201012T235046Z"<br />
</code>
</div>

#### 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;'>chargePermissionId<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;'>Charge Permission identifier
                <br /></td>
        </tr>
    </tbody>
</table>

#### Sample Code

<div style="display:none" class="environmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getChargePermission" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getChargePermission" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getChargePermission" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getChargePermission" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getChargePermission">   
<div markdown="block">
```
<?php

    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );
        
    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getChargePermission('S01-5105180-3221187');
        
        if ($result['status'] === 200) {
            $response = json_decode($result['response'], true);
            $chargePermissionState = $response['statusDetails']['state'];

        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'];
        }
    } catch (Exception $e) {
        // handle the exception
        echo $e;
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getChargePermission">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.ChargePermission;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetChargePermission()
    {
        // prepare the request
        var chargePermissionId = "S01-5105180-3221187";

        // send the request
        ChargePermissionResponse result = client.GetChargePermission(chargePermissionId);

        // check if API call was successful
        if (!result.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        State chargePermissionState = result.StatusDetails.State;
        DateTime chargePermissionExpiryDate = result.ExpirationTimestamp;
        Address buyerAddress = result.BillingAddress;
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getChargePermission">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY".toCharArray())
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = webstoreClient.getChargePermission('S01-5105180-3221187');
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}

```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getChargePermission">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    
                
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getChargePermission('S01-5105180-3221187');

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>
<div style="display:none" class="notEnvironmentSpecificKeys">
<ul id="profileTabs" class="nav nav-tabs">
  <li class="nav-item"><a class="active nav-link noExtIcon" href="#phptab-getChargePermission-NESK" data-toggle="tab">PHP</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#dotnettab-getChargePermission-NESK" data-toggle="tab">.NET</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#javatab-getChargePermission-NESK" data-toggle="tab">Java</a></li>
  <li class="nav-item"><a class="nav-link noExtIcon" href="#nodejstab-getChargePermission-NESK" data-toggle="tab">Node.js</a></li>
</ul>
<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="phptab-getChargePermission-NESK">   
<div markdown="block">
```
<?php

    include 'vendor/autoload.php';

    $amazonpay_config = array(
        'public_key_id' => 'YOUR_PUBLIC_KEY_ID',
        'private_key'   => 'keys/private.pem', // Path to RSA Private Key (or a string representation)
        'region'        => 'YOUR_REGION_CODE',
        'sandbox'       => true,
        'algorithm'     => 'AMZN-PAY-RSASSA-PSS-V2'
    );
        
    try {
        $client = new Amazon\Pay\API\Client($amazonpay_config);
        $result = $client->getChargePermission('S01-5105180-3221187');
        
        if ($result['status'] === 200) {
            $response = json_decode($result['response'], true);
            $chargePermissionState = $response['statusDetails']['state'];

        } else {
            // check the error
            echo 'status=' . $result['status'] . '; response=' . $result['response'];
        }
    } catch (Exception $e) {
        // handle the exception
        echo $e;
    }
?>
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="dotnettab-getChargePermission-NESK">
<div markdown="block">
```
using Amazon.Pay.API.Types;
using Amazon.Pay.API.WebStore;
using Amazon.Pay.API.WebStore.Types;
using Amazon.Pay.API.WebStore.ChargePermission;

public class Sample
{
    public WebStoreClient InitiateClient()
    {
        // set up config
        var payConfiguration = new ApiConfiguration
        (
            region: Region.YOUR_REGION_CODE,
            environment: Environment.Sandbox,
            publicKeyId: "YOUR_PUBLIC_KEY_ID",
            privateKey: "PATH_OR_CONTENT_OF_YOUR_PRIVATE_KEY",
            algorithm: AmazonSignatureAlgorithm.V2
        );

        // init API client
        var client = new WebStoreClient(payConfiguration);

        return client;
    }

    public void GetChargePermission()
    {
        // prepare the request
        var chargePermissionId = "S01-5105180-3221187";

        // send the request
        ChargePermissionResponse result = client.GetChargePermission(chargePermissionId);

        // check if API call was successful
        if (!result.Success)
        {
            // handle the API error (use Status field to get the numeric error code)
        }

        // do something with the result, for instance:
        State chargePermissionState = result.StatusDetails.State;
        DateTime chargePermissionExpiryDate = result.ExpirationTimestamp;
        Address buyerAddress = result.BillingAddress;
    }
}
```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="javatab-getChargePermission-NESK">
<div markdown="block">
```
import com.amazon.pay.api.AmazonPayResponse;
import com.amazon.pay.api.PayConfiguration;
import com.amazon.pay.api.WebstoreClient;
import com.amazon.pay.api.exceptions.AmazonPayClientException;
import com.amazon.pay.api.types.Environment;
import com.amazon.pay.api.types.Region;

public void sample() {
    PayConfiguration payConfiguration = null;
    try {
        payConfiguration = new PayConfiguration()
            .setPublicKeyId("YOUR_PUBLIC_KEY_ID")
            .setRegion(Region.YOUR_REGION_CODE)
            .setPrivateKey("YOUR_PRIVATE_KEY".toCharArray())
            .setEnvironment(Environment.SANDBOX)
            .setAlgorithm("AMZN-PAY-RSASSA-PSS-V2");

        WebstoreClient webstoreClient = new WebstoreClient(payConfiguration);
        AmazonPayResponse response = webstoreClient.getChargePermission('S01-5105180-3221187');
    } catch (AmazonPayClientException e) {
        e.printStackTrace();
    }
}

```

</div>
  </div>
  <div role="tabpanel" class="tab-pane" id="nodejstab-getChargePermission-NESK">
<div markdown="block">
```html
const fs = require('fs');
const Client = require('@amazonpay/amazon-pay-api-sdk-nodejs');

const config = {
    publicKeyId: 'YOUR_PUBLIC_KEY_ID',
    privateKey: fs.readFileSync('tst/private.pem'),
    region: 'YOUR_REGION_CODE',
    sandbox: true,
    algorithm: 'AMZN-PAY-RSASSA-PSS-V2' 
};    
                
const testPayClient = new Client.WebStoreClient(config);
const response = testPayClient.getChargePermission('S01-5105180-3221187');

response.then(function (result) {
    console.log(result.data);
}).catch(err => {
    console.log(err);
});
```

</div>
  </div>
</div>
</div>

#### Response

```
{
    "chargePermissionId": "S01-5105180-3221187",
    "chargePermissionReferenceId": null,
    "chargePermissionType": "Recurring",   
    "recurringMetadata": {
        "frequency": {
            "unit": "Month",
            "value": "1" 
        },
        "amount": {
            "amount": "14",
            "currencyCode": "USD"
        }
    },
    "buyer": {
        "buyerId": "buyerId",
        "name": "name-1",
        "email": "name@amazon.com",
        "phoneNumber": "800-000-0000",
        "primeMembershipTypes": null
    },
    "releaseEnvironment": "Live",
    "shippingAddress": {  // Null for PayOnly product type
        "name": "Work",
        "addressLine1": "440 Terry Ave",
        "addressLine2": "",
        "addressLine3": "",
        "city": "Seattle",
        "county": "King",
        "district": "Seattle",
        "stateOrRegion": "WA",
        "postalCode": "98121",
        "countryCode": "US",
        "phoneNumber": "800-000-0000"
    },
    "billingAddress": { 
        "name": "Work",
        "addressLine1": "440 Terry Ave",
        "addressLine2": "",
        "addressLine3": "",
        "city": "Seattle",
        "county": "King",
        "district": "Seattle",
        "stateOrRegion": "WA",
        "postalCode": "98121",
        "countryCode": "US",
        "phoneNumber": "800-000-0000"
    },
    "paymentPreferences": [{
        "paymentDescriptor": null
    }],
    "statusDetails": {
        "state": "Chargeable",
        "reasons": null,
        "lastUpdatedTimestamp": "20190714T155300Z"
    },
    "creationTimestamp": "20190714T155300Z",
    "expirationTimestamp": "20190715T155300Z",
    "merchantMetadata": {
        "merchantReferenceId": "123-77-876", 
        "merchantStoreName": "AmazonTestStoreFront",
        "noteToBuyer": "merchantNoteForBuyer",
        "customInformation": "This is custom information"
    },
    "platformId": "SPId",
    "limits": {
        "amountLimit": {
            "amount": "14.00",
            "currencyCode": "USD"
        },
        "amountBalance": {
            "amount": "14.00",
            "currencyCode": "USD"
        }
    },
    "presentmentCurrency": "USD"
}
```






