Skip to main content

Wallet API: Sells (Deprecated)

Deprecating Buys & Sells APIs on Nov 30

On November 30, the Sign in with Coinbase v2 Buys and Sells APIs are being deprecated.

Deprecated APIRecommended API
Place Buy Order / Place Sell OrderArrow pointing right.Create Order
List Buys / List SellsArrow pointing right.List Transactions
Show Buy / Show SellArrow pointing right.Show Transaction

Note: To expand all available resources, pass expand=all.

  • cURL example: https://api.coinbase.com/v2/accounts/{AccountId}/transactions?expand[]=sell&expand[]=buy
  • Replace AccountId with your real Account ID to retrieve the fees.

Table of Endpoints

NameMethodEndpointScope
Place Sell OrderPOST/v2/accounts/:account_id/sells/:sell_id/commitwallet:sells:create
Commit SellPOST/v2/accounts/:account_id/sells/:sell_id/commitwallet:sells:create
List SellsGET/v2/accounts/:account_id/sellswallet:sells:read
Show SellGET/v2/accounts/:account_id/sells/:sell_idwallet:sells:read

Overview

The Sell resource represents any Coinbase supported asset using a payment method (either a bank or a fiat account). Each committed sell also has an associated transaction.

Sells can be started with commit: false which is useful when displaying the confirmation for a sell. These sells will never complete and receive an associated transaction unless they are committed separately.

ParameterDescription
id stringResource ID
status string, enumerableStatus of the sell. Valid values: created, completed, canceled
payment_method hashAssociated payment method (e.g., a bank, fiat account)
transaction hashAssociated transaction (e.g., a bank, fiat account)
amount money hashAmount of any supported asset
total money hashFiat amount with fees
subtotal money hashFiat amount without fees
fee money hashFees associated to this sell
created_at timestamp
updated_at timestamp
resource string, constant sell
resource_path string
committed booleanHas this sell been committed?
instant booleanWas this sell executed instantly?
payout_at timestamp, optionalWhen a sell isn't executed instantly, it receives a payout date for the time it will be executed

Example Sell Resource

{
"id": "67e0eaec-07d7-54c4-a72c-2e92826897df",
"status": "completed",
"payment_method": {
"id": "83562370-3e5c-51db-87da-752af5ab9559",
"resource": "payment_method",
"resource_path": "/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559"
},
"transaction": {
"id": "441b9494-b3f0-5b98-b9b0-4d82c21c252a",
"resource": "transaction",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/441b9494-b3f0-5b98-b9b0-4d82c21c252a"
},
"amount": {
"amount": "1.00000000",
"currency": "BTC"
},
"total": {
"amount": "9.75",
"currency": "USD"
},
"subtotal": {
"amount": "9.90",
"currency": "USD"
},
"created_at": "2015-01-31T20:49:02Z",
"updated_at": "2015-02-11T16:54:02-08:00",
"resource": "sell",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells/67e0eaec-07d7-54c4-a72c-2e92826897df",
"committed": true,
"instant": false,
"fee": {
"amount": "0.15",
"currency": "USD"
},
"payout_at": "2015-02-18T16:54:00-08:00"
}

Place Sell Order

Sells a user-defined amount of any Coinbase supported asset.

You can define sell amounts with either the amount or total parameter:

  • amount sells the amount in the defined asset. It's recommended that you use a cryptocurrency as the currency value, but if you specify a fiat currency, the amount is converted.

  • total credits the defined total value, and after fees are taken out, sells the remaining amount of the defined asset. It's recommended that you use the currency of the payment method as the currency parameter, but if you specify a different currency, the amount is converted.

Given the price of digital currency depends on the time of the call and amount of the sell, it's recommended to use the commit: false parameter to create an uncommitted sell to get a quote and then to commit that with a separate request.

If you need to query the sell price without locking in the sell, you can use quote: true option. This returns an unsaved sell and unlike commit: false, this sell can't be completed. This option is useful when you need to show the detailed sell price quote for the user when they are filling a form or similar situation.

HTTP Request

POST https://api.coinbase.com/v2/accounts/:account_id/sells

Scopes

  • wallet:sells:create

Arguments

ParameterTypeRequiredDescription
amountstringRequiredSell amount
totalstringOptionalSell amount with fees (alternative to amount)
currencystringRequiredCurrency for the amount
payment_methodstringOptionalID of the payment method for the sell. Payment methods can be listed using the GET /payment-methods API call
agree_btc_amount_variesbooleanOptionalWhether or not you would still like to sell if you have to wait for your money to arrive to lock in a price
commitbooleanOptionalIf false, this sell will not be immediately completed. Use the commit call to complete it. Default value: true
quotebooleanOptionalIf true, response will return an unsave sell for detailed price quote. Default value: false

Examples

Request

curl https://api.coinbase.com/v2/accounts/82de7fcd-db72-5085-8ceb-bee19303080b/sells /
-X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c' \
-d '{
"amount": "10",
"currency": "BTC",
"payment_method": "83562370-3e5c-51db-87da-752af5ab9559"
}'

Response (201)

