チェーン付き送金を作成
merchant_idパラメータを使用して送金を作成し、課金チェーンにリンクします。これにより、タイミングと金額を完全に制御した手動マーケットプレイス送金が可能になります。
API認証情報
リクエストパラメータ
必須 - 2 フィールド必須パラメータ
`amount`INTEGER(required)
最小通貨単位での送金額(THBはサタン、USDはセント、JPYは円)。
`recipient`STRING(required)
送金を受け取る受取人ID。認証済みの受取人である必要があります。
推奨 - 1 フィールド推奨パラメータ
追加 - 1 フィールド追加パラメータ
レスポンス
200
作成成功送金の作成に成功しました。送金は24時間以内に受取人の銀行口座に送られます。
レスポンスに含まれる情報:
id- 送金IDamount- 送金額recipient- 受取人IDsent- 送金が銀行に送られたかどうかpaid- 受取人が資金を受け取ったかどうか
400
不正なリクエストリクエストの検証に失敗しました。詳細はエラーメッセージを確認してください。
一般的な原因:
- 必須フィールドの欠落(
amount、recipient) - 無効な金額(負または0)
- 無効な受取人ID形式
- 無効なmerchant_id(課金ID)形式
401
認証エラー認証に失敗しました。APIキーが無効または不足しています。
一般的な原因:
- Authorizationヘッダーの欠落
- 無効なシークレットキー
- シークレットキーの代わりにパブリックキーを使用
- HTTP Basic Auth形式の誤り
422
処理不可能なエンティティビジネスロジックの制約により送金を処理できません。
一般的な原因:
- 送金に十分な残高がない
- 受取人が認証されていない
- 受取人が非アクティブまたは取り消し済み
- 送金額が上限を超えている
5xx
サーバーエラーサーバー側でエラーが発生しました。稀ですが、適切に処理する必要があります。
対処方法:
- 指数バックオフでリクエストを再試行
- status.omise.coでサービスインシデントを確認
- 詳細なガイダンスはエラー処理を参照
コードサンプル
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/transfers \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "amount=85000" \
-d "recipient=recp_test_5xuy4w91xqz7d1w9u0t" \
-d "merchant_id=chrg_test_5xuy4w91xqz7d1w9u0t"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = Omise::Transfer.create({
amount: 85000,
recipient: 'recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id: 'chrg_test_5xuy4w91xqz7d1w9u0t'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
transfer = omise.Transfer.create(
amount=85000,
recipient='recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id='chrg_test_5xuy4w91xqz7d1w9u0t'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const transfer = await omise.transfers.create({
amount: 85000,
recipient: 'recp_test_5xuy4w91xqz7d1w9u0t',
merchant_id: 'chrg_test_5xuy4w91xqz7d1w9u0t'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$transfer = OmiseTransfer::create([
'amount' => 85000,
'recipient' => 'recp_test_5xuy4w91xqz7d1w9u0t',
'merchant_id' => 'chrg_test_5xuy4w91xqz7d1w9u0t'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Transfer transfer = client.transfers().create()
.amount(85000L)
.recipient("recp_test_5xuy4w91xqz7d1w9u0t")
.merchantId("chrg_test_5xuy4w91xqz7d1w9u0t")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var transfer = await client.Transfers.Create(new CreateTransferRequest
{
Amount = 85000,
Recipient = "recp_test_5xuy4w91xqz7d1w9u0t",
MerchantId = "chrg_test_5xuy4w91xqz7d1w9u0t"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
transfer, _ := client.Transfers().Create(&operations.CreateTransfer{
Amount: 85000,
Recipient: "recp_test_5xuy4w91xqz7d1w9u0t",
MerchantId: "chrg_test_5xuy4w91xqz7d1w9u0t",
})