Transactions
Charge
Charges a card represented by a card nonce or a customer's card on file.
Your request to this endpoint must include either:
- A value for the card_nonce parameter (to charge a card payment token generated with the Web Payments SDK)
- Values for the customer_card_id and customer_id parameters (to charge a customer's card on file)
In order for an eCommerce payment to potentially qualify for Square chargeback protection, you must provide values for the following parameters in your request:
- buyer_email_address
- At least one of billing_address or shipping_address
When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call RetrieveTransaction. See the processing_fee_money field of each Tender included in the transaction.
post/v2/locations/{location_id}/transactions
Path parameters
location_idstring required
The ID of the location to associate the created transaction with.
Request body
Example request
{
"request_body": {
"additional_recipients": [
{
"amount_money": {
"amount": 20,
"currency": "USD"
},
"description": "Application fees",
"location_id": "057P5VYJ4A5X1"
}
],
"amount_money": {
"amount": 200,
"currency": "USD"
},
"billing_address": {
"address_line_1": "500 Electric Ave",
"address_line_2": "Suite 600",
"administrative_district_level_1": "NY",
"country": "US",
"locality": "New York",
"postal_code": "10003"
},
"card_nonce": "card_nonce_from_square_123",
"delay_capture": false,
"idempotency_key": "74ae1696-b1e3-4328-af6d-f1e04d947a13",
"note": "some optional note",
"reference_id": "some optional reference id",
"shipping_address": {
"address_line_1": "123 Main St",
"administrative_district_level_1": "CA",
"country": "US",
"locality": "San Francisco",
"postal_code": "94114"
}
}
}Response
Success
Example response
{
"transaction": {
"created_at": "2016-03-10T22:57:56Z",
"id": "KnL67ZIwXCPtzOrqj0HrkxMF",
"location_id": "18YC4JDH91E1H",
"product": "EXTERNAL_API",
"reference_id": "some optional reference id",
"tenders": [
{
"additional_recipients": [
{
"amount_money": {
"amount": 20,
"currency": "USD"
},
"description": "Application fees",
"location_id": "057P5VYJ4A5X1",
"receivable_id": "ISu5xwxJ5v0CMJTQq7RvqyMF"
}
],
"amount_money": {
"amount": 200,
"currency": "USD"
},
"card_details": {
"card": {
"card_brand": "VISA",
"last_4": "1111"
},
"entry_method": "KEYED",
"status": "CAPTURED"
},
"created_at": "2016-03-10T22:57:56Z",
"id": "MtZRYYdDrYNQbOvV7nbuBvMF",
"location_id": "18YC4JDH91E1H",
"note": "some optional note",
"transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF",
"type": "CARD"
}
]
}
}