{
"data": {
"id": "a333743d-184a-5b5b-abe8-11612fc44ab5",
"status": "created",
"payment_method": {
"id": "83562370-3e5c-51db-87da-752af5ab9559",
"resource": "payment_method",
"resource_path": "/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559"
},
"transaction": {
"id": "763d1401-fd17-5a18-852a-9cca5ac2f9c0",
"resource": "transaction",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/763d1401-fd17-5a18-852a-9cca5ac2f9c0"
},
"amount": {
"amount": "10.00000000",
"currency": "BTC"
},
"total": {
"amount": "98.01",
"currency": "USD"
},
"subtotal": {
"amount": "99.00",
"currency": "USD"
},
"created_at": "2015-04-01T18:43:37-07:00",
"updated_at": "2015-04-01T18:43:37-07:00",
"resource": "sell",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells/a333743d-184a-5b5b-abe8-11612fc44ab5",
"committed": true,
"instant": false,
"fee": {
"amount": "10.1",
"currency": "USD"
},
"payout_at": "2015-04-07T18:43:37-07:00"
}
}

Commit Sell

Completes a sell that is created in commit: false state.

If the exchange rate has changed since the sell was created, this call will fail with the error “The exchange rate updated while you were waiting. The new total is shown below”.

The sell's total will also be updated. You can repeat the /commit call to accept the new values and commit the sell at the new rates.

HTTP Request

POST https://api.coinbase.com/v2/accounts/:account_id/sells/:sell_id/commit

Scopes

  • wallet:sells:create

Arguments

None

Examples

Request

curl https://api.coinbase.com/v2/accounts/82de7fcd-db72-5085-8ceb-bee19303080b/sells/a333743d-184a-5b5b-abe8-11612fc44ab5/commit \
-X POST \
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'

Response (200)

{
"data": {
"id": "a333743d-184a-5b5b-abe8-11612fc44ab5",
"status": "created",
"payment_method": {
"id": "83562370-3e5c-51db-87da-752af5ab9559",
"resource": "payment_method",
"resource_path": "/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559"
},
"transaction": {
"id": "763d1401-fd17-5a18-852a-9cca5ac2f9c0",
"resource": "transaction",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions763d1401-fd17-5a18-852a-9cca5ac2f9c0"
},
"amount": {
"amount": "10.00000000",
"currency": "BTC"
},
"total": {
"amount": "98.01",
"currency": "USD"
},
"subtotal": {
"amount": "99.00",
"currency": "USD"
},
"created_at": "2015-04-01T18:43:37-07:00",
"updated_at": "2015-04-01T18:43:37-07:00",
"resource": "sell",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells/a333743d-184a-5b5b-abe8-11612fc44ab5",
"committed": true,
"instant": false,
"fee": {
"amount": "10.1",
"currency": "USD"
},
"payout_at": "2015-04-07T18:43:37-07:00"
}
}

List Sells

Lists sells for an account.

HTTP Request

GET https://api.coinbase.com/v2/accounts/:account_id/sells

Scopes

  • wallet:sells:read

Examples

Request

curl https://api.coinbase.com/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'

Response

{
"pagination": {
"ending_before": null,
"starting_after": null,
"limit": 25,
"order": "desc",
"previous_uri": null,
"next_uri": null
},
"data": [
{
"id": "9e14d574-30fa-5d85-b02c-6be0d851d61d",
"status": "created",
"payment_method": {
"id": "83562370-3e5c-51db-87da-752af5ab9559",
"resource": "payment_method",
"resource_path": "/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559"
},
"transaction": {
"id": "4117f7d6-5694-5b36-bc8f-847509850ea4",
"resource": "transaction",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/4117f7d6-5694-5b36-bc8f-847509850ea4"
},
"amount": {
"amount": "10.00000000",
"currency": "BTC"
},
"total": {
"amount": "98.01",
"currency": "USD"
},
"subtotal": {
"amount": "99.00",
"currency": "USD"
},
"created_at": "2015-03-26T23:43:59-07:00",
"updated_at": "2015-03-26T23:44:09-07:00",
"resource": "sell",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells/9e14d574-30fa-5d85-b02c-6be0d851d61d",
"committed": true,
"instant": false,
"fee": {
"amount": "10.1",
"currency": "USD"
},
"payout_at": "2015-04-01T23:43:59-07:00"
}
]
}

Show Sell

Show an individual sell.

HTTP Request

GET https://api.coinbase.com/v2/accounts/:account_id/sells/:sell_id

Scopes

  • wallet:sells:read

Examples

Request

curl https://api.coinbase.com/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/sells/dd3183eb-af1d-5f5d-a90d-cbff946435ff /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'

Response

{
"data": {
"id": "9e14d574-30fa-5d85-b02c-6be0d851d61d",
"status": "created",
"payment_method": {
"id": "83562370-3e5c-51db-87da-752af5ab9559",
"resource": "payment_method",
"resource_path": "/v2/payment-methods/83562370-3e5c-51db-87da-752af5ab9559"
},
"transaction": {
"id": "4117f7d6-5694-5b36-bc8f-847509850ea4",
"resource": "transaction",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/transactions/4117f7d6-5694-5b36-bc8f-847509850ea4"
},
"amount": {
"amount": "10.00000000",
"currency": "BTC"
},
"total": {
"amount": "98.01",
"currency": "USD"
},
"subtotal": {
"amount": "99.00",
"currency": "USD"
},
"created_at": "2015-03-26T23:43:59-07:00",
"updated_at": "2015-03-26T23:44:09-07:00",
"resource": "sell",
"resource_path": "/v2/accounts/2bbf394c-193b-5b2a-9155-3b4732659ede/buys/9e14d574-30fa-5d85-b02c-6be0d851d61d",
"committed": true,
"instant": false,
"fee": {
"amount": "10.1",
"currency": "USD"
},
"payout_at": "2015-04-01T23:43:59-07:00"
}
}

Was this helpful?