送金の更新
送金ステータス情報を更新します。このエンドポイントは主にWebhookコールバックが送金の成功/失敗ステータスと関連詳細を更新するために使用されます。
リクエストパラメータ
必須 - 1項目必須パラメータ
`id`STRING(required)
送金ID(例: trsf_test_...)。URLパスで指定します。
追加 - 3項目追加パラメータ
`success`BOOLEAN(optional)
送金が成功したか失敗したかを示します。
`failure_code`STRING(optional)
失敗のタイプを示すコード。successがfalseの場合は必須です。
`failure_message`STRING(optional)
人間が読める失敗の説明。何が問題だったかについての追加コンテキストを提供します。
レスポンス
200
取引成功送金が正常に更新されました。更新された送金オブジェクトを返します。
更新された送金属性:
failure_code- 送金が失敗した場合のエラーコードfailure_message- 人間が読める失敗の説明- その他の送金属性は変更されません
400
不正なリクエストリクエストの検証に失敗しました。詳細はエラーメッセージを確認してください。
一般的な原因:
- 無効な
failure_codeの値 - successがfalseの場合に
failure_codeが欠落 - 既に完了した送金は更新できません
401
認証エラー認証に失敗しました。無効または欠落したAPIキーです。
一般的な原因:
- Authorizationヘッダーの欠落
- 無効なシークレットキー
- シークレットキーの代わりにパブリックキーを使用
- 不正なHTTP Basic Auth形式
404
見つかりません送金が見つかりません。
一般的な原因:
- 無効な送金ID
- 送金がアカウントに属していない
- 送金が削除された
- テストモードとライブモードのIDが混在
5xx
サーバーエラーサーバー側でエラーが発生しました。これはまれですが、適切に処理する必要があります。
対処方法:
- 指数バックオフでリクエストを再試行
- status.omise.coでサービス障害を確認
- 詳細なガイダンスについてはエラー処理を参照
コードサンプル
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/transfers/trsf_test_5xuy4w91xqz7d1w9u0t \
-X PATCH \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "success=false" \
-d "failure_code=insufficient_balance" \
-d "failure_message=Insufficient funds to complete the transfer"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = Omise::Transfer.update('trsf_test_5xuy4w91xqz7d1w9u0t', {
success: false,
failure_code: 'insufficient_balance',
failure_message: 'Insufficient funds to complete the transfer'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = omise.Transfer.update('trsf_test_5xuy4w91xqz7d1w9u0t',
success=False,
failure_code='insufficient_balance',
failure_message='Insufficient funds to complete the transfer'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const transfer = await omise.transfers.update('trsf_test_5xuy4w91xqz7d1w9u0t', {
success: false,
failure_code: 'insufficient_balance',
failure_message: 'Insufficient funds to complete the transfer'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$transfer = OmiseTransfer::retrieve('trsf_test_5xuy4w91xqz7d1w9u0t');
$transfer->update([
'success' => false,
'failure_code' => 'insufficient_balance',
'failure_message' => 'Insufficient funds to complete the transfer'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Transfer transfer = client.transfers()
.update("trsf_test_5xuy4w91xqz7d1w9u0t")
.success(false)
.failureCode("insufficient_balance")
.failureMessage("Insufficient funds to complete the transfer")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var transfer = await client.Transfers.Update("trsf_test_5xuy4w91xqz7d1w9u0t", new UpdateTransferRequest
{
Success = false,
FailureCode = "insufficient_balance",
FailureMessage = "Insufficient funds to complete the transfer"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
transfer, _ := client.Transfers().Update("trsf_test_5xuy4w91xqz7d1w9u0t", &operations.UpdateTransfer{
Success: false,
FailureCode: "insufficient_balance",
FailureMessage: "Insufficient funds to complete the transfer",
})
エラーコード
失敗コード
| コード | 説明 |
|---|---|
insufficient_balance | 送金を完了するための資金が不足 |
invalid_recipient | 受取人IDが見つからないか無効 |
transfers_suspended | アカウントで送金が無効化されている |
transfer_deleted | 送金が削除された |
transfer_sent | 送金は既に送信済み |
transfer_failed | 送金処理が失敗 |
API認証情報
試してみる
必須 - 1項目
追加 - 3項目
あなたのIP:
...読み込み中...