Transaction doesn't contain customer_id - square

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)

Related

How to fetch all transactions of a customer using Paystack 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.

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

How to retrieve Square orderIds for Call to BatchRetrieveORders

I want to retrieve a list of orders using the Square API. The call to retrieve orders is a POST call with a String array of order_ids however I'm not sure where I can get this information. In the docs they said I can use the ListTransactions endpoint to get this information but I'm not able to find the order_id within the response.
The documentation to retrieve Orders located at: https://docs.connect.squareup.com/api/connect/v2#endpoint-batchretrieveorders
see sample response of ListTransactions: https://docs.connect.squareup.com/api/connect/v2#endpoint-listtransactions
The Orders API does not support listing of orders. To access order
details, you will need to fetch the order's ID by querying
transactions using the ListTransactions and RetrieveTransaction
endpoints, and then fetching the order using the BatchRetrieveOrders
endpoint
Reference: https://docs.connect.squareup.com/articles/orders-api-overview
The goal is to get a list of recent transactions/orders that list out exactly what was purchased. The Transactions model doesn't contain Items whereas the Orders model does.
The Transaction object will include an order_id field if you included it during the Charge request. If you did not pass the order_id to the Charge request, then it will not show up.
Furthermore - just for clarity's sake, if you use Square Point of Sale, or if you haven't included the order_id previously but still would like to view itemizations for transactions, please look at V1 ListPayments which will include it even if there's no order_id.
References:
https://docs.connect.squareup.com/api/connect/v2#type-transaction
https://docs.connect.squareup.com/api/connect/v1#get-payments

Square Connect API - API - order

I am developing an application to integrate with square, and I can create orders, but when I consult them with:
https://connect.squareup.com/v2/locations/xxxxxxxxxxxxxx/orders/batch-retrieve
it brings me null
From the docs: Retrieves a set of Orders by their IDs. Only orders that have been successfully charged are included in the response. I'm betting that either you haven't charged the orders yet, or aren't providing the right ids to retrieve.
https://docs.connect.squareup.com/api/connect/v2#endpoint-batchretrieveorders

Retrieval of all the invoices of particular contact id in xero

In xero, if we create a contact. Using that contact we perform couple of sales invoice and purchase bills and few of them get paid. Now I want to obtain the list of the invoices groupedBy ContactID in php
Xero have recently released functionality that allows this in an easy way.
You can use the ContactIDs query parameter on the invoices endpoint like the following:
GET ../Invoices?ContactIDs=623e392d-7402-40e4-a54c-fdf29783e9a4
You can also do this for more than one ContactID by supplying a comma separated list of ContactIDs.
You can find more information about this in this handy blog post