# Amazon Hosted Page上で特定の住所をブロックしたいです。

ボタンレンダー時にdeliverySpecifications － addressRestrictionsパラメータを使用して配送先アドレス制限を指定し、購入者がAmazonの配送先リストからサポートされていない住所が選択できないようにすることができます。

* 日本国内(JPの住所)のみを許可する
* 都道府県名に誤りがある住所の使用を許可しない
* 国外住所と、一部の都道府県を制限する(指定した国コードとJPの一部を許可しない)
* 特定の郵便番号を制限する

などが可能です。[インテグレーションガイド サンプル](https://developer.amazon.com/ja/docs/amazon-pay-checkout/address-restriction-samples.html) および[FAQ Amazon PayボタンのPayloadのサンプルが知りたいです。](https://www.amazonpay-faq.jp/faq/QA-82) をご参照ください。


![Alt text](https://d2squ3eekfa1zc.cloudfront.net/image/QA-559.png)


また条件を除外するための "except", 任意の長さの任意の文字列"*", 任意の一文字 "?" ワイルドカードもご利用可能です。

日本国内を許可かつ北海道・沖縄県を除外する場合

```
"deliverySpecifications": {
  "addressRestrictions": {
    "type": "Allowed",
    "restrictions": {
      "JP": {
        "except": {
          "statesOrRegions": [
            "北海道", "沖縄県"
          ]
        },
      },
    }
  }
}
```


123- から始まる郵便番号を許可する場合

```
"deliverySpecifications": {
    "addressRestrictions": {
        "type": "Allowed",
        "restrictions": {
            "JP": {
                "zipCodes": ["123-*"]
            }
        }
    }
}
```




## 参考
[配送先アドレス制限のサンプル](https://developer.amazon.com/ja/docs/amazon-pay-checkout/address-restriction-samples.html)
[Checkout Session](https://developer.amazon.com/ja/docs/amazon-pay-api-v2/checkout-session.html#type-deliveryspecifications)