How to fetch all transactions of a customer using Paystack api - api

I integrated the Paystack API into my mobile app, and it works fine instead of fetching the customer's transactions from Paystack. I want to check the customer's history of transactions on launch and unlock locked features if the last transaction is active.
https://api.paystack.co/customer/customer#gmail.com
The URL above was to fetch the customer's data along with transactions and subscriptions, but no transactions were fetched along with the data returned. It is in test mode. Please what do you suggest obtaining the customer's transactions?

You can fetch transactions for a specific customer by calling the GET /transaction endpoint and passing the customer ID as a query parameter. For example,
GET https://api.paystack.co/transaction?customer=113957392
will fetch all transactions for the customer with ID=113957392. You can get the customer ID by fetching the customer object from GET /customer.

Related

Is it possible to retrive the 'account' associated with a xero bank transaction

I'm using Xero's private API to export bank transactions (so I can automate a bunch of financial reporting).
Retrieving the transactions works well (as documented here https://developer.xero.com/documentation/api/banktransactions) but this endpoint doesn't return the account field associated with each transaction, which I want to use to group the transactions into e.g. "Cost of sale", "Operating expenses" and so on.
Does anyone know of a way to find the account for a given transaction via the API?
Further info:
If the transaction contains line items, then the account associated with each line item is returned by the endpoint above. I'm mostly interested in transactions that do not include line items (the LineItems field is an empty array)
Most of the transactions i'm working with are of the "Spend Money" type
I'm currently using pyxero SDK, but open to other options
The account field is present in Xero's web interface, and on the CSV export available from the web interface.
Our contacts in Xero don't have default accounts.
It is the LineItems of Bank Transactions that have AccountCodes associated with them and I've not been able to find a bank transaction record without a line item in the data I have available to me.
Is it possible that you are not implementing paging? From the bank transactions documentation you linked to above:
Paging BankTransactions (recommended)
To utilise paging, append a page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned.
By using paging all the line item details for each bank transaction are returned which may avoid the need to retrieve each individual bank transaction.
I'm not familiar with the pyXero implementation, but it looks like they support Xero paging. From the pyXero readme:
# Grab 100 invoices created after 01-01-2013
xero.invoices.filter(since=datetime(2013, 1, 1), page=1)

How do I access all the information for a Square transaction?

I am a student (so I am pretty new to all of this stuff) trying to create a database for a coffee shop that uses Square for their register and website. I want the database to update with all the information from a transaction every time one is completed.
I have a webhook that gets me the IDs every time a transaction completes, I can send the transaction ID to the Square API with an http request and get back information about the payment, but I still cannot figure out how to get the rest of the transaction information. We want to query the database about what kinds of items are being sold when and with what modifiers, but so far the only way I can get that is through downloading a csv file with the item line information from the Square Dashboard.
If there is a way to get the line item information in some kind of way that can be automatically added to the database, I would really appreciate the help. I have been looking for a solution and cannot find it on my own.
For in-person payments the only way to see itemizations is to use V1 ListPayments (or RetrievePayment).
In order to see itemizations for online payments, you must utilize Square's Orders API. The workflow would be:
Create an order (CreateOrder) with line_items (can be ad-hoc, or use Catalog ids). Save the order_id for the next step.
When calling Charge, pass in the order_id from the previous step.
Once you are successfully attaching the order_id's, when you retrieve a transaction you will be able to call the BatchRetrieveOrders endpoint with the order_id to see the itemizations.
References:
V1 Payments
Orders Overview
Orders Reference

Transaction doesn't contain customer_id

I am building a square API where I need to know customer_id for the
GET /v2/locations/{location_id}/transactions
Documentation says that it returns objects of
Transaction[]
And transaction should include customer_id
But my responses are not returning customer_id
All transtactions are connected with a customer in square
EDIT: I am using PHP Rest API, and I am looking for id that is connected to the customer who made that transaction. I am bulding CRM system so I need to connect all transactions to users in the CRM (CRM has stored id of the customer)

Yodlee - how to get only new transactions

I am looking for a way to get only 'new' transactions from specific account item. I.e. only transactions that was posted to account after I made previous transactions fetch/search.
For example I have the following scenario:
I have add item to consumer. Lets say consumer have 1 account item named 'BankAccount1'.
I fetch/search ALL transactions for some BankAccount1 and store transactions locally.
Now I need a way to get only new transactions on periodic basis. I.e. only transactions that was posted to 'BankAccount1' after previous fetch/search call. Is it possible to do this or I need to get all transactions every time and just skip transactions with Id which already present locally? If transaction Id is unique and incremental (did they?) maybe its possible to save last fetched transaction Id, and on next time get only transactions with Id > prevFetchId (what API to use if its possible)?
p.s.
I am using container based approach REST API.
As per your question, I can infer that you are going to store transactions locally in your DB. In that case Yodlee recommend to use Procedural Data Extracts, using which you can keep your DB in sync with Yodlee Cloud. You can find more details about it here.
Yodlee recommends you to pass date range in the executeUserSearchRequest API to get the transactions for any specific duration,as getting only new transactions may cause some issues. This is why Yodlee recommends to have few days of overlap, this will help you in not missing any transaction.
Transaction ID would be unique but it may not be incremental.

Get transaction by item account id

Hi I am using rest api to access yodlee aggregation services. i am not able to search transaction by item account id. My rest query is as follows
parameters = {
'transactionSearchRequest.searchFilter.itemAcctId'=>itemId,
'cobSessionToken'=>cobSessionToken,
'userSessionToken'=>userSessionToken,
'transactionSearchRequest.containerType'=>con_name,
'transactionSearchRequest.lowerFetchLimit'=>0,
'transactionSearchRequest.resultRange.endNumber'=>500,
'transactionSearchRequest.higherFetchLimit'=>500,
'transactionSearchRequest.resultRange.startNumber'=>1,
'transactionSearchRequest.ignoreUserInput'=>'true',
'transactionSearchRequest.searchFilter.transactionSplitType.splitType'=>"A"
}
The response is always all the transactions for the user instead of transactions for a particular item account id.
Any help is appreciated
You are passing ItemId but the parameter passed should be ItemAccoutnId.
Difference between ItemId and ItemAccountId -
when you link a site say "Citibank" then an itemId is created and then say you have a saving and a checking account under Citibank then both these accounts will have an unique identifier called itemAccountId.
Hence the transaction search takes itemAccountId as the parameter and will return transaction only for that account.
Please use below API to get ItemAccountId and pass it to the transaction Search.
https://developer.yodlee.com/Aggregation_API/Aggregation_Services_Guide/Aggregation_REST_API_Reference/getItemSummaryForItem1