Webhooks Square Payment
Options
![Per Thiessen](https://us.v-cdn.net/6037124/user_avatars/3978887.jpg)
Per Thiessen
Member ✭
Hi all,
can you help me figuring out how to post the values to Xano from the below body
{
"merchant_id": "MLFYKPT2MHVND",
"type": "payment.created",
"event_id": "43980995-1fee-4d75-b040-3e885f241716",
"created_at": "2022-04-11T13:41:46.691413241Z",
"data": {
"type": "payment",
"id": "KkAkhdMsgzn59SM8A89WgKwekxLZY",
"object": {
"payment": {
"amount_money": {
"amount": 100,
"currency": "USD"
},
"approved_money": {
"amount": 100,
"currency": "USD"
},
"capabilities": [
"EDIT_TIP_AMOUNT",
"EDIT_TIP_AMOUNT_UP",
"EDIT_TIP_AMOUNT_DOWN"
],
"card_details": {
"avs_status": "AVS_ACCEPTED",
"card": {
"bin": "540988",
"card_brand": "MASTERCARD",
"card_type": "CREDIT",
"exp_month": 11,
"exp_year": 2022,
"fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg",
"last_4": "9029",
"prepaid_type": "NOT_PREPAID"
},
"card_payment_timeline": {
"authorized_at": "2020-11-22T21:16:51.198Z"
},
"cvv_status": "CVV_ACCEPTED",
"entry_method": "KEYED",
"statement_description": "SQ *DEFAULT TEST ACCOUNT",
"status": "AUTHORIZED"
},
"created_at": "2020-11-22T21:16:51.086Z",
"delay_action": "CANCEL",
"delay_duration": "PT168H",
"delayed_until": "2020-11-29T21:16:51.086Z",
"id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY",
"location_id": "S8GWD5R9QB376",
"order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY",
"receipt_number": "hYy9",
"risk_evaluation": {
"created_at": "2020-11-22T21:16:51.198Z",
"risk_level": "NORMAL"
},
"source_type": "CARD",
"status": "APPROVED",
"total_money": {
"amount": 100,
"currency": "USD"
},
"updated_at": "2020-11-22T21:16:51.198Z",
"version_token": "FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o"
}
}
}
}I only need some of the data points such as Merchant ID, Approved Money Amount and Currency and the Order_ID.
I have set up the API as Get All Input, but I need some help moving on from there and getting the data retrieved.
Thanks,
Per
can you help me figuring out how to post the values to Xano from the below body
{
"merchant_id": "MLFYKPT2MHVND",
"type": "payment.created",
"event_id": "43980995-1fee-4d75-b040-3e885f241716",
"created_at": "2022-04-11T13:41:46.691413241Z",
"data": {
"type": "payment",
"id": "KkAkhdMsgzn59SM8A89WgKwekxLZY",
"object": {
"payment": {
"amount_money": {
"amount": 100,
"currency": "USD"
},
"approved_money": {
"amount": 100,
"currency": "USD"
},
"capabilities": [
"EDIT_TIP_AMOUNT",
"EDIT_TIP_AMOUNT_UP",
"EDIT_TIP_AMOUNT_DOWN"
],
"card_details": {
"avs_status": "AVS_ACCEPTED",
"card": {
"bin": "540988",
"card_brand": "MASTERCARD",
"card_type": "CREDIT",
"exp_month": 11,
"exp_year": 2022,
"fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg",
"last_4": "9029",
"prepaid_type": "NOT_PREPAID"
},
"card_payment_timeline": {
"authorized_at": "2020-11-22T21:16:51.198Z"
},
"cvv_status": "CVV_ACCEPTED",
"entry_method": "KEYED",
"statement_description": "SQ *DEFAULT TEST ACCOUNT",
"status": "AUTHORIZED"
},
"created_at": "2020-11-22T21:16:51.086Z",
"delay_action": "CANCEL",
"delay_duration": "PT168H",
"delayed_until": "2020-11-29T21:16:51.086Z",
"id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY",
"location_id": "S8GWD5R9QB376",
"order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY",
"receipt_number": "hYy9",
"risk_evaluation": {
"created_at": "2020-11-22T21:16:51.198Z",
"risk_level": "NORMAL"
},
"source_type": "CARD",
"status": "APPROVED",
"total_money": {
"amount": 100,
"currency": "USD"
},
"updated_at": "2020-11-22T21:16:51.198Z",
"version_token": "FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o"
}
}
}
}I only need some of the data points such as Merchant ID, Approved Money Amount and Currency and the Order_ID.
I have set up the API as Get All Input, but I need some help moving on from there and getting the data retrieved.
Thanks,
Per
Comments
-
Re-create this data structure as inputs inside Xano, then create a webhook from Square to send to Xano. Be mindful though that many top-level inputs are going to be objects. You don't want Order_ID, but the input will be data.object.order_id.
So when you're testing inside Xano, data will be an input as a JSON object, then you'll have an object JSON structure inside that, then finally the input for your order_id. -
Thank you so much for your help Ken. I have it all up and running now!
-
Glad to hear it 🙂
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback