Create a Payment
Learn to make different types of payments using the Square API.
Whenever we buy something, we need to make a payment. We can make the payment via different channels depending on the nature of the purchase.
Online payment: The buyer visits the seller's web or mobile application and makes the payment within that application.
In-person payment: The buyer pays at the seller's physical location using the seller’s POS device, for example, an iPad.
The CreatePayment
endpoint
Square's Payments API provides the CreatePayment
endpoint, which can be used to either direct Square to take payments or record payments processed outside Square. To create any type of payment, we can use the following URL:
https://connect.squareupsandbox.com/v2/payments
Request parameters
An API call to this URL results in the creation of a Payment
object which is returned in the response. The parameters that this API accepts are listed below:
Parameter | Type | Category | Description |
| Object | Required | This is the |
| Object | Optional | This is the |
| Boolean | Optional | If this is set to |
| Object | Optional | This is the billing address of the buyer. It's an |
| String | Optional | This is the email address of the buyer. |
| String | Required | This is a unique string that identifies the The maximum length of the string can be 45 characters. |
| String | Required | This is the ID for the source of funds for this payment. Depending upon the nature of the payment, it can either be a card nonce, |
| Object | Optional | This is the |
We can use the ...