AptlyStar

Square

Process payments and manage Square commerce data

使用说明

Integrate Square into the workflow. Take and refund payments, manage customers, build catalog items and images, create and search orders, and issue invoices. Authenticate with a Square access token (personal access token).

工具

square_create_payment

Take a payment using a payment source such as a card nonce or a card on file

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
sourceIdstring是ID of the payment source (card nonce, card-on-file ID, or wallet token)
amountnumber是Amount in the smallest currency denomination (e.g. 1000 = $10.00)
currencystring是Three-letter ISO 4217 currency code (e.g. USD)
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)
customerIdstring否ID of the customer associated with the payment
locationIdstring否ID of the location where the payment is taken (defaults to the main location)
orderIdstring否ID of the order associated with the payment
referenceIdstring否Optional external reference for the payment
notestring否Optional note attached to the payment
autocompleteboolean否Whether to immediately capture the payment (defaults to true)

输出

参数类型描述
paymentobjectThe created payment object
↳ idstringUnique ID for the payment
↳ statusstringPayment status (APPROVED, PENDING, COMPLETED, CANCELED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ approved_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ app_fee_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ refunded_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ source_typestringSource of the payment (CARD, BANK_ACCOUNT, WALLET, etc.)
↳ card_detailsjsonDetails about a card payment
↳ location_idstringID of the location where the payment was taken
↳ order_idstringID of the associated order
↳ customer_idstringID of the associated customer
↳ reference_idstringOptional external reference for the payment
↳ receipt_numberstringReceipt number for the payment
↳ receipt_urlstringURL of the payment receipt
↳ notestringOptional note attached to the payment
↳ refund_idsarrayIDs of refunds associated with the payment
↳ processing_feearrayProcessing fees applied to the payment
↳ created_atstringTimestamp when the payment was created (RFC 3339)
↳ updated_atstringTimestamp when the payment was last updated (RFC 3339)
↳ version_tokenstringOptimistic concurrency token for the payment
metadatajsonPayment summary metadata
↳ idstringSquare payment ID
↳ statusstringCurrent payment status
↳ order_idstringAssociated order ID

square_get_payment

Retrieve details for a single payment by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
paymentIdstring是ID of the payment to retrieve

输出

参数类型描述
paymentobjectThe retrieved payment object
↳ idstringUnique ID for the payment
↳ statusstringPayment status (APPROVED, PENDING, COMPLETED, CANCELED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ approved_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ app_fee_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ refunded_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ source_typestringSource of the payment (CARD, BANK_ACCOUNT, WALLET, etc.)
↳ card_detailsjsonDetails about a card payment
↳ location_idstringID of the location where the payment was taken
↳ order_idstringID of the associated order
↳ customer_idstringID of the associated customer
↳ reference_idstringOptional external reference for the payment
↳ receipt_numberstringReceipt number for the payment
↳ receipt_urlstringURL of the payment receipt
↳ notestringOptional note attached to the payment
↳ refund_idsarrayIDs of refunds associated with the payment
↳ processing_feearrayProcessing fees applied to the payment
↳ created_atstringTimestamp when the payment was created (RFC 3339)
↳ updated_atstringTimestamp when the payment was last updated (RFC 3339)
↳ version_tokenstringOptimistic concurrency token for the payment
metadatajsonPayment summary metadata
↳ idstringSquare payment ID
↳ statusstringCurrent payment status
↳ order_idstringAssociated order ID

square_list_payments

List payments taken by the account, optionally filtered by location and time range

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdstring否Filter payments by location ID
beginTimestring否RFC 3339 timestamp for the beginning of the reporting period
endTimestring否RFC 3339 timestamp for the end of the reporting period
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
paymentsarrayArray of payment objects
↳ idstringUnique ID for the payment
↳ statusstringPayment status (APPROVED, PENDING, COMPLETED, CANCELED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ approved_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ app_fee_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ refunded_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ source_typestringSource of the payment (CARD, BANK_ACCOUNT, WALLET, etc.)
↳ card_detailsjsonDetails about a card payment
↳ location_idstringID of the location where the payment was taken
↳ order_idstringID of the associated order
↳ customer_idstringID of the associated customer
↳ reference_idstringOptional external reference for the payment
↳ receipt_numberstringReceipt number for the payment
↳ receipt_urlstringURL of the payment receipt
↳ notestringOptional note attached to the payment
↳ refund_idsarrayIDs of refunds associated with the payment
↳ processing_feearrayProcessing fees applied to the payment
↳ created_atstringTimestamp when the payment was created (RFC 3339)
↳ updated_atstringTimestamp when the payment was last updated (RFC 3339)
↳ version_tokenstringOptimistic concurrency token for the payment
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_cancel_payment

Cancel (void) an authorized payment that has not been captured

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
paymentIdstring是ID of the payment to cancel

输出

参数类型描述
paymentobjectThe canceled payment object
↳ idstringUnique ID for the payment
↳ statusstringPayment status (APPROVED, PENDING, COMPLETED, CANCELED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ approved_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ app_fee_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ refunded_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ source_typestringSource of the payment (CARD, BANK_ACCOUNT, WALLET, etc.)
↳ card_detailsjsonDetails about a card payment
↳ location_idstringID of the location where the payment was taken
↳ order_idstringID of the associated order
↳ customer_idstringID of the associated customer
↳ reference_idstringOptional external reference for the payment
↳ receipt_numberstringReceipt number for the payment
↳ receipt_urlstringURL of the payment receipt
↳ notestringOptional note attached to the payment
↳ refund_idsarrayIDs of refunds associated with the payment
↳ processing_feearrayProcessing fees applied to the payment
↳ created_atstringTimestamp when the payment was created (RFC 3339)
↳ updated_atstringTimestamp when the payment was last updated (RFC 3339)
↳ version_tokenstringOptimistic concurrency token for the payment
metadatajsonPayment summary metadata
↳ idstringSquare payment ID
↳ statusstringCurrent payment status
↳ order_idstringAssociated order ID

square_complete_payment

Capture (complete) a payment that was authorized with delayed capture

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
paymentIdstring是ID of the payment to complete
versionTokenstring否Optional version token for optimistic concurrency control

输出

参数类型描述
paymentobjectThe completed payment object
↳ idstringUnique ID for the payment
↳ statusstringPayment status (APPROVED, PENDING, COMPLETED, CANCELED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ approved_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ app_fee_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ refunded_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ source_typestringSource of the payment (CARD, BANK_ACCOUNT, WALLET, etc.)
↳ card_detailsjsonDetails about a card payment
↳ location_idstringID of the location where the payment was taken
↳ order_idstringID of the associated order
↳ customer_idstringID of the associated customer
↳ reference_idstringOptional external reference for the payment
↳ receipt_numberstringReceipt number for the payment
↳ receipt_urlstringURL of the payment receipt
↳ notestringOptional note attached to the payment
↳ refund_idsarrayIDs of refunds associated with the payment
↳ processing_feearrayProcessing fees applied to the payment
↳ created_atstringTimestamp when the payment was created (RFC 3339)
↳ updated_atstringTimestamp when the payment was last updated (RFC 3339)
↳ version_tokenstringOptimistic concurrency token for the payment
metadatajsonPayment summary metadata
↳ idstringSquare payment ID
↳ statusstringCurrent payment status
↳ order_idstringAssociated order ID

square_refund_payment

Refund all or part of a completed payment

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
paymentIdstring是ID of the payment to refund
amountnumber是Amount to refund in the smallest currency denomination (e.g. 100 = $1.00)
currencystring是Three-letter ISO 4217 currency code (e.g. USD)
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)
reasonstring否Reason for the refund

输出

参数类型描述
refundobjectThe created refund object
↳ idstringUnique ID for the refund
↳ statusstringRefund status (PENDING, COMPLETED, REJECTED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ processing_feearrayProcessing fees refunded
↳ payment_idstringID of the payment being refunded
↳ order_idstringID of the associated order
↳ location_idstringID of the associated location
↳ reasonstringReason for the refund
↳ created_atstringTimestamp when the refund was created (RFC 3339)
↳ updated_atstringTimestamp when the refund was last updated (RFC 3339)
metadatajsonRefund summary metadata
↳ idstringSquare refund ID
↳ statusstringCurrent refund status
↳ payment_idstringRefunded payment ID

square_get_refund

Retrieve a single payment refund by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
refundIdstring是ID of the refund to retrieve

输出

参数类型描述
refundobjectThe retrieved refund object
↳ idstringUnique ID for the refund
↳ statusstringRefund status (PENDING, COMPLETED, REJECTED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ processing_feearrayProcessing fees refunded
↳ payment_idstringID of the payment being refunded
↳ order_idstringID of the associated order
↳ location_idstringID of the associated location
↳ reasonstringReason for the refund
↳ created_atstringTimestamp when the refund was created (RFC 3339)
↳ updated_atstringTimestamp when the refund was last updated (RFC 3339)
metadatajsonRefund summary metadata
↳ idstringSquare refund ID
↳ statusstringCurrent refund status
↳ payment_idstringRefunded payment ID

square_list_refunds

List payment refunds, optionally filtered by location, status, and time range

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdstring否Filter refunds by location ID
statusstring否Filter by refund status (PENDING, COMPLETED, REJECTED, or FAILED)
beginTimestring否RFC 3339 timestamp for the beginning of the reporting period
endTimestring否RFC 3339 timestamp for the end of the reporting period
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
refundsarrayArray of refund objects
↳ idstringUnique ID for the refund
↳ statusstringRefund status (PENDING, COMPLETED, REJECTED, or FAILED)
↳ amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ processing_feearrayProcessing fees refunded
↳ payment_idstringID of the payment being refunded
↳ order_idstringID of the associated order
↳ location_idstringID of the associated location
↳ reasonstringReason for the refund
↳ created_atstringTimestamp when the refund was created (RFC 3339)
↳ updated_atstringTimestamp when the refund was last updated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_create_customer

Create a new customer profile in the Square customer directory

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
givenNamestring否First name of the customer
familyNamestring否Last name of the customer
companyNamestring否Business name of the customer
nicknamestring否Nickname of the customer
emailAddressstring否Email address of the customer
phoneNumberstring否Phone number of the customer
birthdaystring否Birthday in YYYY-MM-DD or MM-DD format
notestring否Note about the customer
referenceIdstring否Optional external reference for the customer
addressjson否Square address object for the customer
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
customerobjectThe created customer object
↳ idstringUnique ID for the customer
↳ given_namestringFirst name of the customer
↳ family_namestringLast name of the customer
↳ nicknamestringNickname of the customer
↳ company_namestringBusiness name of the customer
↳ email_addressstringEmail address of the customer
↳ phone_numberstringPhone number of the customer
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ birthdaystringBirthday in YYYY-MM-DD or MM-DD format
↳ reference_idstringOptional external reference for the customer
↳ notestringNote about the customer
↳ creation_sourcestringHow the customer profile was created
↳ preferencesjsonCustomer communication preferences
↳ group_idsarrayIDs of customer groups the customer belongs to
↳ segment_idsarrayIDs of customer segments the customer belongs to
↳ versionnumberOptimistic concurrency version of the customer
↳ created_atstringTimestamp when the customer was created (RFC 3339)
↳ updated_atstringTimestamp when the customer was last updated (RFC 3339)
metadatajsonCustomer summary metadata
↳ idstringSquare customer ID
↳ email_addressstringCustomer email address
↳ given_namestringCustomer first name
↳ family_namestringCustomer last name

square_get_customer

Retrieve a single customer profile by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
customerIdstring是ID of the customer to retrieve

输出

参数类型描述
customerobjectThe retrieved customer object
↳ idstringUnique ID for the customer
↳ given_namestringFirst name of the customer
↳ family_namestringLast name of the customer
↳ nicknamestringNickname of the customer
↳ company_namestringBusiness name of the customer
↳ email_addressstringEmail address of the customer
↳ phone_numberstringPhone number of the customer
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ birthdaystringBirthday in YYYY-MM-DD or MM-DD format
↳ reference_idstringOptional external reference for the customer
↳ notestringNote about the customer
↳ creation_sourcestringHow the customer profile was created
↳ preferencesjsonCustomer communication preferences
↳ group_idsarrayIDs of customer groups the customer belongs to
↳ segment_idsarrayIDs of customer segments the customer belongs to
↳ versionnumberOptimistic concurrency version of the customer
↳ created_atstringTimestamp when the customer was created (RFC 3339)
↳ updated_atstringTimestamp when the customer was last updated (RFC 3339)
metadatajsonCustomer summary metadata
↳ idstringSquare customer ID
↳ email_addressstringCustomer email address
↳ given_namestringCustomer first name
↳ family_namestringCustomer last name

square_list_customers

List customer profiles in the Square customer directory

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
limitnumber否Maximum number of results to return per page (max 100)
cursorstring否Pagination cursor from a previous response
sortFieldstring否Field to sort by (DEFAULT or CREATED_AT)
sortOrderstring否Sort order (ASC or DESC)

输出

参数类型描述
customersarrayArray of customer objects
↳ idstringUnique ID for the customer
↳ given_namestringFirst name of the customer
↳ family_namestringLast name of the customer
↳ nicknamestringNickname of the customer
↳ company_namestringBusiness name of the customer
↳ email_addressstringEmail address of the customer
↳ phone_numberstringPhone number of the customer
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ birthdaystringBirthday in YYYY-MM-DD or MM-DD format
↳ reference_idstringOptional external reference for the customer
↳ notestringNote about the customer
↳ creation_sourcestringHow the customer profile was created
↳ preferencesjsonCustomer communication preferences
↳ group_idsarrayIDs of customer groups the customer belongs to
↳ segment_idsarrayIDs of customer segments the customer belongs to
↳ versionnumberOptimistic concurrency version of the customer
↳ created_atstringTimestamp when the customer was created (RFC 3339)
↳ updated_atstringTimestamp when the customer was last updated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_search_customers

Search customer profiles using filters such as email, phone, or creation date

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
queryjson否Square customer query object with optional filter and sort (e.g. {"filter":{"email_address":{"exact":"a@b.com"}}})
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
customersarrayArray of matching customer objects
↳ idstringUnique ID for the customer
↳ given_namestringFirst name of the customer
↳ family_namestringLast name of the customer
↳ nicknamestringNickname of the customer
↳ company_namestringBusiness name of the customer
↳ email_addressstringEmail address of the customer
↳ phone_numberstringPhone number of the customer
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ birthdaystringBirthday in YYYY-MM-DD or MM-DD format
↳ reference_idstringOptional external reference for the customer
↳ notestringNote about the customer
↳ creation_sourcestringHow the customer profile was created
↳ preferencesjsonCustomer communication preferences
↳ group_idsarrayIDs of customer groups the customer belongs to
↳ segment_idsarrayIDs of customer segments the customer belongs to
↳ versionnumberOptimistic concurrency version of the customer
↳ created_atstringTimestamp when the customer was created (RFC 3339)
↳ updated_atstringTimestamp when the customer was last updated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_update_customer

Update fields on an existing customer profile

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
customerIdstring是ID of the customer to update
givenNamestring否First name of the customer
familyNamestring否Last name of the customer
companyNamestring否Business name of the customer
nicknamestring否Nickname of the customer
emailAddressstring否Email address of the customer
phoneNumberstring否Phone number of the customer
birthdaystring否Birthday in YYYY-MM-DD or MM-DD format
notestring否Note about the customer
referenceIdstring否Optional external reference for the customer
addressjson否Square address object for the customer

输出

参数类型描述
customerobjectThe updated customer object
↳ idstringUnique ID for the customer
↳ given_namestringFirst name of the customer
↳ family_namestringLast name of the customer
↳ nicknamestringNickname of the customer
↳ company_namestringBusiness name of the customer
↳ email_addressstringEmail address of the customer
↳ phone_numberstringPhone number of the customer
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ birthdaystringBirthday in YYYY-MM-DD or MM-DD format
↳ reference_idstringOptional external reference for the customer
↳ notestringNote about the customer
↳ creation_sourcestringHow the customer profile was created
↳ preferencesjsonCustomer communication preferences
↳ group_idsarrayIDs of customer groups the customer belongs to
↳ segment_idsarrayIDs of customer segments the customer belongs to
↳ versionnumberOptimistic concurrency version of the customer
↳ created_atstringTimestamp when the customer was created (RFC 3339)
↳ updated_atstringTimestamp when the customer was last updated (RFC 3339)
metadatajsonCustomer summary metadata
↳ idstringSquare customer ID
↳ email_addressstringCustomer email address
↳ given_namestringCustomer first name
↳ family_namestringCustomer last name

square_delete_customer

Delete a customer profile from the Square customer directory

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
customerIdstring是ID of the customer to delete

输出

参数类型描述
deletedbooleanWhether the customer was deleted
idstringID of the deleted customer

square_list_locations

List all locations associated with the Square account

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)

输出

参数类型描述
locationsarrayArray of location objects
↳ idstringUnique ID for the location
↳ namestringName of the location
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ timezonestringIANA timezone of the location
↳ statusstringLocation status (ACTIVE or INACTIVE)
↳ typestringLocation type (PHYSICAL or MOBILE)
↳ merchant_idstringID of the merchant that owns the location
↳ countrystringCountry code of the location
↳ language_codestringLanguage code of the location
↳ currencystringCurrency used by the location
↳ phone_numberstringPhone number of the location
↳ business_namestringBusiness name shown to customers
↳ business_emailstringEmail of the business
↳ descriptionstringDescription of the location
↳ capabilitiesarrayCapabilities of the location (e.g. CREDIT_CARD_PROCESSING)
↳ created_atstringTimestamp when the location was created (RFC 3339)
metadatajsonList metadata
↳ countnumberNumber of locations returned

square_get_location

Retrieve a single location by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdstring是ID of the location to retrieve (use "main" for the main location)

输出

参数类型描述
locationobjectThe retrieved location object
↳ idstringUnique ID for the location
↳ namestringName of the location
↳ addressobjectPhysical address
↳ address_line_1stringFirst line of the address
↳ address_line_2stringSecond line of the address
↳ address_line_3stringThird line of the address
↳ localitystringCity or town
↳ sublocalitystringNeighborhood or district
↳ administrative_district_level_1stringState, province, or region
↳ postal_codestringPostal or ZIP code
↳ countrystringTwo-letter ISO 3166-1 alpha-2 country code
↳ first_namestringFirst name of the addressee
↳ last_namestringLast name of the addressee
↳ timezonestringIANA timezone of the location
↳ statusstringLocation status (ACTIVE or INACTIVE)
↳ typestringLocation type (PHYSICAL or MOBILE)
↳ merchant_idstringID of the merchant that owns the location
↳ countrystringCountry code of the location
↳ language_codestringLanguage code of the location
↳ currencystringCurrency used by the location
↳ phone_numberstringPhone number of the location
↳ business_namestringBusiness name shown to customers
↳ business_emailstringEmail of the business
↳ descriptionstringDescription of the location
↳ capabilitiesarrayCapabilities of the location (e.g. CREDIT_CARD_PROCESSING)
↳ created_atstringTimestamp when the location was created (RFC 3339)
metadatajsonLocation summary metadata
↳ idstringSquare location ID
↳ namestringLocation name

square_create_order

Create an order with line items, taxes, discounts, and fulfillments

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
orderjson是Square order object including location_id and line_items (e.g. {"location_id":"L1","line_items":[{"name":"Coffee","quantity":"1","base_price_money":{"amount":250,"currency":"USD"}}]})
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
orderobjectThe created order object
↳ idstringUnique ID for the order
↳ location_idstringID of the location for the order
↳ reference_idstringOptional external reference for the order
↳ customer_idstringID of the associated customer
↳ statestringOrder state (OPEN, COMPLETED, or CANCELED)
↳ versionnumberOptimistic concurrency version of the order
↳ line_itemsarrayLine items in the order
↳ taxesarrayTaxes applied to the order
↳ discountsarrayDiscounts applied to the order
↳ fulfillmentsarrayFulfillments for the order
↳ net_amountsjsonNet money amounts for the order
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tax_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_discount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_service_charge_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ created_atstringTimestamp when the order was created (RFC 3339)
↳ updated_atstringTimestamp when the order was last updated (RFC 3339)
↳ closed_atstringTimestamp when the order was closed (RFC 3339)
metadatajsonOrder summary metadata
↳ idstringSquare order ID
↳ statestringCurrent order state
↳ location_idstringOrder location ID

square_get_order

Retrieve a single order by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
orderIdstring是ID of the order to retrieve

输出

参数类型描述
orderobjectThe retrieved order object
↳ idstringUnique ID for the order
↳ location_idstringID of the location for the order
↳ reference_idstringOptional external reference for the order
↳ customer_idstringID of the associated customer
↳ statestringOrder state (OPEN, COMPLETED, or CANCELED)
↳ versionnumberOptimistic concurrency version of the order
↳ line_itemsarrayLine items in the order
↳ taxesarrayTaxes applied to the order
↳ discountsarrayDiscounts applied to the order
↳ fulfillmentsarrayFulfillments for the order
↳ net_amountsjsonNet money amounts for the order
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tax_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_discount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_service_charge_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ created_atstringTimestamp when the order was created (RFC 3339)
↳ updated_atstringTimestamp when the order was last updated (RFC 3339)
↳ closed_atstringTimestamp when the order was closed (RFC 3339)
metadatajsonOrder summary metadata
↳ idstringSquare order ID
↳ statestringCurrent order state
↳ location_idstringOrder location ID

square_search_orders

Search orders across one or more locations using filters and sorting

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdsarray是Array of location IDs to search within
queryjson否Square order query object with optional filter and sort (e.g. {"filter":{"state_filter":{"states":["OPEN"]}}})
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
ordersarrayArray of matching order objects
↳ idstringUnique ID for the order
↳ location_idstringID of the location for the order
↳ reference_idstringOptional external reference for the order
↳ customer_idstringID of the associated customer
↳ statestringOrder state (OPEN, COMPLETED, or CANCELED)
↳ versionnumberOptimistic concurrency version of the order
↳ line_itemsarrayLine items in the order
↳ taxesarrayTaxes applied to the order
↳ discountsarrayDiscounts applied to the order
↳ fulfillmentsarrayFulfillments for the order
↳ net_amountsjsonNet money amounts for the order
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tax_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_discount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_service_charge_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ created_atstringTimestamp when the order was created (RFC 3339)
↳ updated_atstringTimestamp when the order was last updated (RFC 3339)
↳ closed_atstringTimestamp when the order was closed (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_pay_order

Pay for an order using one or more already-approved payments

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
orderIdstring是ID of the order to pay for
paymentIdsarray否IDs of approved payments to apply to the order
orderVersionnumber否Version of the order being paid (for optimistic concurrency)
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
orderobjectThe paid order object
↳ idstringUnique ID for the order
↳ location_idstringID of the location for the order
↳ reference_idstringOptional external reference for the order
↳ customer_idstringID of the associated customer
↳ statestringOrder state (OPEN, COMPLETED, or CANCELED)
↳ versionnumberOptimistic concurrency version of the order
↳ line_itemsarrayLine items in the order
↳ taxesarrayTaxes applied to the order
↳ discountsarrayDiscounts applied to the order
↳ fulfillmentsarrayFulfillments for the order
↳ net_amountsjsonNet money amounts for the order
↳ total_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tax_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_discount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_service_charge_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ total_tip_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ created_atstringTimestamp when the order was created (RFC 3339)
↳ updated_atstringTimestamp when the order was last updated (RFC 3339)
↳ closed_atstringTimestamp when the order was closed (RFC 3339)
metadatajsonOrder summary metadata
↳ idstringSquare order ID
↳ statestringCurrent order state
↳ location_idstringOrder location ID

square_create_invoice

Create a draft invoice for an existing order and customer

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
invoicejson是Square invoice object including location_id, order_id, primary_recipient, and payment_requests (e.g. {"location_id":"L1","order_id":"O1","primary_recipient":{"customer_id":"C1"},"payment_requests":[{"request_type":"BALANCE","due_date":"2026-07-01"}]})
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
invoiceobjectThe created invoice object
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonInvoice summary metadata
↳ idstringSquare invoice ID
↳ statusstringCurrent invoice status
↳ versionnumberInvoice version

square_get_invoice

Retrieve a single invoice by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
invoiceIdstring是ID of the invoice to retrieve

输出

参数类型描述
invoiceobjectThe retrieved invoice object
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonInvoice summary metadata
↳ idstringSquare invoice ID
↳ statusstringCurrent invoice status
↳ versionnumberInvoice version

square_list_invoices

List invoices for a specific location

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdstring是ID of the location to list invoices for
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
invoicesarrayArray of invoice objects
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_search_invoices

Search invoices across one or more locations

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
locationIdstring是ID of the location to search within (Square allows one location per search)
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
invoicesarrayArray of matching invoice objects
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_publish_invoice

Publish a draft invoice so it is sent to the customer and becomes payable

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
invoiceIdstring是ID of the invoice to publish
versionnumber是Current version of the invoice (use the version returned by Create Invoice)
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
invoiceobjectThe published invoice object
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonInvoice summary metadata
↳ idstringSquare invoice ID
↳ statusstringCurrent invoice status
↳ versionnumberInvoice version

square_cancel_invoice

Cancel a published invoice that is unpaid or partially paid

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
invoiceIdstring是ID of the invoice to cancel
versionnumber是Current version of the invoice

输出

参数类型描述
invoiceobjectThe canceled invoice object
↳ idstringUnique ID for the invoice
↳ versionnumberOptimistic concurrency version of the invoice
↳ location_idstringID of the location for the invoice
↳ order_idstringID of the order the invoice bills for
↳ statusstringInvoice status (DRAFT, UNPAID, SCHEDULED, PARTIALLY_PAID, PAID, etc.)
↳ invoice_numberstringHuman-readable invoice number
↳ titlestringTitle of the invoice
↳ descriptionstringDescription of the invoice
↳ public_urlstringURL where the customer can view and pay the invoice
↳ primary_recipientjsonPrimary recipient of the invoice
↳ payment_requestsarrayPayment requests for the invoice
↳ next_payment_amount_moneyobjectMonetary amount with a currency
↳ amountnumberAmount in the smallest denomination of the currency (e.g. cents for USD)
↳ currencystringThree-letter ISO 4217 currency code (e.g. USD)
↳ scheduled_atstringTimestamp when the invoice is scheduled to be sent (RFC 3339)
↳ timezonestringTimezone used for invoice dates
↳ delivery_methodstringHow the invoice is delivered (EMAIL, SHARE_MANUALLY, SMS)
↳ created_atstringTimestamp when the invoice was created (RFC 3339)
↳ updated_atstringTimestamp when the invoice was last updated (RFC 3339)
metadatajsonInvoice summary metadata
↳ idstringSquare invoice ID
↳ statusstringCurrent invoice status
↳ versionnumberInvoice version

square_delete_invoice

Delete a draft invoice

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
invoiceIdstring是ID of the draft invoice to delete
versionnumber否Current version of the invoice (required if the invoice has been updated)

输出

参数类型描述
deletedbooleanWhether the invoice was deleted
idstringID of the deleted invoice

square_upsert_catalog_object

Create or update a catalog object such as an item, variation, or category

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
objectjson是Square catalog object to create or update. Use ID "#name" for new objects (e.g. {"type":"ITEM","id":"#Coffee","item_data":{"name":"Coffee"}})
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
objectobjectThe created or updated catalog object
↳ typestringType of catalog object (ITEM, ITEM_VARIATION, CATEGORY, IMAGE, etc.)
↳ idstringUnique ID for the catalog object
↳ versionnumberOptimistic concurrency version of the object
↳ updated_atstringTimestamp when the object was last updated (RFC 3339)
↳ is_deletedbooleanWhether the object is deleted
↳ present_at_all_locationsbooleanWhether the object is present at all locations
↳ item_datajsonItem-specific data (when type is ITEM)
↳ item_variation_datajsonVariation-specific data (when type is ITEM_VARIATION)
↳ category_datajsonCategory-specific data (when type is CATEGORY)
↳ image_datajsonImage-specific data (when type is IMAGE)
metadatajsonCatalog object summary metadata
↳ idstringSquare catalog object ID
↳ typestringCatalog object type
↳ versionnumberCatalog object version

square_get_catalog_object

Retrieve a single catalog object by its ID

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
objectIdstring是ID of the catalog object to retrieve
includeRelatedObjectsboolean否Whether to include related objects such as an item variations

输出

参数类型描述
objectobjectThe retrieved catalog object
↳ typestringType of catalog object (ITEM, ITEM_VARIATION, CATEGORY, IMAGE, etc.)
↳ idstringUnique ID for the catalog object
↳ versionnumberOptimistic concurrency version of the object
↳ updated_atstringTimestamp when the object was last updated (RFC 3339)
↳ is_deletedbooleanWhether the object is deleted
↳ present_at_all_locationsbooleanWhether the object is present at all locations
↳ item_datajsonItem-specific data (when type is ITEM)
↳ item_variation_datajsonVariation-specific data (when type is ITEM_VARIATION)
↳ category_datajsonCategory-specific data (when type is CATEGORY)
↳ image_datajsonImage-specific data (when type is IMAGE)
metadatajsonCatalog object summary metadata
↳ idstringSquare catalog object ID
↳ typestringCatalog object type
↳ versionnumberCatalog object version

square_list_catalog

List catalog objects, optionally filtered by type

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
typesstring否Comma-separated catalog object types to return (e.g. ITEM,CATEGORY). Defaults to all top-level types
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
objectsarrayArray of catalog objects
↳ typestringType of catalog object (ITEM, ITEM_VARIATION, CATEGORY, IMAGE, etc.)
↳ idstringUnique ID for the catalog object
↳ versionnumberOptimistic concurrency version of the object
↳ updated_atstringTimestamp when the object was last updated (RFC 3339)
↳ is_deletedbooleanWhether the object is deleted
↳ present_at_all_locationsbooleanWhether the object is present at all locations
↳ item_datajsonItem-specific data (when type is ITEM)
↳ item_variation_datajsonVariation-specific data (when type is ITEM_VARIATION)
↳ category_datajsonCategory-specific data (when type is CATEGORY)
↳ image_datajsonImage-specific data (when type is IMAGE)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_search_catalog_objects

Search catalog objects by type and query filters

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
objectTypesarray否Array of catalog object types to search (e.g. ["ITEM","CATEGORY"])
queryjson否Square catalog query object (e.g. {"text_query":{"keywords":["coffee"]}} or {"prefix_query":{...}})
limitnumber否Maximum number of results to return per page
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
objectsarrayArray of matching catalog objects
↳ typestringType of catalog object (ITEM, ITEM_VARIATION, CATEGORY, IMAGE, etc.)
↳ idstringUnique ID for the catalog object
↳ versionnumberOptimistic concurrency version of the object
↳ updated_atstringTimestamp when the object was last updated (RFC 3339)
↳ is_deletedbooleanWhether the object is deleted
↳ present_at_all_locationsbooleanWhether the object is present at all locations
↳ item_datajsonItem-specific data (when type is ITEM)
↳ item_variation_datajsonVariation-specific data (when type is ITEM_VARIATION)
↳ category_datajsonCategory-specific data (when type is CATEGORY)
↳ image_datajsonImage-specific data (when type is IMAGE)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

square_create_catalog_image

Upload an image and attach it to the catalog, optionally to a specific item

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
filefile是The image file to upload (UserFile object)
fileNamestring否Optional filename override for the image
objectIdstring否ID of the catalog object (e.g. an item) to attach the image to
captionstring否Caption (alt text) for the image
idempotencyKeystring否Unique key to make the request idempotent (auto-generated if omitted)

输出

参数类型描述
objectobjectThe created catalog image object
↳ typestringType of catalog object (ITEM, ITEM_VARIATION, CATEGORY, IMAGE, etc.)
↳ idstringUnique ID for the catalog object
↳ versionnumberOptimistic concurrency version of the object
↳ updated_atstringTimestamp when the object was last updated (RFC 3339)
↳ is_deletedbooleanWhether the object is deleted
↳ present_at_all_locationsbooleanWhether the object is present at all locations
↳ item_datajsonItem-specific data (when type is ITEM)
↳ item_variation_datajsonVariation-specific data (when type is ITEM_VARIATION)
↳ category_datajsonCategory-specific data (when type is CATEGORY)
↳ image_datajsonImage-specific data (when type is IMAGE)
metadatajsonCatalog object summary metadata
↳ idstringSquare catalog object ID
↳ typestringCatalog object type
↳ versionnumberCatalog object version

square_delete_catalog_object

Delete a catalog object and its children (e.g. an item and its variations)

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
objectIdstring是ID of the catalog object to delete

输出

参数类型描述
deletedbooleanWhether the catalog object was deleted
deleted_object_idsarrayIDs of all catalog objects deleted (including children)
deleted_atstringTimestamp when the deletion occurred (RFC 3339)

square_batch_retrieve_inventory_counts

Retrieve current inventory counts for catalog items across locations

输入

参数类型必填描述
apiKeystring是Square access token (personal access token)
catalogObjectIdsarray否IDs of the catalog item variations to retrieve counts for
locationIdsarray否IDs of the locations to retrieve counts for (defaults to all locations)
statesarray否Inventory states to filter by (e.g. IN_STOCK, SOLD, IN_TRANSIT)
updatedAfterstring否Only return counts updated after this RFC 3339 timestamp
limitnumber否Maximum number of results to return per page (1-1000)
cursorstring否Pagination cursor from a previous response

输出

参数类型描述
countsarrayArray of inventory count objects
↳ catalog_object_idstringID of the catalog object (item variation) being counted
↳ catalog_object_typestringType of the counted catalog object (usually ITEM_VARIATION)
↳ statestringInventory state (e.g. IN_STOCK, SOLD, WASTE)
↳ location_idstringID of the location for this count
↳ quantitystringNumber of units in the given state at the location
↳ calculated_atstringTimestamp when the count was calculated (RFC 3339)
metadatajsonList pagination metadata
↳ countnumberNumber of items returned in this page
↳ cursorstringPagination cursor to fetch the next page, if more results exist

On this page