SquareECommerce
FREE
By serg.osipchuk
Updated a year ago

SquareECommerce API Documentation

Accept, process and filter online payments through Square.

Learn more about this API
POSTcaptureSingleTransaction
POSTchargeCard
POSTcreateCustomer
POSTcreateCustomerCard
POSTcreateRefund
POSTdeleteCustomerCard
POSTdeleteSingleCustomer
POSTgetAccessToken
POSTgetCustomers
POSTgetLocations
POSTgetRefunds
POSTgetSingleCustomer
POSTgetTransactions
POSTrefreshAccessToken
POSTretrieveSingleTransaction
POSTrevokeSingleAccessToken
POSTrevokeTokens
POSTupdateCustomer
POSTvoidSingleTransaction
POSTchargeCard

Charges a card represented by a card nonce or a customer's card on file.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
locationIdSTRING
REQUIREDThe ID of the location to associate the created transaction with.
amountSTRING
REQUIREDThe amount of money to charge.
accessTokenSTRING
REQUIREDValid AccessToken.
currencySTRING
REQUIREDThe type of currency, in ISO 4217 format. For example, the currency code for US dollars is USD. The value of currency must match the currency associated with the business that is charging the card.
idempotencyKeySTRING
REQUIREDA value you specify that uniquely identifies this transaction among transactions you've created.
Optional Parameters
noteSTRING
OPTIONALAn optional note to associate with the transaction. This value cannot exceed 60 characters.
cardNonceSTRING
OPTIONALA nonce generated from the SqPaymentForm that represents the card to charge. The application that provides a nonce to this endpoint must be the same application that generated the nonce with the SqPaymentForm. Otherwise, the nonce is invalid.Do not provide a value for this field if you provide a value for customer_card_id.
billingAddressLine2STRING
OPTIONALThe second line of the buyer's billing address.
shippingAddressLine2STRING
OPTIONALThe second line of the buyer's shipping address.
delayCaptureSELECT
OPTIONALIf true, the request will only perform an Auth on the provided card. Default value: false
shippingAdministrativeDistrictLevel3STRING
OPTIONALA civil entity within the address's administrative_district_level_2 of the buyer's shipping address.
billingSublocality2STRING
OPTIONALA civil region within the address's sublocality of the buyer's billing address.
buyerEmailAddressSTRING
OPTIONALThe buyer's email address, if available.
billingLocalitySTRING
OPTIONALThe city or town of the buyer's billing address.
billingAdministrativeDistrictLevel3STRING
OPTIONALA civil entity within the address's administrative_district_level_2 of the buyer's billing address.
shippingSublocality2STRING
OPTIONALA civil region within the address's sublocality of the buyer's shipping address.
shippingLocalitySTRING
OPTIONALThe city or town of the buyer's shipping address.
shippingCountrySTRING
OPTIONALThe shipping address's country, in ISO 3166-1-alpha-2 format.
billingAdministrativeDistrictLevel1STRING
OPTIONALA civil entity within the address's country of the buyer's billing address. In the US, this is the state.
billingCountrySTRING
OPTIONALThe billing address's country, in ISO 3166-1-alpha-2 format.
shippingAdministrativeDistrictLevel1STRING
OPTIONALA civil entity within the address's country of the buyer's shipping address. In the US, this is the state.
billingAddressLine1STRING
OPTIONALThe first line of the buyer's billing address.
billingAddressLine3STRING
OPTIONALThe third line of the buyer's billing address.
referenceIdSTRING
OPTIONALAn optional ID you can associate with the transaction for your own purposes (such as to associate the transaction with an entity ID in your own database). This value cannot exceed 40 characters.
billingSublocalitySTRING
OPTIONALA civil region within the address's locality of the buyer's billing address.
billingSublocality3STRING
OPTIONALA civil region within the address's sublocality2 of the buyer's billing address.
customerIdSTRING
OPTIONALThe ID of the customer to associate this transaction with. This field is required if you provide a value for customer_card_id, and optional otherwise.
customerCardIdSTRING
OPTIONALThe ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for card_nonce.
shippingAdministrativeDistrictLevel2STRING
OPTIONALA civil entity within the address's administrative_district_level_1 of the buyer's shipping address.
shippingAddressLine3STRING
OPTIONALThe third line of the buyer's shipping address.
billingAdministrativeDistrictLevel2STRING
OPTIONALA civil entity within the address's administrative_district_level_1 of the buyer's billing address.
shippingSublocalitySTRING
OPTIONALA civil region within the address's locality of the buyer's shipping address.
shippingAddressLine1STRING
OPTIONALThe first line of the buyer's shipping address.
shippingPostalCodeSTRING
OPTIONALThe shipping address's postal code.
shippingSublocality3STRING
OPTIONALA civil region within the address's sublocality2 of the buyer's shipping address.
billingPostalCodeSTRING
OPTIONALThe billing address's postal code.
Code Snippet
Install SDK
Response ExampleSchema

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication