Transfer (送金)
Transfers (送金) API リファレンス
Attributes
Name | Type | Description |
---|---|---|
object | string | 固定値 |
id | string |
|
livemode | boolean | 本番モード ( |
location | string | 現在の |
amount | integer | 最小通貨単位での振込金額。 |
bank_account | bank_account | 振込先の銀行口座。 |
created_at | string | ISO 8601 形式 ( |
currency | string | 小文字3桁の国際識別コードで、ISO 4217規格 によって定義された通貨 |
deleted | boolean | 送金が削除されたかどうか。 |
fail_fast | boolean | 送金が失敗した場合に再試行を回避するかどうか。送金を再試行しない場合はtrue、再試行する場合はfalseとなります。 |
failure_code | string | 振込のエラーコード。 |
failure_message | string |
|
fee | integer | Opn Payments 送金手数料。 |
fee_vat | integer | 「手数料」にかかる付加価値税。 |
merchant_name | string | 振込を実行したサブマーチャントの名前です。 注: このフィールドは、加盟店がプラットフォーム向けソリューションを導入している場合にのみ適用されます。プラットフォーム向けソリューションのご利用については、Opn サポートまでお問い合わせください。 |
merchant_uid | string | 振込を実行したサブマーチャントのIDです。 注: このフィールドは、加盟店がプラットフォーム向けソリューションを導入している場合にのみ適用されます。プラットフォーム向けソリューションのご利用については、Opn サポートまでお問い合わせください。 |
metadata | object | 振込用のカスタムメタデータ(例: |
net | integer |
|
paid | boolean | 振込が行われたかどうか。 |
paid_at | string | この課金がISO8601形式( |
recipient | object_id_expandable | 送金が行われた追加振込先口座のID。 |
schedule | object_id_expandable | Schedule associated with transfer. |
sendable | boolean | 送金できるかどうか。送金の際に「送金可能」を確認するため、送金額は利用可能な金額以下であること、受取口座は検証され、かつアクティブの状態であること、そして未送信の振込であることが必要です。送金は一時停止しないでください。送金の開始時に上記要件のいずれかが満たされない場合は、送金が失敗することがあります。 |
sent | boolean | 振込が送金されたかどうか。 |
sent_at | string | この課金がISO8601形式( |
total_fee | integer | 総手数料( |
transactions | array | 送金に関連した |
Example
-
JSON Response
{ "object": "transfer", "id": "trsf_test_no1t4tnemucod0e51mo", "livemode": false, "location": "/transfers/trsf_test_no1t4tnemucod0e51mo", "deleted": false, "fail_fast": false, "paid": false, "sent": false, "sendable": true, "currency": "THB", "amount": 47448, "fee": 2804, "metadata": {}, "recipient": "recp_test_no1t4tnemucod0e51mo", "bank_account": { "object": "bank_account", "livemode": false, "last_digits": "6789", "account_number": "123456789", "name": "DEFAULT BANK ACCOUNT", "type": null, "created_at": "2019-12-31T12:59:59Z", "brand": "Test Bank", "bank_code": "test", "branch_code": null }, "failure_code": null, "failure_message": null, "paid_at": null, "sent_at": null, "created_at": "2019-12-31T12:59:59Z", "transactions": [], "schedule": null, "fee_vat": 196, "net": 44448, "total_fee": 3000 }
Callback
- PATCH https://api.omise.co/transfers/{id}振込ステータス(成功/失敗)を戻します。
Request Parameters
Name | Type | Description |
---|---|---|
failure_code | string | (任意) 振込のエラーコード。 |
failure_message | string | (任意) |
success | boolean | (任意, one of: |
新しい送金の作成
- POST https://api.omise.co/transfers新しい送金の作成をします。
Request Parameters
Name | Type | Description |
---|---|---|
amount | integer | (任意) 最小通貨単位での振込金額。 |
fail_fast | boolean | (任意, one of: |
idemp_key | string | (任意) Idemp key |
metadata | object | (任意) 振込用のカスタムメタデータ(例: |
recipient | string | (任意) 送金が行われた追加振込先口座のID。 |
split_transfer | boolean | (任意, one of: |
Example
-
新しい送金の作成
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transfers \ -u $OMISE_SECRET_KEY: \ -d "amount=100000" \ -d "fail_fast=true"
<?php $transfer = OmiseTransfer::create(array( 'amount' => 100000 ));
const omise = require('omise')({ secretKey: 'skey_test_5tql5ydqyrd76sfv0wd', }); const transfer = await omise.transfers.create({ amount: '20000' }); console.log(transfer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transfer = Omise::Transfer.create(amount: 100000)
var transfer = await Client.Transfers.Create(new CreateTransferRequest { Amount = 200000, FailFast = true, }); Console.WriteLine($"created transfer: {transfer.Id}");
Request<Transfer> request =new Transfer.CreateRequestBuilder() .amount(100000) .build(); Transfer transfer = client().sendRequest(request); System.out.printf("Created transfer: %s", transfer.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transfer = omise.Transfer.create(amount=100000)
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Transfer{} err := client.Do(result, &operations.CreateTransfer{ Amount: 32100, }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transfer.create(amount: 100000)
-
Create a transfer while adding metadata
- curl
- php
- node.js
curl https://api.omise.co/transfers \ -u $OMISE_SECRET_KEY: \ -d "amount=10000" \ -d "fail_fast=true" \ -d "metadata[order_id]=ORDER-1234" \ -d "metadata[color]=black"
<?php $transfer = OmiseTransfer::create(array( 'amount' => 10000, 'fail_fast' => true, 'metadata' => array( 'order_id' => 'ORDER_ID', 'color' => 'pink' ) ));
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const transfer = await omise.transfers.create({ amount: '100000', recipient: 'recp_test_no1t4tnemucod0e51mo', metadata: { order_id: 'ord_test_no1t4tnemucod0e51mo', color: 'pink', }, }); console.log(transfer);
-
指定したRecipientへ新しい送金を作成
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transfers \ -u $OMISE_SECRET_KEY: \ -d "amount=100000" \ -d "recipient=recp_test_5g03h1x1mbpgxp8h1fh"
<?php $transfer = OmiseTransfer::create(array( 'amount' => 100000, 'recipient' => 'recp_test_4z6p7e0m4k40txecj5o' ));
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const transfer = await omise.transfers.create({ amount: '100000', recipient: 'recp_test_no1t4tnemucod0e51mo', }); console.log(transfer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transfer = Omise::Transfer.create({ recipient: "recp_test_4z6p7e0m4k40txecj5o", amount: 100000, })
var recipientId = "recp_test_560ph01r04muv1a28ze"; var transfer = await Client.Transfers.Create(new CreateTransferRequest { Amount = 200000, FailFast = true, Recipient = recipientId, }); Console.WriteLine($"created transfer: {transfer.Id}");
Request<Transfer> request =new Transfer.CreateRequestBuilder() .amount(100000) .recipient("recp_test_4z6p7e0m4k40txecj5o") .build(); Transfer transfer = client().sendRequest(request); System.out.printf("Created transfer: %s", transfer.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transfer = omise.Transfer.create( amount=100000, recipient="recp_test_no1t4tnemucod0e51mo" )
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Transfer{} err := client.Do(result, &operations.CreateTransfer{ Amount: 32100, Recipient: "recp_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transfer.create( recipient: "recp_test_4z6p7e0m4k40txecj5o", amount: 100000 )
送金情報の削除
- DELETE https://api.omise.co/transfers/{id}Transfer IDで指定した送金情報の削除。
Example
-
送金情報の削除
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transfers/trsf_test_5g5iq2185wzdpx2tg3a \ -X DELETE \ -u $OMISE_SECRET_KEY:
<?php $transfer = OmiseTransfer::retrieve('trsf_test_4y3miv1nhy0dceit4w4'); $transfer->destroy(); $transfer->isDestroyed(); # => true
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const transfer = await omise.transfers.destroy('trsf_test_no1t4tnemucod0e51mo'); console.log(transfer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transfer = Omise::Transfer.retrieve("trsf_test_4y3miv1nhy0rceit4w4") transfer.destroy transfer.destroyed? # => true
var transfer = RetrieveTransfer(); transfer = await Client.Transfers.Destroy(transfer.Id); Console.WriteLine($"destroyed transfer: {transfer.Id} ({transfer.Deleted})");
Request<Transfer> request = new Transfer.DestroyRequestBuilder("trsf_test_4xs5px8c36dsanuwztf").build(); Transfer transfer = client().sendRequest(request); System.out.printf("Destroyed transfer: %s", transfer.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transfer = omise.Transfer.retrieve("trsf_test_no1t4tnemucod0e51mo") transfer.destroy() transfer.destroyed # => true
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Deletion{} err := client.Do(result, &operations.DestroyTransfer{ TransferID: "trsf_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transfer.destroy("trsf_test_4y3miv1nhy0rceit4w4")
送金情報リストの取得
- GET https://api.omise.co/transferstransferに属するすべての お客様のアカウントオブジェクトの list を返します。
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (任意, default: |
limit | integer | (任意, default: |
offset | integer | (任意, default: |
order | string | (任意, default: |
to | string | (任意) ISO 8601形式 ( |
Example
-
送金情報リストの取得
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transfers \ -u $OMISE_SECRET_KEY:
<?php $transfers = OmiseTransfer::retrieve();
const omise = require('omise')({ secretKey: 'skey_test_5tql5ydqyrd76sfv0wd', }); const transfer = await omise.transfers.list(); console.log(transfer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transfers = Omise::Transfer.retrieve
var transfers = await Client.Transfers.GetList(order: Ordering.ReverseChronological); Console.WriteLine($"total transfers: {transfers.Total}");
Request<ScopedList<Transfer>> request = new Transfer.ListRequestBuilder().build(); ScopedList<Transfer> transfers = client().sendRequest(request); System.out.printf("Returned transfers: %d", transfers.getData().size()); System.out.printf("Total no. of transfers: %d", transfers.getTotal());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transfers = omise.Transfer.retrieve()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.TransferList{} err := client.Do(result, &operations.ListTransfers{ operations.List{ Limit: 100, From: time.Now().Add(-1 * time.Hour), }, }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transfer.list
Mark a transfer as paid in test mode
- POST https://api.omise.co/transfers/{id}/mark_as_paidThis endpoint allows you to manually mark a test transfer as paid. This can be useful for testing purposes.
Example
-
Mark a test transfer as paid
- curl
curl https://api.omise.co/transfers/trsf_test_5g5iq2185wzdpx2tg3a/mark_as_paid \ -X POST \ -u $OMISE_SECRET_KEY:
Mark a transfer as sent in test mode
- POST https://api.omise.co/transfers/{id}/mark_as_sentThis endpoint allows you to manually mark a test transfer as sent. This can be useful for testing purposes.
Example
-
Mark a test transfer as sent
- curl
curl https://api.omise.co/transfers/trsf_test_5g5iq2185wzdpx2tg3a/mark_as_sent \ -X POST \ -u $OMISE_SECRET_KEY:
送金情報の取得
- GET https://api.omise.co/transfers/{id}Transfer IDで指定した送金情報を返します。
Example
-
送金情報の取得
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transfers/trsf_test_5g5iq2185wzdpx2tg3a \ -u $OMISE_SECRET_KEY:
<?php $transfer = OmiseTransfer::retrieve('trsf_test_4xs5px8c36dsanuwztf');
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const transfer = await omise.transfers.retrieve('trsf_test_no1t4tnemucod0e51mo'); console.log(transfer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transfer = Omise::Transfer.retrieve("trsf_test_4xs5px8c36dsanuwztf")
var transferId = "trsf_test_560ph0660cgiag1xjeh"; var transfer = await Client.Transfers.Get(transferId); Console.WriteLine($"transfer amount: {transfer.Amount}");
Request<Transfer> request = new Transfer.GetRequestBuilder("trsf_test_4xs5px8c36dsanuwztf").build(); Transfer transfer = client().sendRequest(request); System.out.printf("Transfer amount: %d", transfer.getAmount());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transfer = omise.Transfer.retrieve("trsf_test_no1t4tnemucod0e51mo")
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Transfer{} err := client.Do(result, &operations.RetrieveTransfer{ TransferID: "trsf_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transfer.retrieve("trsf_test_4y3miv1nhy0rceit4w4")