0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Stripe APIで tax_rates リスト確認する

Posted at

Stripeの tax_rates ってどこで確認できるの?

  • Stripeの tax_rates は "txr_123khdsbvsbfvjsvsvnsfvs456" のような形式を指します
  • この値はどこからどのように取得したいかわからないという人向けです

Stripe API で取得できます

curlコマンドを使用して税率を取得します。

shell
curl https://api.stripe.com/v1/tax_rates \
-u sk_test_*****: 
  • テスト環境用のAPIキーを用意します。通常、sk_test_で始まるキーを使用します。
  • curlコマンドを使用して税率を取得:
shell
curl https://api.stripe.com/v1/tax_rates \
- -u sk_test_*****: sk_test_1255217ijvsjfkvfskgvjfjvfvlsfhvjslsl
+ -u sk_test_*****:

コロンの後は何も入力しなくていいです。

取得結果は Json で返ってきます

tax_lists.rb
{
  "object": "list",
  "data": [
    {
      "id": "txr_123khdsbvsbfvjsvsvnsfvs456",
      "object": "tax_rate",
      "active": true,
      "country": "JP",
      "created": 0000000000,
      "description": null,
      "display_name": "消費税",
      "effective_percentage": 10.0,
      "inclusive": true,
      "jurisdiction": null,
      "jurisdiction_level": null,
      "livemode": false,
      "metadata": {},
      "percentage": 10.0,
      "state": null,
      "tax_type": null
    },
    {
      "id": "txr_123khdsbvsbfvjsvsvnsfvs456",
      "object": "tax_rate",
      "active": true,
      "country": "JP",
      "created": 0000000000,
      "description": null,
      "display_name": "消費税",
      "effective_percentage": 10.0,
      "inclusive": true,
      "jurisdiction": null,
      "jurisdiction_level": null,
      "livemode": false,
      "metadata": {},
      "percentage": 10.0,
      "state": null,
      "tax_type": null
    }
  ],
  "has_more": false,
  "url": "/v1/tax_rates"
}

一言

  • わぁ、便利〜。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?