Question

How to send webhook from website so Zap can create invoice in Square

  • 12 June 2021
  • 5 replies
  • 58 views

I’m looking to integrate data from a webhook on my website to create an invoice for a client in square...tried everything I can but not sure how to make this work…

 

Any help / suggestions / anyone I can hire for this?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +10

Hi @canadaspaceman 

You’ll need to use the Square API to create an invoice: https://developer.squareup.com/reference/square/invoices-api/create-invoice

App APIs can be used in Zaps with the Webhooks action step: https://zapier.com/apps/webhook/integrations#triggers-and-actions

I’m having trouble with this still, I know it’s from the API and tried setting it up What is the URL on square I would need to send the webhook data to?  and can I send raw text data from the webhook to square or does it need to be formatted in a special way? 

Userlevel 7
Badge +10

@canadaspaceman 

You can reference the API documentation for the posting requirements: https://developer.squareup.com/reference/square/invoices-api/create-invoice

 

curl https://connect.squareup.com/v2/invoices \
-X POST \
-H 'Square-Version: 2021-05-13' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "ce3748f9-5fc1-4762-aa12-aae5e843f1f4",
"invoice": {
"location_id": "ES0RJRZYEC39A",
"order_id": "CAISENgvlJ6jLWAzERDzjyHVybY",
"scheduled_at": "2030-01-13T10:00:00Z",
"primary_recipient": {
"customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4"
},
"delivery_method": "EMAIL",
"payment_requests": [
{
"request_type": "BALANCE",
"due_date": "2030-01-24",
"tipping_enabled": true,
"automatic_payment_source": "NONE",
"reminders": [
{
"message": "Your invoice is due tomorrow",
"relative_scheduled_days": -1
}
]
}
],
"invoice_number": "inv-100",
"title": "Event Planning Services",
"description": "We appreciate your business!",
"accepted_payment_methods": {
"card": true,
"square_gift_card": false,
"bank_account": false
},
"custom_fields": [
{
"label": "Event Reference Number",
"value": "Ref. #1234",
"placement": "ABOVE_LINE_ITEMS"
},
{
"label": "Terms of Service",
"value": "The terms of service are...",
"placement": "BELOW_LINE_ITEMS"
}
]
}
}'

 

I got to that point but what would I enter into the webhook GET to send the form data and connect to square to create the invoice?

 

 

Userlevel 7
Badge +10

@canadaspaceman 

 

It’s a POST request to “Create Invoice” instead of a GET request. (see screenshot below)

 

Might make sense to learn about HTTP REST concepts: https://www.w3schools.in/restful-web-services/intro/

 

If you need help configuring this, consider hiring a Zapier Expert: https://zapier.com/experts