Download the PHP package coinbaseinc/coinbase-php without Composer
On this page you can find all versions of the php package coinbaseinc/coinbase-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coinbaseinc/coinbase-php
More information about coinbaseinc/coinbase-php
Files in coinbaseinc/coinbase-php
Package coinbase-php
Short Description Coinbase API library
License Apache-2.0
Homepage http://coinbase.com
Informations about the package coinbase-php
Coinbase Wallet PHP Library
This is the official client library for the Coinbase Wallet API v2. We provide an intuitive, stable interface to integrate Coinbase Wallet into your PHP project.
Important: As this library is targeted for newer API v2, it requires v2
permissions (i.e. wallet:accounts:read
). If you're still using v1, please use
the older version of this library.
Installation
Install the library using Composer. Please read the Composer Documentation if you are unfamiliar with Composer or dependency managers in general.
Authentication
API Key
Use an API key and secret to access your own Coinbase account.
OAuth2
Use OAuth2 authentication to access a user's account other than your own. This library does not handle the handshake process, and assumes you have an access token when it's initialized. You can handle the handshake process using an OAuth2 client such as league/oauth2-client.
Two factor authentication
The send money endpoint requires a 2FA token in certain situations (read more here). A specific exception is thrown when this is required.
Pagination
Several endpoints are paginated. By default, the library will only fetch the first page of data for a given request. You can easily load more than just the first page of results.
You can also use the fetch_all
parameter to have the library issue all the
necessary requests to load the complete collection.
Warnings
It's prudent to be conscious of warnings. The library will log all warnings to a standard PSR-3 logger if one is configured.
Resource references
In some cases the API will return resource references in place of expanded resource objects. These references can be expanded by refreshing them.
You can also request that the API return an expanded resource in the initial
request by using the expand
parameter.
Resource references can be used when creating new resources, avoiding the overhead of requesting a resource from the API.
Responses
There are multiple ways to access raw response data. First, each resource
object has a getRawData()
method which you can use to access any field that
are not mapped to the object properties.
Raw data from the last HTTP response is also available on the client object.
Active record methods
The library includes support for active record methods on resource objects. You must enable this functionality when bootstrapping your application.
Once enabled, you can call active record methods on resource objects.
Usage
This is not intended to provide complete documentation of the API. For more detail, please refer to the official documentation.
Market Data
List supported native currencies
List exchange rates
Buy price
Sell price
Spot price
Current server time
Users
Get authorization info
Lookup user info
Get current user
Update current user
Accounts
List all accounts
List account details
List primary account details
Set account as primary
Create a new bitcoin account
Update an account
Delete an account
Addresses
List receive addresses for account
Get receive address info
List transactions for address
Create a new receive address
Transactions
List transactions
Get transaction info
Send funds
Transfer funds to a new account
Request funds
Resend request
Cancel request
Fulfill request
Buys
List buys
Get buy info
Buy bitcoins
Commit a buy
You only need to do this if you pass commit=false
when you create the buy.
Sells
List sells
Get sell info
Sell bitcoins
Commit a sell
You only need to do this if you pass commit=false
when you create the sell.
Deposit
List deposits
Get deposit info
Deposit funds
Commit a deposit
You only need to do this if you pass commit=false
when you create the deposit.
Withdrawals
List withdrawals
Get withdrawal
Withdraw funds
Commit a withdrawal
You only need to do this if you pass commit=true
when you call the withdrawal method.
Payment Methods
List payment methods
Get payment method
Merchants
Get merchant
Orders
List orders
Get order
Create order
Refund order
Checkouts
List checkouts
Create checkout
Get checkout
Get checkout's orders
Create order for checkout
Notifications webhook and verification
Contributing and testing
The test suite is built using PHPUnit. Run the suite of unit tests by running
the phpunit
command.
There is also a collection of integration tests that issues real requests to the
API and inspects the resulting objects. To run these tests, you must copy
phpunit.xml.dist
to phpunit.xml
, provide values for the CB_API_KEY
and
CB_API_SECRET
variables, and specify the integration
group when running the
test suite.
All versions of coinbase-php with dependencies
guzzlehttp/guzzle Version ^7.0
psr/http-message Version ^1.0
psr/log Version ^2.0