Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37,905 changes: 37,905 additions & 0 deletions .mock/definition/__package__.yml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions .mock/definition/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: api
error-discrimination:
strategy: status-code
display-name: Square
environments:
Production: https://connect.squareup.com
Sandbox: https://connect.squareupsandbox.com
default-environment: Production
headers:
Square-Version:
name: version
env: VERSION
type: literal<"2025-10-16">
auth-schemes:
Bearer:
scheme: bearer
token:
env: SQUARE_TOKEN
auth: Bearer
81 changes: 81 additions & 0 deletions .mock/definition/applePay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
imports:
root: __package__.yml
service:
auth: false
base-path: ''
endpoints:
RegisterDomain:
path: /v2/apple-pay/domains
method: POST
auth:
- oauth2: []
docs: >-
Activates a domain for use with Apple Pay on the Web and Square. A
validation

is performed on this domain by Apple to ensure that it is properly set
up as

an Apple Pay enabled domain.


This endpoint provides an easy way for platform developers to bulk
activate

Apple Pay on the Web with Square for merchants using their platform.


Note: You will need to host a valid domain verification file on your
domain to support Apple Pay. The

current version of this file is always available at
https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,

and should be hosted at
`.well_known/apple-developer-merchantid-domain-association` on your

domain. This file is subject to change; we strongly recommend checking
for updates regularly and avoiding

long-lived caches that might not keep in sync with the correct file
version.


To learn more about the Web Payments SDK and how to add Apple Pay, see
[Take an Apple Pay
Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
source:
openapi: openapi/openapi.json
display-name: RegisterDomain
request:
name: RegisterDomainRequest
body:
properties:
domain_name:
type: string
docs: >-
A domain name as described in RFC-1034 that will be registered
with ApplePay.
validation:
minLength: 1
maxLength: 255
content-type: application/json
response:
docs: Success
type: root.RegisterDomainResponse
status-code: 200
examples:
- headers:
Square-Version: '2025-10-16'
request:
domain_name: example.com
response:
body:
errors:
- category: API_ERROR
code: INTERNAL_SERVER_ERROR
detail: detail
field: field
status: VERIFIED
source:
openapi: openapi/openapi.json
222 changes: 222 additions & 0 deletions .mock/definition/bankAccounts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
imports:
root: __package__.yml
service:
auth: false
base-path: ''
endpoints:
list:
path: /v2/bank-accounts
method: GET
auth:
- oauth2:
- BANK_ACCOUNTS_READ
docs: >-
Returns a list of [BankAccount](entity:BankAccount) objects linked to a
Square account.
pagination:
cursor: $request.cursor
next_cursor: $response.cursor
results: $response.bank_accounts
source:
openapi: openapi/openapi.json
display-name: ListBankAccounts
request:
name: ListBankAccountsRequest
query-parameters:
cursor:
type: optional<nullable<string>>
docs: >-
The pagination cursor returned by a previous call to this
endpoint.

Use it in the next `ListBankAccounts` request to retrieve the next
set

of results.


See the
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)
guide for more information.
limit:
type: optional<nullable<integer>>
docs: >-
Upper limit on the number of bank accounts to return in the
response.

Currently, 1000 is the largest supported limit. You can specify a
limit

of up to 1000 bank accounts. This is also the default limit.
location_id:
type: optional<nullable<string>>
docs: >-
Location ID. You can specify this optional filter

