How to get order details after purchase

Hello there,
I have a custom storefront made on Laravel, and hosted on my own server. I have an admin panel where I can see all users, and their details.
I’ve created a test product in Infusionsoft.
Product page has Buy button with the link copied from Infusionsoft, when customer clicks on it, he is transferred to Infusionsoft shopping cart page.

Here is a test product:
https://gq185.infusionsoft.com/app/manageCart/addProduct?productId=290

Then I’ve proceed to Infusionsoft’s “Purchase Actions” page
And I’ve set a “Successful Purchase Action” as “Send http post to another server”
I entered url on my web site
Then I purchased that product described above
And got the following a response on my web site:
{
+“Company”: “T”
+“ReferralCode”: “null”
+“ContactType”: “null”
+“Email”: “olmas@ephyros.com
+“CompanyID”: “0”
+“Leadsource”: “gq185.infusionsoft.com
+“ZipFour3”: “null”
+“Birthday”: “null”
+“EmailAddress2”: “null”
+“Latitude”: “null”
+“EmailAddress3”: “null”
+“YourQuestion”: “null”
+“ZipFour2”: “null”
+“ZipFour1”: “null”
+“Industry”: “null”
+“Verified”: “null”
+“Phone4Ext”: “null”
+“LastUpdated”: “2018-04-11 10:06:00.0”
+“Name1”: “null”
+“Nickname”: “null”
+“LastUpdatedBy”: “3”
+“Status”: “null”
+“CreatedBy”: “3”
+“ContactNotes”: “null”
+“DMACode”: “null”
+“AssessmentPromoCode”: “null”
+“Address3Type”: “null”
+“Anniversary”: “null”
+“City”: “T”
+“Address3Street1”: “null”
+“AddMethod”: “null”
+“Longitude”: “null”
+“Phone4Type”: “null”
+“BillingInformation”: “null”
+“Phone3Ext”: “null”
+“Address3Street2”: “null”
+“Suffix”: “null”
+“OwnerID”: “0”
+“AddURL”: “null”
+“State”: “t”
+“PostalCode2”: “null”
+“Country”: “Taiwan (Province of China)”
+“PostalCode3”: “null”
+“Address2Type”: “null”
+“Id”: “16878”
+“LastName”: “T”
+“DateAdded”: “null”
+“Phone5Type”: “null”
+“AssistantPhone”: “null”
+“Fax1Type”: “null”
+“Address1Type”: “null”
+“Message”: “null”
+“AssistantName”: “null”
+“DateCreated”: “2018-04-11 08:56:32.0”
+“PostalCode”: “t”
+“Website”: “null”
+“JobTitle”: “null”
+“StreetAddress2”: “T”
+“DesignationOther”: “null”
+“StreetAddress1”: “T”
+“Country3”: “null”
+“State3”: “null”
+“Country2”: “null”
+“Phone2Ext”: “null”
+“Phone1”: “t”
+“Fax2Type”: “null”
+“State2”: “null”
+“Phone”: “null”
+“Country0”: “null”
+“IndustrySectorOther”: “null”
+“Phone3Type”: “null”
+“Designation”: “null”
+“DateofLastFollowup”: “null”
+“City2”: “null”
+“FirstName”: “T”
+“ReferresName”: “null”
+“City3”: “null”
+“Title”: “null”
+“Phone2Type”: “null”
+“SpouseName”: “null”
+“Address2Street2”: “null”
+“Address2Street1”: “null”
+“Phone1Ext”: “null”
+“Phone5Ext”: “null”
+“Phone1Type”: “null”
+“IPAddress”: “null”
}

Which contains only name,email and billing information.

What I need the most is: product amount and order total, or at least order id.
Could you please help to find out what am I doing wrong. Thank you!

I realize that since this is tied to a purchase action set, it would reason that it would send information regarding the order purchased. It actually does not, however. What I’ve done with this in the past is to read the most recently created order for the contact (based on the contact id that is sent in the url) and pulled that information from IS with the api…and then had my way with the data from there.

You could set up a resthook for a listener service on the “invoice.payment.add” event. It will send the id of the payment to the endpoint you specify.

Then, with that Id, you should be able to hit the /transactions/{id} endpoint, which returns not only the invoice, but a nested object containing the Order in question.

EDIT: Whoooops, got ahead of myself here. I fixed a bug on this resthook event last week, but it looks like it won’t make it in to tonight’s deployment. As such, the id that you get back from the resthook is incorrect, until next week’s deployment.

1 Like

While the bug is getting updated later, I would still say @TomScott’s approach would be the most fluid and would be worth waiting for.

Thank you for the reply, Tom!
I really appreciate it. Will be waiting for the deploy.

Hi @TomScott ,
Should we already check this feature working ? :wink:

Thank you in advance!