square / square
Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.
Installs: 2 187 219
Dependents: 18
Suggesters: 0
Security: 0
Stars: 69
Watchers: 18
Forks: 50
Open Issues: 4
Requires
- php: ^7.2 || ^8.0
- ext-json: *
- apimatic/core: ~0.3.12
- apimatic/core-interfaces: ~0.1.5
- apimatic/unirest-php: ^4.0.0
Requires (Dev)
- phan/phan: 5.4.5
- phpunit/phpunit: ^7.5 || ^8.5 || ^9.5
- squizlabs/php_codesniffer: ^3.5
- dev-master
- 39.1.0.20241218
- 39.0.0.20241120
- 38.2.0.20241017
- 38.1.0.20240919
- 38.0.0.20240821
- 37.1.1.20240717
- 37.1.0.20240604
- 37.0.0.20240515
- 36.0.0.20240417
- 35.1.0.20240320
- 35.0.0.20240222
- 34.0.1.20240118
- 34.0.0.20240118
- 33.1.0.20231213
- 33.0.0.20231115
- 32.0.0.20231018
- 31.0.0.20230925
- 30.0.0.20230816
- 29.1.0.20230720
- 29.0.0.20230720
- 28.0.1.20230608
- 28.0.0.20230608
- 27.0.0.20230517
- 26.0.0.20230419
- 25.2.0.20230315
- 25.1.0.20230119
- 25.0.0.20221214
- 24.0.0.20221116
- 23.0.0.20221019
- 22.0.0.20220921
- 21.1.0.20220823
- 21.0.0.20220817
- 20.1.0.20220720
- 20.0.0.20220720
- 19.1.1.20220616
- 19.1.0.20220616
- 19.0.1.20220512
- 19.0.0.20220512
- 18.0.0.20220420
- 17.3.0.20220316
- 17.2.0.20220216
- 17.1.0.20220120
- 17.0.0.20211215
- 16.0.0.20211117
- 15.0.0.20211020
- 14.1.0.20210915
- 14.0.0.20210915
- 13.1.0.20210818
- 13.0.0.20210721
- 12.0.0.20210616
- 11.0.0.20210513
- 10.0.0.20210421
- 9.1.0.20210317
- 9.0.0.20210226
- 8.1.0.20210121
- 8.0.0.20201216
- 7.0.0.20201118
- 6.5.0.20201028
- 6.4.0.20200923
- 6.3.0.20200826
- 6.2.0.20200812
- 6.1.0.20200722
- 6.0.0.20200625
- 5.0.0.20200528
- dev-eden/update-optional-tender-id
- dev-release/2024-12-18
- dev-release/2024-11-20
- dev-release/38.2.0.20241017
- dev-release/38.1.0.20240919
- dev-release/38.0.0.20240821
- dev-release/37.1.1.20240717
- dev-release/37.1.0.20240604
- dev-release/33.1.0.20231213
- dev-release/33.0.0.20231115
- dev-release/31.0.0.20230925
- dev-release/30.0.0.20230816
- dev-release/29.1.0.20230720
- dev-release/29.0.0.20230720
- dev-release/28.0.1.20230608
- dev-release/28.0.0.20230608
- dev-release/25.2.0.20230315
- dev-release/25.1.0.20230119
- dev-release/24.0.0.20221116
- dev-release/23.0.0.20221019
- dev-release/21.1.0.20220823
- dev-release/21.0.0.20220817
- dev-release/20.1.0.20220720
- dev-release/20.0.0.20220720
- dev-release/19.1.1.20220616
- dev-release/19.1.0.20220616
- dev-release/19.0.1.20220512
- dev-release/19.0.0.20220512
- dev-release/18.0.0.20220420
- dev-release/17.3.0.20220316
- dev-release/17.2.0.20220216
- dev-wolfgang/remove-extra-automerge-action
- dev-release/17.1.0.20220120
- dev-release/17.0.0.20211215
- dev-release/16.0.0.20211117
- dev-release/15.0.0.20211020
- dev-wolfgang/fix-license-date
- dev-wolfgang/put-v13-changelog-back
- dev-release/14.1.0.20210915
- dev-release/14.0.0.20210915
- dev-release/13.0.0.20210721
- dev-release/13.1.0.20210818
- dev-joanc/DEX-6970-automerge
- dev-wolfgang/update-table-of-contents
- dev-release/12.0.0.20210616
- dev-release/11.0.0.20210513
- dev-release/10.0.0.20210421
- dev-release/9.1.0.20210317
- dev-release/9.0.0.20210226
- dev-release/8.1.0.20210121
- dev-release/8.0.0.20201216
- dev-release/7.0.0.20201118
- dev-jessdelacruzsantos/RemoveDuplicateMarkDown
- dev-release/6.5.0.20201028
- dev-release/6.4.0.20200923
- dev-release/6.3.0.20200826
- dev-release/6.2.0.20200812
- dev-release/6.1.0.20200722
- dev-mohsin/travis-fix
- dev-mohsin/travis-build-notifications
- dev-jessdelacruzsantos/ReadMeManualInstallation
- dev-release/6.0.0.20200625
- dev-jessdelacruzsantos/UpdateReadMe
- dev-xingfu/autoload
- dev-jessiedlcs/AddUniqueNameTo
- dev-jessiedlcs/SetUpTravis
- dev-jessdlacruzsantos/release
This package is auto-updated.
Last update: 2025-01-06 21:25:09 UTC
README
Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders.
Requirements
Use of the Square PHP SDK requires:
- PHP 7.4 through PHP ^8.0
Installation
For more information, see Set Up Your Square SDK for a PHP Project.
Quickstart
For more information, see Square PHP SDK Quickstart.
Usage
For more information, see Using the Square PHP SDK.
Tests
First, clone the repo locally and cd
into the directory.
git clone https://github.com/square/square-php-sdk.git
cd square-php-sdk
Next, make sure you've downloaded Composer, following the instructions here and then run the following command from the root of the repository:
composer install
Before running the tests, find a sandbox token in your Developer Dashboard and set environment variables:
export SQUARE_ACCESS_TOKEN=mytoken export SQUARE_ENVIRONMENT=sandbox
Run the tests:
composer run test
All environment variables:
SQUARE_TIMEOUT
- numberSQUARE_NUMBER_OF_RETRIES
- numberSQUARE_MAXIMUM_RETRY_WAIT_TIME
- numberSQUARE_SQUARE_VERSION
- stringSQUARE_USER_AGENT_DETAIL
- stringSQUARE_CUSTOM_URL
- stringSQUARE_ACCESS_TOKEN
- stringSQUARE_ENVIRONMENT
- string - one of production, sandbox, custom
SDK Reference
Payments
Terminal
Orders
Subscriptions
Invoices
Items
Customers
Loyalty
Gift Cards
Bookings
Business
- Merchants
- Merchant Custom Attributes
- Locations
- Location Custom Attributes
- Devices
- Cash Drawers
- Vendors
Team
Financials
Online
Authorization
Webhook Subscriptions
Deprecated APIs
The following Square APIs are deprecated:
-
Employees - replaced by the Team API. For more information, see Migrate from the Employees API.
-
Transactions - replaced by the Orders and Payments APIs. For more information, see Migrate from the Transactions API.