{"id":13725265,"url":"https://github.com/coinbase/coinbase-python","last_synced_at":"2025-05-07T19:33:31.556Z","repository":{"id":25881522,"uuid":"29321842","full_name":"coinbase/coinbase-python","owner":"coinbase","description":"DEPRECATED — Coinbase Python API","archived":true,"fork":false,"pushed_at":"2019-01-06T20:59:14.000Z","size":161,"stargazers_count":535,"open_issues_count":0,"forks_count":217,"subscribers_count":58,"default_branch":"master","last_synced_at":"2025-04-25T02:23:51.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coinbase.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-15T22:40:39.000Z","updated_at":"2025-04-01T12:24:25.000Z","dependencies_parsed_at":"2022-07-28T20:10:02.531Z","dependency_job_id":null,"html_url":"https://github.com/coinbase/coinbase-python","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fcoinbase-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fcoinbase-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fcoinbase-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fcoinbase-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase","download_url":"https://codeload.github.com/coinbase/coinbase-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252943974,"owners_count":21829346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:17.693Z","updated_at":"2025-05-07T19:33:31.248Z","avatar_url":"https://github.com/coinbase.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Coinbase\n========\n\n.. image:: https://img.shields.io/pypi/v/coinbase.svg\n    :target: https://pypi.python.org/pypi/coinbase\n\n.. image:: https://img.shields.io/travis/coinbase/coinbase-python/master.svg\n    :target: https://travis-ci.org/coinbase/coinbase-python\n\n.. image:: https://img.shields.io/pypi/wheel/coinbase.svg\n    :target: https://pypi.python.org/pypi/coinbase/\n\n.. image:: https://img.shields.io/pypi/pyversions/coinbase.svg\n    :target: https://pypi.python.org/pypi/coinbase/\n\n.. image:: https://img.shields.io/pypi/l/coinbase.svg\n    :target: https://pypi.python.org/pypi/coinbase/\n\nThe official Python library for the `Coinbase API V2 \u003chttps://developers.coinbase.com/api/v2\u003e`_.\n\n*Important*: this library currently targets the API V2, and the OAuth client requires V2 permissions (i.e. ``wallet:accounts:read``).\nIf you're still using the API V1, please use `the old version of this library \u003chttps://pypi.python.org/pypi/coinbase/1.0.4\u003e`_.\n\nFeatures\n--------\n\n- Near-100% test coverage.\n- Support for both `API Key + Secret \u003chttps://developers.coinbase.com/api/v2/#api-key\u003e`_ and `OAuth 2 \u003chttps://developers.coinbase.com/api/v2/#oauth2-coinbase-connect\u003e`_ authentication.\n- Convenient methods for making calls to the API - packs JSON for you!\n- Automatic parsing of API responses into relevant Python objects.\n- All objects have tab-completable methods and attributes when using `IPython \u003chttp://ipython.org\u003e`_.\n\n\nInstallation\n------------\n\n``coinbase`` is available on `PYPI \u003chttps://pypi.python.org/pypi/coinbase/\u003e`_.\nInstall with ``pip``:\n\n.. code:: bash\n\n    pip install coinbase\n\nor with ``easy_install``:\n\n.. code:: bash\n\n    easy_install coinbase\n\nThe library is currently tested against Python versions 2.7 and 3.4+.\n\n*Note*: this package name used to refer to the unofficial `coinbase_python`\nlibrary maintained by `George Sibble \u003chttps://github.com/sibblegp/\u003e`_.\nGeorge graciously allowed us to use the name for this package instead. You can\nstill find that package `on Github \u003chttps://github.com/sibblegp/coinbase_python/\u003e`_.\nThanks, George.\n\nDocumentation\n-------------\n\nThe first thing you'll need to do is `sign up with Coinbase \u003chttps://coinbase.com\u003e`_.\n\nAPI Key + Secret\n^^^^^^^^^^^^^^^^\n\nIf you're writing code for your own Coinbase account, `enable an API key \u003chttps://coinbase.com/settings/api\u003e`_.\n\nNext, create a ``Client`` object for interacting with the API:\n\n.. code:: python\n\n    from coinbase.wallet.client import Client\n    client = Client(api_key, api_secret)\n\nOAuth2\n^^^^^^\n\nIf you're writing code that will act on behalf of another user, start by `creating a new OAuth 2 application from the API settings page \u003chttps://coinbase.com/settings/api\u003e`_.\nYou will need to do some work to obtain OAuth credentials for your users; while outside the scope of this document, please refer to our `OAuth 2 flow documentation \u003chttps://developers.coinbase.com/docs/wallet/coinbase-connect\u003e`_.\nOnce you have these credentials (an ``access_token`` and ``refresh_token``), create a client:\n\n.. code:: python\n\n    from coinbase.wallet.client import OAuthClient\n    client = OAuthClient(access_token, refresh_token)\n\nMaking API Calls\n^^^^^^^^^^^^^^^^\n\nBoth the ``Client`` and ``OAuthClient`` support all of the same API calls.\nWe've included some examples below, but in general the library has Python classes for each of the objects described in our `REST API documentation \u003chttps://developers.coinbase.com/api/v2\u003e`_.\nThese classes each have methods for making the relevant API calls; for instance, ``coinbase.wallet.model.Order.refund`` maps to `the \"refund order\" API endpoint \u003chttps://developers.coinbase.com/api/v2#refund-an-order\u003e`_.\nThe docstring of each method in the code references the endpoint it implements.\n\nEvery method supports the passing of arbitrary parameters via keyword.\nThese keyword arguments will be sent directly to the relevant endpoint.\nIf a required parameter is not supplied, the relevant error will be raised.\n\nEach API method returns an ``APIObject`` (a subclass of ``dict``) representing the JSON response from the API, with some niceties like pretty-printing and attr-style item access (``response.foo`` is equivalent to ``response['foo']``). All of the models are dumpable with JSON:\n\n.. code:: python\n\n    user = client.get_current_user()\n    user_as_json_string = json.dumps(user)\n\n\nAnd, when the response data is parsed into Python objects, the appropriate ``APIObject`` subclasses will be used automatically.\nSee the code in ``coinbase.wallet.model`` for all of the relevant classes, or the examples below.\nAPI methods that return lists of objects (for instance, ``client.get_accounts()`` return ``APIObject`` instances with nice wrappers around the ``data`` of the response body. These objects support direct indexing and slicing of the list referenced by ``data``.\n\n.. code:: python\n\n    accounts = client.get_accounts()\n    assert isinstance(accounts.data, list)\n    assert accounts[0] is accounts.data[0]\n    assert len(accounts[::]) == len(accounts.data)\n\nBut, the ``APIObject`` is not actually a list (it's a subclass of ``dict``) so you cannot iterate through the items of ``data`` directly.\nSimple slicing and index access are provided to make common uses easier, but to access the actual list you must reference the ``data`` attribute.\n\nRefreshing\n\"\"\"\"\"\"\"\"\"\"\nAll the objects returned by API methods are subclasses of the ``APIObject`` and support being \"refreshed\" from the server.\nThis will update their attributes and all nested data by making a fresh ``GET`` request to the relevant API endpoint:\n\n.. code:: python\n\n    accounts = client.get_accounts()\n    # Create a new account via the web UI\n    accounts.refresh()\n    # Now, the new account is present in the list\n\n\nWarnings\n\"\"\"\"\"\"\"\"\nThe API V2 `will return relevant *warnings* along with the response data \u003chttps://developers.coinbase.com/api/v2#warnings\u003e`_.\nIn a successful API response, any warnings will be present as a list on the returned ``APIObject``:\n\n.. code:: python\n\n    accounts = client.get_accounts()\n    assert (accounts.warnings is None) or isinstance(accounts.warnings, list)\n\nAll warning messages will also be alerted using the `Python stdlib warnings module \u003chttps://docs.python.org/2/library/warnings.html\u003e`_.\n\nPagination\n\"\"\"\"\"\"\"\"\"\"\nSeveral of the API V2 endpoints `are paginated \u003chttps://developers.coinbase.com/api/v2#pagination\u003e`_.\nBy default, only the first page of data is returned. All pagination data will be present under the ``pagination`` attribute of the returned ``APIObject``:\n\n.. code:: python\n\n    accounts = client.get_accounts()\n    assert (accounts.pagination is None) or isinstance(accounts.pagination, dict)\n\n\nError Handling\n^^^^^^^^^^^^^^\n\nAll errors occuring during interaction with the API will be raised as exceptions.\nThese exceptions will be subclasses of ``coinbase.wallet.error.CoinbaseError``.\nWhen the error involves an API request and/or response, the error will be a subclass of ``coinbase.error.APIError``, and include ``request`` and ``response`` attributes with more information about the failed interaction.\nFor full details of error responses, please refer `to the relevant API documentation \u003chttps://developers.coinbase.com/api/v2#errors\u003e`_.\n\n=============================  ================\nError                          HTTP Status Code\n=============================  ================\nAPIError                       *\nTwoFactorRequiredError         402\nParamRequiredError             400\nValidationError                422\nInvalidRequestError            400\nPersonalDetailsRequiredError   400\nAuthenticationError            401\nUnverifiedEmailError           401\nInvalidTokenError              401\nRevokedTokenError              401\nExpiredTokenError              401\nInvalidScopeError              403\nNotFoundError                  404\nRateLimitExceededError         429\nInternalServerError            500\nServiceUnavailableError        503\n=============================  ================\n\n\nOAuth Client\n^^^^^^^^^^^^\n\nThe OAuth client provides a few extra methods to refresh and revoke the access token.\n\n.. code:: python\n\n    # exchange the current access_token and refresh_token for a new pair\n    oauth_client.refresh()\n\nThis method will update the values stored in the client and return a ``dict`` containing information from the token endpoint so that you can update your records.\n\n.. code:: python\n\n    # revoke the current access_token and refresh_token\n    oauth_client.revoke()\n\n*Protip*: You can test OAuth2 authentication easily with Developer Access Tokens which can be created `in your OAuth2 application settings \u003chttps://www.coinbase.com/settings/api\u003e`_. These are short lived tokens which authenticate but don't require full OAuth2 handshake to obtain.\n\nTwo Factor Authentication\n^^^^^^^^^^^^^^^^^^^^^^^^^\nSending money may require the user to supply a 2FA token `in certain situations \u003chttps://developers.coinbase.com/docs/wallet/coinbase-connect#two-factor-authentication\u003e`_.\nIf this is the case, a ``TwoFactorRequiredError`` will be raised:\n\n.. code:: python\n\n    from coinbase.wallet.client import Client\n    from coinbase.wallet.error import TwoFactorRequiredError\n\n    client = Client(api_key, api_secret)\n    account = client.get_primary_account()\n    try:\n      tx = account.send_money(to='test@test.com', amount='1', currency='BTC')\n    except TwoFactorRequiredError:\n      # Show 2FA dialog to user and collect 2FA token\n      # two_factor_token = ...\n      # Re-try call with the `two_factor_token` parameter\n      tx = account.send_money(to='test@test.com', amount='1', currency='BTC', two_factor_token=\"123456\")\n\n`Notifications/Callbacks \u003chttps://developers.coinbase.com/docs/wallet/notifications\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Verify notification authenticity**\n\n.. code:: python\n\n    client.verify_callback(request.body, request.META['CB-SIGNATURE']) # true/false\n\nUsage\n-----\nThis is not intended to provide complete documentation of the API.\nFor more details, `please refer to the official documentation \u003chttps://developers.coinbase.com/api/v2\u003e`_.\nFor more information on the included models and abstractions, please read the code – we've done our best to make it clean, commented, and understandable.\n\n`Market Data \u003chttps://developers.coinbase.com/api/v2#data-api\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get supported native currencies**\n\n.. code:: python\n\n    client.get_currencies()\n\n**Get exchange rates**\n\n.. code:: python\n\n    client.get_exchange_rates()\n\n**Buy price**\n\n.. code:: python\n\n    client.get_buy_price(currency_pair = 'BTC-USD')\n\n**Sell price**\n\n.. code:: python\n\n    client.get_sell_price(currency_pair = 'BTC-USD')\n\n**Spot price**\n\n.. code:: python\n\n    client.get_spot_price(currency_pair = 'BTC-USD')\n\n**Current server time**\n\n.. code:: python\n\n    client.get_time()\n\n`Users \u003chttps://developers.coinbase.com/api/v2#users\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get authorization info**\n\n.. code:: python\n\n    client.get_auth_info()\n\n**Get user**\n\n.. code:: python\n\n    client.get_user(user_id)\n\n**Get current user**\n\n.. code:: python\n\n    client.get_current_user()\n\n**Update current user**\n\n.. code:: python\n\n    client.update_current_user(name=\"New Name\")\n    # or\n    current_user.modify(name=\"New Name\")\n\n`Accounts \u003chttps://developers.coinbase.com/api/v2#accounts\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get all accounts**\n\n.. code:: python\n\n    client.get_accounts()\n\n**Get account**\n\n.. code:: python\n\n    client.get_account(account_id)\n\n**Get primary account**\n\n.. code:: python\n\n    client.get_primary_account()\n\n**Set account as primary**\n\n.. code:: python\n\n    client.set_primary_account(account_id)\n    # or\n    account.set_primary()\n\n**Create a new bitcoin account**\n\n.. code:: python\n\n    client.create_account()\n\n**Update an account**\n\n.. code:: python\n\n    client.update_account(account_id, name=\"New Name\")\n    # or\n    account.modify(name=\"New Name\")\n\n**Delete an account**\n\n.. code:: python\n\n    client.delete_account(account_id)\n    # or\n    account.delete()\n\n`Addresses \u003chttps://developers.coinbase.com/api/v2#addresses\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get receive addresses for an account**\n\n.. code:: python\n\n    client.get_addresses(account_id)\n    # or\n    account.get_addresses()\n\n**Get a receive address**\n\n.. code:: python\n\n    client.get_address(account_id, address_id)\n    # or\n    account.get_address(address_id)\n\n**Get transactions for an address**\n\n.. code:: python\n\n    client.get_address_transactions(account_id, address_id)\n    # or\n    account.get_address_transactions(address_id)\n\n**Create a new receive address**\n\n.. code:: python\n\n    client.create_address(account_id)\n    # or\n    account.create_address(address_id)\n\n`Transactions \u003chttps://developers.coinbase.com/api/v2#transactions\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get transactions**\n\n.. code:: python\n\n    client.get_transactions(account_id)\n    # or\n    account.get_transactions()\n\n**Get a transaction**\n\n.. code:: python\n\n    client.get_transaction(account_id, transaction_id)\n    # or\n    account.get_transaction(transaction_id)\n\n**Send money**\n\n.. code:: python\n\n    client.send_money(\n        account_id,\n        to=\"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy\",\n        amount=\"1\",\n        currency=\"BTC\")\n    # or\n    account.send_money(to=\"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy\",\n                       amount=\"1\",\n                       currency=\"BTC\")\n\n**Transfer money**\n\n.. code:: python\n\n    client.transfer_money(\n        account_id,\n        to=\"\u003ccoinbase_account_id\u003e\",\n        amount=\"1\",\n        currency=\"BTC\")\n    # or\n    account.transfer_money(to=\"\u003ccoinbase_account_id\u003e\",\n                           amount=\"1\",\n                           currency=\"BTC\")\n\n**Request money**\n\n.. code:: python\n\n    client.request_money(\n        account_id,\n        to=\"\u003cemail_address\u003e\",\n        amount=\"1\",\n        currency=\"BTC\")\n    # or\n    account.request_money(to=\"\u003cemail_address\u003e\",\n                          amount=\"1\",\n                          currency=\"BTC\")\n\n**Resend request**\n\n.. code:: python\n\n    client.resend_request(account_id, request_id)\n\n**Complete request**\n\n.. code:: python\n\n    client.complete_request(account_id, request_id)\n\n**Cancel request**\n\n.. code:: python\n\n    client.cancel_request(account_id, request_id)\n\n`Reports \u003chttps://developers.coinbase.com/api/v2#reports\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get all reports**\n\n.. code:: python\n\n    client.get_reports()\n\n**Get report**\n\n.. code:: python\n\n    client.get_report(report_id)\n\n**Create report**\n\n.. code:: python\n\n    client.create_report(type='transactions', email='sample@example.com')  # types can also be 'orders' or 'transfers'\n\n`Buys \u003chttps://developers.coinbase.com/api/v2#buys\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get buys**\n\n.. code:: python\n\n    client.get_buys(account_id)\n    # or\n    account.get_buys()\n\n**Get a buy**\n\n.. code:: python\n\n    client.get_buy(account_id, buy_id)\n    # or\n    account.get_buy(buy_id)\n\n**Buy bitcoins**\n\n.. code:: python\n\n    client.buy(account_id, amount='1', currency='BTC')\n    # or\n    account.buy(amount='1', currency='BTC')\n\n**Commit a buy**\n\nYou only need to do this if the initial buy was explicitly uncommitted.\n\n.. code:: python\n\n    buy = account.buy(amount='1', currency='BTC', commit=False)\n\n    client.commit_buy(account_id, buy.id)\n    # or\n    account.commit_buy(buy.id)\n    # or\n    buy.commit()\n\n`Sells \u003chttps://developers.coinbase.com/api/v2#sells\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get sells**\n\n.. code:: python\n\n    client.get_sells(account_id)\n    # or\n    account.get_sells()\n\n**Get a sell**\n\n.. code:: python\n\n    client.get_sell(account_id, sell_id)\n    # or\n    account.get_sell(sell_id)\n\n**Sell bitcoins**\n\n.. code:: python\n\n    client.sell(account_id, amount='1', currency='BTC')\n    # or\n    account.sell(amount='1', currency='BTC')\n\n**Commit a sell**\n\nYou only need to do this if the initial sell was explicitly uncommitted.\n\n.. code:: python\n\n    sell = account.sell(amount='1', currency='BTC', commit=False)\n\n    client.commit_sell(account_id, sell.id)\n    # or\n    account.commit_sell(sell.id)\n    # or\n    sell.commit()\n\n`Deposits \u003chttps://developers.coinbase.com/api/v2#deposits\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get deposits**\n\n.. code:: python\n\n    client.get_deposits(account_id)\n    # or\n    account.get_deposits()\n\n**Get a deposit**\n\n.. code:: python\n\n    client.get_deposit(account_id, deposit_id)\n    # or\n    account.get_deposit(deposit_id)\n\n**Deposit money**\n\n.. code:: python\n\n    client.deposit(account_id, amount='1', currency='USD')\n    # or\n    account.deposit(amount='1', currency='USD')\n\n**Commit a deposit**\n\nYou only need to do this if the initial deposit was explicitly uncommitted.\n\n.. code:: python\n\n    deposit = account.deposit(amount='1', currency='USD', commit=False)\n\n    client.commit_deposit(account_id, deposit.id)\n    # or\n    account.commit_deposit(deposit.id)\n    # or\n    deposit.commit()\n\n`Withdrawals \u003chttps://developers.coinbase.com/api/v2#withdrawals\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get withdrawals**\n\n.. code:: python\n\n    client.get_withdrawals(account_id)\n    # or\n    account.get_withdrawals()\n\n**Get a withdrawal**\n\n.. code:: python\n\n    client.get_withdrawal(account_id, withdrawal_id)\n    # or\n    account.get_withdrawal(withdrawal_id)\n\n**Withdraw money**\n\n.. code:: python\n\n    client.withdraw(account_id, amount='1', currency='USD')\n    # or\n    account.withdraw(amount='1', currency='USD')\n\n**Commit a withdrawal**\n\nYou only need to do this if the initial withdrawal was explicitly uncommitted.\n\n.. code:: python\n\n    withdrawal = account.withdrawal(amount='1', currency='USD', commit=False)\n\n    client.commit_withdrawal(account_id, withdrawal.id)\n    # or\n    account.commit_withdrawal(withdrawal.id)\n    # or\n    withdrawal.commit()\n\n`Payment Methods \u003chttps://developers.coinbase.com/api/v2#payment-methods\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get payment methods**\n\n.. code:: python\n\n    client.get_payment_methods()\n\n**Get a payment method**\n\n.. code:: python\n\n    client.get_payment_method(payment_method_id)\n\n`Merchants \u003chttps://developers.coinbase.com/api/v2#merchants\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get a merchant**\n\n.. code:: python\n\n    client.get_merchant(merchant_id)\n\n`Orders \u003chttps://developers.coinbase.com/api/v2#orders\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get orders**\n\n.. code:: python\n\n    client.get_orders()\n\n\n**Get a order**\n\n.. code:: python\n\n    client.get_order(order_id)\n\n**Create an order**\n\n.. code:: python\n\n    client.create_order(amount='1', currency='BTC', name='Order #1234')\n\n**Refund an order**\n\n.. code:: python\n\n    client.refund_order(order_id)\n    # or\n    order = client.get_order(order_id)\n    order.refund()\n\n\n`Checkouts \u003chttps://developers.coinbase.com/api/v2#checkouts\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Get checkouts**\n\n.. code:: python\n\n    client.get_checkouts()\n\n**Get a checkout**\n\n.. code:: python\n\n    client.get_checkout(checkout_id)\n\n**Create a checkout**\n\n.. code:: python\n\n    client.create_checkout(amount='1', currency='BTC', name='Order #1234')\n\n**Get a checkout's orders**\n\n.. code:: python\n\n    client.get_checkout_orders(checkout_id)\n    # or\n    checkout = client.get_checkout(checkout_id)\n    checkout.get_orders()\n\n**Create an order for a checkout**\n\n.. code:: python\n\n    client.create_checkout_order(checkout_id)\n    # or\n    checkout = client.get_checkout(checkout_id)\n    checkout.create_order()\n\nTesting / Contributing\n----------------------\n\nAny and all contributions are welcome!\nThe process is simple: fork this repo, make your changes, run the test suite, and submit a pull request.\nTests are run via `nosetest \u003chttps://nose.readthedocs.org/en/latest/\u003e`_.\nTo run the tests, clone the repository and then:\n\n.. code:: bash\n\n    # Install the requirements\n    pip install -r requirements.txt\n    pip install -r test-requirements.txt\n\n    # Run the tests for your current version of Python\n    make tests\n\nIf you'd also like to generate an HTML coverage report (useful for figuring out which lines of code are actually being tested), make sure the requirements are installed and then run:\n\n.. code:: bash\n\n    make coverage\n\nWe use `tox \u003chttps://tox.readthedocs.org/en/latest/\u003e`_ to run the test suite against multiple versions of Python.\nYou can `install tox \u003chttp://tox.readthedocs.org/en/latest/install.html\u003e`_ with ``pip`` or ``easy_install``:\n\n.. code:: bash\n\n    pip install tox\n    easy_install tox\n\nTox requires the appropriate Python interpreters to run the tests in different environments.\nWe recommend using `pyenv \u003chttps://github.com/yyuu/pyenv#installation\u003e`_ for this.\nOnce you've installed the appropriate interpreters, running the tests in every environment is simple:\n\n.. code:: bash\n\n    tox\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fcoinbase-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase%2Fcoinbase-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fcoinbase-python/lists"}