to retrieve only the linked bank accounts belonging to a specific
location.
response:
docs: Success
type: root.ListBankAccountsResponse
status-code: 200
examples:
- query-parameters:
cursor: cursor
limit: 1
location_id: location_id
headers:
Square-Version: '2025-10-16'
response:
body:
errors:
- category: API_ERROR
code: INTERNAL_SERVER_ERROR
detail: detail
field: field
bank_accounts:
- id: ao6iaQ9vhDiaQD7n3GB
account_number_suffix: '971'
country: US
currency: USD
account_type: CHECKING
holder_name: Jane Doe
primary_bank_identification_number: '112200303'
secondary_bank_identification_number: secondary_bank_identification_number
debit_mandate_reference_id: debit_mandate_reference_id
reference_id: reference_id
location_id: S8GWD5example
status: VERIFICATION_IN_PROGRESS
creditable: false
debitable: false
fingerprint: fingerprint
version: 5
bank_name: Bank Name
- id: 4x7WXuaxrkQkVlka3GB
account_number_suffix: '972'
country: US
currency: USD
account_type: CHECKING
holder_name: Jane Doe
primary_bank_identification_number: '112200303'
secondary_bank_identification_number: secondary_bank_identification_number
debit_mandate_reference_id: debit_mandate_reference_id
reference_id: reference_id
location_id: S8GWD5example
status: VERIFICATION_IN_PROGRESS
creditable: false
debitable: false
fingerprint: fingerprint
version: 5
bank_name: Bank Name
cursor: cursor
GetByV1Id:
path: /v2/bank-accounts/by-v1-id/{v1_bank_account_id}
method: GET
auth:
- oauth2:
- BANK_ACCOUNTS_READ
docs: >-
Returns details of a [BankAccount](entity:BankAccount) identified by V1
bank account ID.
source:
openapi: openapi/openapi.json
display-name: GetBankAccountByV1Id
request:
name: GetByV1IdBankAccountsRequest
path-parameters:
v1_bank_account_id:
type: string
docs: >-
Connect V1 ID of the desired `BankAccount`. For more information,
see

[Retrieve a bank account by using an ID issued by V1 Bank Accounts
API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api).
response:
docs: Success
type: root.GetBankAccountByV1IdResponse
status-code: 200
examples:
- path-parameters:
v1_bank_account_id: v1_bank_account_id
headers:
Square-Version: '2025-10-16'
response:
body:
errors:
- category: API_ERROR
code: INTERNAL_SERVER_ERROR
detail: detail
field: field
bank_account:
id: w3yRgCGYQnwmdl0R3GB
account_number_suffix: '971'
country: US
currency: USD
account_type: CHECKING
holder_name: Jane Doe
primary_bank_identification_number: '112200303'
secondary_bank_identification_number: secondary_bank_identification_number
debit_mandate_reference_id: debit_mandate_reference_id
reference_id: reference_id
location_id: S8GWD5example
status: VERIFICATION_IN_PROGRESS
creditable: false
debitable: false
fingerprint: fingerprint
version: 5
bank_name: Bank Name
get:
path: /v2/bank-accounts/{bank_account_id}
method: GET
auth:
- oauth2:
- BANK_ACCOUNTS_READ
docs: |-
Returns details of a [BankAccount](entity:BankAccount)
linked to a Square account.
source:
openapi: openapi/openapi.json
display-name: GetBankAccount
request:
name: GetBankAccountsRequest
path-parameters:
bank_account_id:
type: string
docs: Square-issued ID of the desired `BankAccount`.
response:
docs: Success
type: root.GetBankAccountResponse
status-code: 200
examples:
- path-parameters:
bank_account_id: bank_account_id
headers:
Square-Version: '2025-10-16'
response:
body:
errors:
- category: API_ERROR
code: INTERNAL_SERVER_ERROR
detail: detail
field: field
bank_account:
id: w3yRgCGYQnwmdl0R3GB
account_number_suffix: '971'
country: US
currency: USD
account_type: CHECKING
holder_name: Jane Doe
primary_bank_identification_number: '112200303'
secondary_bank_identification_number: secondary_bank_identification_number
debit_mandate_reference_id: debit_mandate_reference_id
reference_id: reference_id
location_id: S8GWD5example
status: VERIFICATION_IN_PROGRESS
creditable: false
debitable: false
fingerprint: fingerprint
version: 5
bank_name: Bank Name
source:
openapi: openapi/openapi.json
Loading
Loading