Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 3.48 KB

Transaction.md

File metadata and controls

87 lines (67 loc) · 3.48 KB

Transaction

You can use the APIs below to interface with Xendit's Transaction API. To start using the API, you need to destruct instantiated Xendit client or directly import the module and set the secret key.

import { Xendit, Transaction as TransactionClient } from 'xendit-node';

const xenditClient = new Xendit({secretKey: YOUR_SECRET_KEY})
const { Transaction } = xenditClient

const xenditTransactionClient = new TransactionClient({secretKey: YOUR_SECRET_KEY})

// At this point, `Transaction` and `xenditTransactionClient` will have no usage difference, for example:
// Transaction.
// or
// xenditTransactionClient.

All URIs are relative to https://api.xendit.co, except if the operation defines another base path.

Method HTTP request Description
getTransactionByID() GET /transactions/{id} Get a transaction based on its id
getAllTransactions() GET /transactions Get a list of transactions

getTransactionByID() Function

Function Signature

Name Value
Function Name getTransactionByID
Request Parameters GetTransactionByIDRequest
Return Type TransactionResponse

Request Parameters - GetTransactionByIDRequest

Field Name Type Required Default
id string ☑️
forUserId string

Usage Example

import { TransactionResponse } from 'xendit-node/balance_and_transaction/models'

const response: TransactionResponse = await xenditTransactionClient.getTransactionByID({ 
    id: "id_example",
)

getAllTransactions() Function

Function Signature

Name Value
Function Name getAllTransactions
Request Parameters GetAllTransactionsRequest
Return Type TransactionsResponse

Request Parameters - GetAllTransactionsRequest

Field Name Type Required Default
forUserId string
types TransactionTypes[]
statuses TransactionStatuses[]
channelCategories ChannelsCategories[]
referenceId string
productId string
accountIdentifier string
amount number
currency Currency
created DateRangeFilter
updated DateRangeFilter
limit number
afterId string
beforeId string

Usage Example

import { TransactionsResponse } from 'xendit-node/balance_and_transaction/models'

const response: TransactionsResponse = await xenditTransactionClient.getAllTransactions({ )

[Back to README]