POST /v2/payments
Creates a payment using the provided source. You can use this endpoint
to charge a card (credit/debit card or
Square gift card) or record a payment that the seller received outside of Square
(cash payment from a buyer or a payment that an external entity
processed on behalf of the seller).
The endpoint creates a
Payment
object and returns it in the response.
Servers
- https://connect.squareup.com
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
shipping_address |
Object | No |
Represents a postal address in a country. The address format is based
on an open-source library from Google. For more information,
see AddressValidationMetadata.
This format has dedicated fields for four address components: postal code,
locality (city), administrative district (state, prefecture, or province), and
sublocality (town or village). These components have dedicated fields in the
For the remaining address components, the Note that, in the current implementation, all other When it comes to localization, the seller's language preferences (see Language preferences) are ignored for addresses. Even though Square products (such as Square Point of Sale and the Seller Dashboard) mostly use a seller's language preference in communication, when it comes to addresses, they will use English for a US address, Japanese for an address in Japan, and so on. |
shipping_address.address_line_3 |
String | No |
The third line of the address, if any. |
shipping_address.first_name |
String | No |
Optional first name when it's representing recipient. |
shipping_address.postal_code |
String | No |
The address's postal code. |
shipping_address.organization |
String | No |
Optional organization name when it's representing recipient. |
shipping_address.address_line_2 |
String | No |
The second line of the address, if any. |
shipping_address.address_line_1 |
String | No |
The first line of the address. Fields that start with |
shipping_address.administrative_district_level_3 |
String | No |
A civil entity within the address's |
shipping_address.sublocality_2 |
String | No |
A civil region within the address's |
shipping_address.administrative_district_level_2 |
String | No |
A civil entity within the address's |
shipping_address.locality |
String | No |
The city or town of the address. |
shipping_address.sublocality |
String | No |
A civil region within the address's |
shipping_address.last_name |
String | No |
Optional last name when it's representing recipient. |
shipping_address.administrative_district_level_1 |
String | No |
A civil entity within the address's country. In the US, this is the state. |
shipping_address.sublocality_3 |
String | No |
A civil region within the address's |
shipping_address.country |
String | No |
The address's country, in ISO 3166-1-alpha-2 format. |
verification_token |
String | No |
An identifying token generated by payments.verifyBuyer(). Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. For more information, see SCA Overview. |
cash_details |
Object | No |
Stores details about a cash payment. Contains only non-confidential information. For more information, see Take Cash Payments. |
cash_details.change_back_money |
Object | No |
Represents an amount of money. |
cash_details.change_back_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
cash_details.change_back_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
cash_details.buyer_supplied_money |
Object | Yes |
Represents an amount of money. |
cash_details.buyer_supplied_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
cash_details.buyer_supplied_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
delay_duration |
String | No |
The duration of time after the payment's creation when Square automatically cancels the
payment. This automatic cancellation applies only to payments that do not reach a terminal state
(COMPLETED, CANCELED, or FAILED) before the This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value of 1 minute. Note: This feature is only supported for card payments. This parameter can only be set for a delayed
capture payment ( Default:
|
idempotency_key |
String | Yes |
A unique string that identifies this Max: 45 characters Note: The number of allowed characters might be less than the stated maximum, if multi-byte characters are used. For more information, see Idempotency. |
reference_id |
String | No |
A user-defined ID to associate with the payment. You can use this field to associate the payment to an entity in an external system (for example, you might specify an order ID that is generated by a third-party shopping cart). Limit 40 characters. |
autocomplete |
Boolean | No |
If set to Default: true |
external_details |
Object | No |
Stores details about an external payment. Contains only non-confidential information. For more information, see Take External Payments. |
external_details.source |
String | Yes |
A description of the external payment source. For example, "Food Delivery Service". |
external_details.source_id |
String | No |
An ID to associate the payment to its originating source. |
external_details.source_fee_money |
Object | No |
Represents an amount of money. |
external_details.source_fee_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
external_details.source_fee_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
external_details.type |
String | Yes |
The type of external payment the seller received. It can be one of the following:
|
source_id |
String | Yes |
The ID for the source of funds for this payment. This can be a payment token (card nonce) generated by the Square payment form or a card on file made with the Customers API. If recording a payment that the seller received outside of Square, specify either "CASH" or "EXTERNAL". For more information, see Take Payments. |
customer_id |
String | No |
The Customer ID of the customer associated with the payment. This is required if the |
location_id |
String | No |
The location ID to associate with the payment. If not specified, the default location is used. |
app_fee_money |
Object | No |
Represents an amount of money. |
app_fee_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
app_fee_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
order_id |
String | No |
Associates a previously created order with this payment. |
note |
String | No |
An optional note to be entered by the developer when creating a payment. Limit 500 characters. |
accept_partial_authorization |
Boolean | No |
If set to For more information, see Partial amount with Square Gift Cards. Default: false |
tip_money |
Object | No |
Represents an amount of money. |
tip_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
tip_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
buyer_email_address |
String | No |
The buyer's email address. |
amount_money |
Object | Yes |
Represents an amount of money. |
amount_money.amount |
Integer | No |
The amount of money, in the smallest denomination of the currency
indicated by |
amount_money.currency |
String | No |
The type of currency, in ISO 4217 format. For example, the currency
code for US dollars is See Currency for possible values. |
statement_description_identifier |
String | No |
Optional additional payment information to include on the customer's card statement as part of the statement description. This can be, for example, an invoice number, ticket number, or short description that uniquely identifies the purchase. Note that the |
billing_address |
Object | No |
Represents a postal address in a country. The address format is based
on an open-source library from Google. For more information,
see AddressValidationMetadata.
This format has dedicated fields for four address components: postal code,
locality (city), administrative district (state, prefecture, or province), and
sublocality (town or village). These components have dedicated fields in the
For the remaining address components, the Note that, in the current implementation, all other When it comes to localization, the seller's language preferences (see Language preferences) are ignored for addresses. Even though Square products (such as Square Point of Sale and the Seller Dashboard) mostly use a seller's language preference in communication, when it comes to addresses, they will use English for a US address, Japanese for an address in Japan, and so on. |
billing_address.address_line_3 |
String | No |
The third line of the address, if any. |
billing_address.first_name |
String | No |
Optional first name when it's representing recipient. |
billing_address.postal_code |
String | No |
The address's postal code. |
billing_address.organization |
String | No |
Optional organization name when it's representing recipient. |
billing_address.address_line_2 |
String | No |
The second line of the address, if any. |
billing_address.address_line_1 |
String | No |
The first line of the address. Fields that start with |
billing_address.administrative_district_level_3 |
String | No |
A civil entity within the address's |
billing_address.sublocality_2 |
String | No |
A civil region within the address's |
billing_address.administrative_district_level_2 |
String | No |
A civil entity within the address's |
billing_address.locality |
String | No |
The city or town of the address. |
billing_address.sublocality |
String | No |
A civil region within the address's |
billing_address.last_name |
String | No |
Optional last name when it's representing recipient. |
billing_address.administrative_district_level_1 |
String | No |
A civil entity within the address's country. In the US, this is the state. |
billing_address.sublocality_3 |
String | No |
A civil region within the address's |
billing_address.country |
String | No |
The address's country, in ISO 3166-1-alpha-2 format. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.