Transfer API

Transfer API ใช้เพื่อสร้างหรือเรียกข้อมูลการโอนเงินไปยังบัญชีธนาคารที่ได้มีการเพิ่มไว้กับบัญชีผู้ใช้โอมิเซะ โดยพื้นฐานของระบบแล้ว รายการโอนเงินที่มีการตั้งขึ้นใหม่จะยังไม่มีการส่งคำสั่งไปยังธนาคารและยอดที่ได้ตั้งไว้ก็จะยังไม่มีการโอนเข้าบัญชีธนาคาร ส่วนการโอนเงินไปยังบัญชีธนาคารของผู้รับเงินอื่นๆ บัญชีนั้นๆ จะต้องได้รับการตรวจสอบและอนุมัติจากทางโอมิเซะก่อน

Attribute

Name Type Description
object string

The string transfer.

id object_id

The TRANSFER_ID matching /trsf(_test)?_[0-9a-z]+/.

livemode boolean

Whether this is a live (true) or test (false) transfer.

location string

API path to retrieve the current transfer object.

amount integer

Amount for transfer in smallest currency unit.

bank_account bank_account

Destination bank account for transfer.

created datetime

UTC datetime of the creation of the transfer in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

currency string

Currency for transfer as three-letter ISO 4217 code.

fail_fast boolean

Whether the transfer will avoid retrying in the case of failure: true if the transfer will not be retried, false if it will be retried.

failure_code string

Failure code for transfer. One of insufficient_balance, invalid_recipient, transfers_suspended, transfer_deleted, transfer_sent, or transfer_failed.

failure_message string

Message describing the failure if failure_code exists.

fee integer

Transfer fee.

metadata Object

Custom metadata (e.g. {"customer-id": 42}) for transfer.

paid boolean

Whether the transfer was paid.

paid_at datetime

UTC datetime of the transfer payment in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

recipient object_id

RECIPIENT_ID to which the transfer was sent.

sent boolean

Whether the transfer was sent.

sent_at datetime

UTC datetime of the transfer send event in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

transaction string

TRANSACTION_ID of the transfer.

Example

  • Json Response

List all transfers

- GET https://api.omise.co/transfers

Returns a list of all transfer objects belonging to your account.

Request Parameter

Name Type Description
offset integer

(optional, default: 0) Offset of the first record returned (i.e. how many records to skip from the beginning).

limit integer

(optional, default: 20, maximum: 100) Number of records to return.

from datetime

(optional, default: 1970-01-01T00:00:00Z) Earliest UTC date and time for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

to datetime

(optional, default: current UTC datetime) Latest UTC datetime for returned records in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

order string

(optional, default: chronological) Order in which to return records. One of chronological (earliest to latest) or reverse_chronological (latest to earliest).

Example

  • List all transfers

Create a transfer

- POST https://api.omise.co/transfers

Returns a new transfer object.

Request Parameter

Name Type Description
amount integer

(optional, default: the available balance) The transfer amount as a positive integer in the smallest currency unit (e.g. 100 for 1 THB).

recipient object_id

(optional, default: the recipient ID of the account's default recipient.) The transfer recipient.

fail_fast boolean

(optional, default: false) Whether to avoid daily retry of the transfer in case of failure (e.g. insufficient balance, inactive recipient).

metadata Object

(optional) The custom metadata (e.g. {"customer-id": 42}) to attach to the transfer.

Example

  • Create a transfer

  • Create a transfer to a third-party recipient

Retrieve a transfer

- GET https://api.omise.co/transfers/TRANSFER_ID

Returns an existing transfer object.

Example

  • Retrieve a transfer

Update a transfer

- PATCH https://api.omise.co/transfers/TRANSFER_ID

Returns the updated transfer object.

Request Parameter

Name Type Description
amount integer

The amount in the smallest subunits of the currency used. So for thb (Thai Baht) you will need to pass the amount in satang.

metadata Object

(optional) The custom metadata (e.g. {"customer-id": 42}) to attach to the transfer.

Example

  • Update a transfer

Destroy a transfer

- DELETE https://api.omise.co/transfers/TRANSFER_ID

Returns the destroyed transfer object.

Example

  • Destroy a transfer

  • JSON Response

Mark a transfer as paid in test mode

- POST https://api.omise.co/transfers/TRANSFER_ID/mark_as_paid

This 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

Mark a transfer as sent in test mode

- POST https://api.omise.co/transfers/TRANSFER_ID/mark_as_sent

This 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