Transaction API
Retrieve information about transactions that have occurred on your account. A transaction occurs when an amount has been successfully transferred between the buyer and the seller. For example, a completed charge generates one transaction of type “credit”.
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
id | string | The transaction identifier matching |
location | string | API path to retrieve the current |
amount | integer | Transaction amount in smallest unit of transaction currency. |
created | string | UTC datetime of transaction creation in ISO 8601 format ( |
currency | string | Currency for transaction as three-letter ISO 4217 code. |
source | object_id_expandable | Origin for transaction. One of charge, refund, transfer, dispute, or receipt (identifier). |
transferable | string | UTC datetime of the point at transaction amount becomes part of available balance in ISO 8601 format ( |
type | string | One of |
Example
-
JSON Response
{ "object": "transaction", "currency": "thb", "amount": 11862, "id": "trxn_test_no1t4tnemucod0e51mo", "source": "chrg_test_no1t4tnemucod0e51mo", "location": "/transactions/trxn_test_no1t4tnemucod0e51mo", "type": "credit", "created": "2019-12-31T12:59:59Z", "transferable": "2019-12-31T12:59:59Z" }
List transactions
- GET https://api.omise.co/transactionsReturns a list of transactions belonging to your account.
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (optional, default: |
limit | integer | (optional, default: |
offset | integer | (optional, default: |
order | string | (optional, default: |
to | string | (optional) Latest UTC datetime for returned records in ISO 8601 format ( |
Example
-
List all transactions
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transactions \ -u $OMISE_SECRET_KEY:
<?php $transactions = OmiseTransaction::retrieve();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const customer = await omise.transactions.list(); console.log(customer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transactions = Omise::Transaction.retrieve
var transactions = await Client.Transactions.GetList(order: Ordering.ReverseChronological); Console.WriteLine($"total transactions to-date: {transactions.Total}");
ScopedList<Transaction> transactions = client.transactions().list(); System.out.printf("no. of transactions: %d", transactions.getTotal());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transactions = omise.Transaction.retrieve()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.TransactionList{} err := client.Do(result, &operations.ListTransactions{ 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.Transaction.list
Retrieve a transaction
- GET https://api.omise.co/transactions/{id}Returns the transaction matching :id
.
Example
-
Retrieve a transaction
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/transactions/trxn_test_5fzo4nqrnop03djdde1 \ -u $OMISE_SECRET_KEY:
<?php $transactions = OmiseTransaction::retrieve('trxn_test_4xuy2z4w5vmvq4x5pfs');
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const customer = await omise.transactions.retrieve('trxn_test_no1t4tnemucod0e51mo'); console.log(customer);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" transaction = Omise::Transaction.retrieve("trxn_test_4xuy2z4w5vmvq4x5pfs")
var transactionId = "trxn_test_58fmj4hion95mndc96d"; var transaction = await Client.Transactions.Get(transactionId); Console.WriteLine($"transaction amount: {transaction.Amount}");
Transaction transaction = client.transactions().get("trxn_test_4xuy2z4w5vmvq4x5pfs"); System.out.printf("transaction amount: %d", transaction.getAmount());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" transaction = omise.Transaction.retrieve("trxn_test_no1t4tnemucod0e51mo")
client, _ := omise.NewClient( "pkey_test_5no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Transaction{} err := client.Do(result, &operations.RetrieveTransaction{ TransactionID: "trxn_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Transaction.retrieve("trxn_test_4xuy2z4w5vmvq4x5pfs")