全領収書の一覧取得
日次領収書のページネーションされたコレクションを返します。領収書はアカウントのトランザクションと振込手数料を累積します。
リクエストパラメータ
追加 - 5フィールド追加パラメータ
レスポンス
200
取得成功領収書リストが正常に取得されました。メタデータ付きのページネーションされたリストを返します。
レスポンス構造:
object- 常に "list" を返すdata- 領収書オブジェクトの配列limit- ページあたりのレコード数offset- スキップされたレコード数total- フィルターに一致する領収書の総数
401
認証エラー認証に失敗しました。APIキーが無効または欠落しています。
一般的な原因:
- Authorizationヘッダーの欠落
- 無効なシークレットキー
- シークレットキーの代わりにパブリックキーを使用
- 不正なHTTP Basic Auth形式
5xx
サーバーエラーサーバー側でエラーが発生しました。これらは稀ですが、適切に処理する必要があります。
対処方法:
- 指数バックオフでリクエストを再試行
- status.omise.coでサービスインシデントを確認
- 詳細なガイダンスはエラー処理を参照
コードサンプル
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/receipts \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d "limit=20" \
-d "offset=0"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipts = Omise::Receipt.list(
limit: 20,
offset: 0
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
receipts = omise.Receipt.list(
limit=20,
offset=0
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const receipts = await omise.receipts.list({
limit: 20,
offset: 0
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$receipts = OmiseReceipt::retrieve([
'limit' => 20,
'offset' => 0
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Receipt> receipts = client.receipts().list()
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var receipts = await client.Receipts.GetList(new ListOptions
{
Limit = 20,
Offset = 0
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
receipts, _ := client.Receipts().List(&omise.ListParams{
Limit: 20,
Offset: 0,
})
エラーと結果コード
一般的なエラーコード
| コード | 説明 | 解決方法 |
|---|---|---|
bad_request | パラメータの欠落または無効 | パラメータの値と形式を確認 |
authentication_failure | 無効なAPIキー | シークレット キーが正しいことを確認 |
invalid_date_format | 日付形式の検証に失敗 | ISO 8601形式(YYYY-MM-DDTHH:MM:SSZ)を使用 |
領収書オブジェクトフィールド
| フィールド | 型 | 説明 |
|---|---|---|
object | string | 常に "receipt" を返す |
id | string | 領収書識別子(rcpt_*) |
livemode | boolean | 本番環境かテスト環境かのインジケーター |
location | string | 領収書オブジェクトへのAPIパス |
adjustment_transaction | string | 関連する調整トランザクションID |
charge_fee | integer | 最小通貨単位でのOmise課金手数料 |
company_address | string | Omise会社住所 |
company_name | string | Omise会社名 |
company_tax_id | string | Omise会社税番号 |
credit_note | boolean | これがクレジットノートかどうか |
currency | string | 3文字のISO 4217コード |
customer_address | string | マーチャント住所 |
customer_email | string | マーチャントメール |
customer_name | string | マーチャント名 |
customer_statement_name | string | マーチャント明細名 |
customer_tax_id | string | マーチャント税番号 |
issued_on | string | 領収書発行日 |
number | string | 領収書番号 |
subtotal | integer | 税抜き小計 |
total | integer | 合計(subtotal + vat - whtとして計算) |
transaction_fee | integer | 最小通貨単位でのトランザクション手数料 |
transfer_fee | integer | 最小通貨単位での振込手数料 |
vat | integer | VAT金額 |
voided_fee | integer | 無効化手数料金額 |
wht | integer | 源泉徴収税金額 |
created_at | string | ISO 8601形式のUTC日時 |
API認証情報
試してみる
追加 - 5項目
あなたのIP:
...読み込み中...