NAV
shell

Introduction

The Peach API is categorized in two parts: Public and private API endpoints.

All market data, that is publicly available can be accessed without API credentials.

Private data, which is user specific can only be accessed by using an auth token. The auth token can be acquired by presenting the public key (user id) and a message + signature associated with the public key.

System

Status

Get system status related information.

curl https://api.peachbitcoin.com/v1/system/status

The above command returns JSON structured like this:

{
  "error": null,
  "status": "online",
  "serverTime": 1692788403879
}

HTTP Request

GET /v1/system/status

Info

Retrieve information about the Peach API

curl https://api.peachbitcoin.com/v1/info

The above command returns JSON structured like this:

{
  "peach": {
    "pgpPublicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nxjMEY...3kzT\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  "fees": {
    "escrow": 0.02
  },
  "paymentMethods": [{
    "id": "sepa",
    "currencies": ["EUR"],
    "anonymous": false
  }, {
    "id": "instantSepa",
    "currencies": ["EUR"],
    "anonymous": false
  }, {
    "id": "paypal",
    "currencies": ["EUR", "CHF", "GBP", "CZK", "DKK", "HUF", "PLN", "NOK", "SEK"],
    "anonymous": false
  }, 
  ...
  ],
  "minAppVersion": "0.2.8",
  "latestAppVersion": "0.2.12"
}

HTTP Request

GET /v1/system/info

Payment Method Info

Retrieve information about supported payment methods and their payment data fields templates

Note that the mandatory fields are arranged logically to express whether all are mandatory or either/or.

So following the example structure, the fields could be expressed as following logical operators:

curl https://api.peachbitcoin.com/v1/info/paymentMethods

The above command returns JSON structured like this:

{
  "paypal": {
    "mandatory": [
      [["userName"], ["email"], ["phone"]]
    ],
    "optional": ["reference"]
  },
  "sepa": {
    "mandatory": [
      [["beneficiary"]],
      [["iban"]],
      [["bic"]]
    ],
    "optional": ["reference"]
  },
  "nationalTransfer": {
    "mandatory": [
      [["beneficiary"]],
      [["iban", "bic"], ["accountNumber"]]
    ],
    "optional": ["reference"]
  }
}

HTTP Request

GET /v1/system/info

Market

Market price

Get average market price of given pair

curl https://api.peachbitcoin.com/v1/market/price/BTCEUR

The above command returns JSON structured like this:

{
  "pair": "BTCEUR",
  "price": 27455.04,
  "date": "2023-04-18T15:28:35.525Z"
}

HTTP Request

GET /v1/market/price/:pair/

Market prices

Get average market prices of all trading pairs

curl https://api.peachbitcoin.com/v1/market/prices

The above command returns JSON structured like this:

{
  "EUR": 27498.77,
  "CHF": 27191.85,
  "GBP": 24226.61,
  "CZK": 642058.31,
  "DKK": 204269.47,
  "HUF": 10183871.09,
  "PLN": 127195.74,
  "NOK": 315166.26,
  "SEK": 309890.83,
  "BGN": 53293.11,
  "ISK": 4098123.85,
  "RON": 135766.28
}

HTTP Request

GET /v1/market/prices

Users

User

Get public user information

curl https://api.peachbitcoin.com/v1/user/0213583209ada26c16e5c3157d86809f8fd46e602936a4e3d51cd988a42ebe19f3

The above command returns JSON structured like this:

{
  "id": "0213583209ada26c16e5c3157d86809f8fd46e602936a4e3d51cd988a42ebe19f3",
  "creationDate": "2023-03-01T13:39:55.942Z",
  "trades": 1738,
  "rating": 0.946,
  "historyRating": 0.975,
  "ratingCount": 45,
  "peachRating": 0.924,
  "userRating": 1,
  "recentRating": 0.926,
  "medals": [
    "superTrader",
    "ambassador"
  ],
  "disputes": {
    "opened": 4,
    "won": 1,
    "lost": 1
  },
  "pgpPublicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----...-----END PGP PUBLIC KEY BLOCK-----",
  "pgpPublicKeyProof": "3b55cc1bf439d4...acf36ae",
}

HTTP Request

GET /v1/user/:userid

Rating

Get public user rating information

curl https://api.peachbitcoin.com/v1/user/03e448b2397c1880e39853371af5346e7e7972c9d6e26dbbb39ff6c2227aa19c80/ratings

The above command returns JSON structured like this:

[
  {
    "creationDate": "2023-03-01T13:53:40.403Z",
    "rating": 1,
    "ratedBy": "030d2971c1aef59ab5d6ca64e24a2381ebfe7e54066986dc713dd14e294dfed9ee",
    "signature": "8605755dd0f5b41e13ec82e1086d8c4e27db721acf89f7648e5e0947e0003de15d0b6f8958b363cba3904073e2cd88ab3cb6c05d5e875655334902a40f18aeb5"
  }
]

HTTP Request

GET /v1/user/:userId/ratings

Referral code

Check if referral code exists

curl https://api.peachbitcoin.com/v1/user/referral?code=SATOSHI

The above command returns JSON structured like this:

{
  "valid": true
}

HTTP Request

GET /v1/user/referral?code=SATOSHI

Query Parameters

Name Type Required Description
code string yes Referral code to check

Offer

Get Offer

Get offer details as long as the offer is online

curl -X GET https://api.peachbitcoin.com/v1/offer/114
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "id": "115",
  "user": {
    "id": "02c3f68178d567253170cd47c896c5e4045e40026ef6f1e2e361d968552dc02496",
    ...
  },
  "type": "bid",
  "amount": [ 50000, 2560000 ],
  "meansOfPayment": {
    "EUR": [
      "cash.lv.riga.baltic-honeybadger",
      "paypal"
    ]
  }
}

HTTP Request

GET /v1/offer/:offerId

Search Offers

Search offer through offer preferences

curl -X POST https://api.peachbitcoin.com/v1/offer/search?page=0&size=10&sortBy=lowestPremium
-H 'Content-Type: application/json' \
--data-raw '{
  "type": "ask",
  "amount": [30000, 2000000],
  "meansOfPayment": { "EUR": ["sepa"] },
  "maxPremium": 10,
  "minReputation": 0.5
}'

The above command returns a response like this:

{
  "offers": [{
      "id": "123456",
      "type": "ask",
      "user": {
        "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
        ...
      },
      "amount": 1000000,
      "meansOfPayment": { "EUR": [ "sepa" ] },
      "online": true,
      "publishingDate": "2024-01-25T16:22:01.202Z",
      "premium": 10,
      "prices": {
        "EUR": 407.77
      },
      "escrow": "bc1q...5al"
    },
    ...
  ],
  "total": 32,
  "remaining": 22
}

HTTP Request

POST /v1/offer/search

Body Parameters

Name Type Required Description
type string no The offer type to filter for: `ask
amount number|[number,number] no The offer amount or a range to filter for
meansOfPayment MeansOfPayment no Object with Currency as keys and array of paymentMethod ids as values
maxPremium number no The maximum premium sell offers should show for
minReputation number no The minimum reputation the users need to have (it is a number between -1 and 1)

Query Parameters

Name Type Required Description
page string no The page number for paginated results
size string no The page size
sortBy string no Comma separated list of sorting rules (bestReputation, highestAmount, highestPrice, lowestPremium)

Contact

Report

Send a report to customer support

curl https://api.peachbitcoin.com/v1/contact/report

The above command returns JSON structured like this:

{
  "success": true
}

HTTP Request

POST /v1/contact/report

Body Parameters

Name Type Required Description
email string yes Your email to get in touch with
topic string yes What the report is about
reason string yes The reason for the report
message string yes Message

Blockchain

Get Transaction

Get transaction data

curl https://api.peachbitcoin.com/v1/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b

The above command returns JSON structured like this:

{
  "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
  "version": 1,
  "locktime": 0,
  "vin": [{
    "txid": "0000000000000000000000000000000000000000000000000000000000000000",
    "vout": 4294967295,
    "prevout": null,
    "scriptsig": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
    "scriptsig_asm": "OP_PUSHBYTES_4 ffff001d OP_PUSHBYTES_1 04 OP_PUSHBYTES_69 5468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
    "is_coinbase": true,
    "sequence": 4294967295
  }],
  "vout": [{
    "scriptpubkey": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
    "scriptpubkey_asm": "OP_PUSHBYTES_65 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
    "scriptpubkey_type": "p2pk",
    "value": 5000000000
  }],
  "size": 204,
  "weight": 816,
  "fee": 0,
  "status": {
    "confirmed": true,
    "block_height": 0,
    "block_hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "block_time": 1231006505
  }
}

HTTP Request

GET /v1/tx/:txId

Post Transaction

Get transaction data

curl -X POST -sSLd "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000" https://api.peachbitcoin.com/v1/tx

The above command returns the txId if successful

4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b

HTTP Request

POST /v1/tx

Body Parameters

Name Type Required Description
tx string yes The transaction as hex

Get Fee Estimates

Get the currently suggested fees for a new transaction

curl https://api.peachbitcoin.com/v1/estimateFees

The above command returns JSON structured like this:

{
  "fastestFee": 7,
  "halfHourFee": 7,
  "hourFee": 6.5,
  "economyFee": 6.2,
  "minimumFee": 6
}

HTTP Request

GET /v1/estimateFees

Registration and Authentication

Private API endpoints are used to access user specific resources.

In order to access the private API endpoints a user is required request an auth token. Auth tokens can be acquired by authentication of public keys.

When successfully requesting a token, the public key is automatically registered if it does not exist in the system.

Register or just Get Access Token

Use this endpoint to get auth token by sending public key, challenge and signed message. The received token is valid for 60 minutes.

Note that the first time for a new account you'll need to call /v1/user/register/ Once registered use /v1/user/auth/ going forward. The request and response parameters are identical.

## Example request here
curl -X POST "https://api.peachbitcoin.com/v1/user/auth/"
-H 'Content-Type: application/json' \
--data-raw '{
    "publicKey": "03e448b2397c1880e39853371af5346e7e7972c9d6e26dbbb39ff6c2227aa19c80",
    "message": "Peach Registration 1231006505000",
    "signature": "H7vbUS+FJRddsZjWp4SjxPLMh2JcjfuR6wz5n/S4Pd44MxZ2epPH0AaZlVWxk0q68t1fFYdt5xruNok30I5c0Pg="
}'

The above command returns a response with the token:

{
  "expiry": 1631987976268,
  "accessToken": "5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28"
}

HTTP Request

POST /v1/user/register/ POST /v1/user/auth/

Body Parameters

Name Type Required Description
publicKey string yes Public key of user account (recommended to use 1st public key, path m/48'/0'/0'/0')
message string yes Message to sign containing current timestamp.
Use the following pattern: Peach Registration ${CURRENT_TIMESTAMP}
signature string yes Hex encoded signature* of message, message is hashed by SHA256 algorithm and signed with the corresponding private key using ECDSA.
Used to verify user is indeed owner of private key which is associate to the public key.
uniqueId string no A unique identifier you wish to associate with your account. Used to take over reputation from one account to another.

* base64 encoding support is planned for a future release.

Using the Access Token

Once acquired, the access token is passed through the request headers Authorization

User (Private)

Get Self User

Get current user's info.

curl -X GET https://api.peachbitcoin.com/v1/user/me
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "id": "02d6...fda",
  "linkedIds": [],
  "disabled": false,
  "creationDate": "2023-07-05T15:40:49.931Z",
  "lastModified": "2023-06-03T13:55:32.109Z",
  "trades": 1,
  "kyc": false,
  "rating": 1,
  "peachRating": 1,
  "userRating": 1,
  "historyRating": 1,
  "recentRating": 1,
  "ratingCount": 1,
  "medals": ["superTrader"],
  "pgpPublicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----...-----END PGP PUBLIC KEY BLOCK-----",
  "pgpPublicKeyProof": "0bc8c45148d9...960e5e",
  "fcmToken": "the fcm token",
  "uniqueId": "e3b0c44298fc...b855",
  "referralCode": "PEACH",
  "usedReferralCode": "SATOSHI",
  "referredTradingAmount": 21000000,
  "bonusPoints": 2100,
  "disputes": {
    "opened": 0,
    "won": 0,
    "lost": 0
  },
  "feeRate": 1,
  "freeTrades": 0,
  "maxFreeTrades": 0
}

HTTP Request

GET /v1/user/me

Get User Payment Method Info

Get the current user's payment method info. Currently includes list of forbidden payment methods.

curl -X GET https://api.peachbitcoin.com/v1/user/me/paymentMethods
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
 "forbidden": {
    "buy": ["paypal"],
    "sell": []
  }
}

HTTP Request

GET /v1/user/me/paymentMethods

Trading Limit

Get your current trading limits.

curl -X GET https://api.peachbitcoin.com/v1/user/tradingLimit
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "daily": 1000,
  "dailyAmount": 21,
  "yearly": 100000,
  "yearlyAmount": 615,
  "monthlyAnonymous": 1000,
  "monthlyAnonymousAmount": 0
}

HTTP Request

GET /v1/user/tradingLimit

Update User

Update your pgp keys, fcmToken (push notifications), used referral code and fee rate.

curl -X PATCH https://api.peachbitcoin.com/v1/user
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/user

Body Parameters

Name Type Required Description
pgpPublicKey string no PGP public key to set
message string yes if pgpPublicKey is passed Message to be signed with secret PGP keys
pgpSignature string yes if pgpPublicKey is passed Signature for message
signature string yes if pgpPublicKey is passed Signature by the Peach account of the new pgpPublicKey as message
fcmToken string no token for receiving push notifications
referralCode string no Used referral code
feeRate string|number no Can be a fixed fee rate if passed as number. But also the following enums are allowed: 'fastestFee'

User status

Returns your status in relation to another user

curl -X GET https://api.peachbitcoin.com/v1/user/0213583209ada26c16e5c3157d86809f8fd46e602936a4e3d51cd988a42ebe19f3/status
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "isBlocked": false
}

HTTP Request

GET /v1/user/:userId/status

Block User

Block a user. Once blocked, you won't see their matches and they won't be able to see yours. If you are still in a trade with the user, you can still complete the trade and chat.

curl -X PUT https://api.peachbitcoin.com/v1/user/0213583209ada26c16e5c3157d86809f8fd46e602936a4e3d51cd988a42ebe19f3/block
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

PUT /v1/user/:userId/block

Unblock User

Unblock a user.

curl -X DELETE https://api.peachbitcoin.com/v1/user/0213583209ada26c16e5c3157d86809f8fd46e602936a4e3d51cd988a42ebe19f3/block
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

DELETE /v1/user/:userId/block

Enable Batching

With this endpoint you can participate in or leave the batching program.

Should you leave the batching program while payouts are still pending. They will be paid out immediately at higher fees.

curl -X PATCH https://api.peachbitcoin.com/v1/user/batching
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/user/batching

Body Parameters

Name Type Required Description
enableBatching boolean yes If true, escrow payouts will be batched

Redeem custom referral code

Redeem Peach bonus points and register a new referral code to shill. Old referral codes keep working.

curl -X PATCH https://api.peachbitcoin.com/v1/user/referral/redeem/referralCode
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "success": true,
  "bonusPoints": 21
}

HTTP Request

PATCH /v1/user/referral/redeem/referralCode

Body Parameters

Name Type Required Description
code string yes Alphanumeric referral code to register

Redeem free trades

Redeem Peach bonus points and receive free trades credited onto your Peach account

curl -X PATCH https://api.peachbitcoin.com//v1/user/referral/redeem/freeTrades
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "success": true,
  "bonusPoints": 21
}

PATCH /v1/user/referral/redeem/fiveFreeTrades

Unlink payment hash with current user (used when you intend to create a new user)

curl -X PATCH "https://api.peachbitcoin.com/v1/user/paymentHash"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/user/paymentHash

Body Parameters

Name Type Required Description
hashes string[] yes Array of payment hashes

Logout

Logout consists of unregistering for push notifications.

curl -X PATCH "https://api.peachbitcoin.com/v1/user/logout"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/user/logout

Offer (Private)

Get Offer Details

Get details of an offer you own.

curl -X GET https://api.peachbitcoin.com/v1/offer/114/details
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "id": "115",
  "user": {
    "id": "02c3f68178d567253170cd47c896c5e4045e40026ef6f1e2e361d968552dc02496",
    ...
  },
  "type": "bid",
  "amount": [ 50000, 2560000 ],
  "meansOfPayment": {
    "EUR": [
      "cash.lv.riga.baltic-honeybadger",
      "paypal"
    ]
  },
  "tradeStatus": "searchingForPeer"
}

HTTP Request

GET /v1/offer/:offerId/details

Get all Offers

List all offers you own

curl -X GET https://api.peachbitcoin.com/v1/offers
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "amount": [50000, 2300000],
  "creationDate": "2023-08-22T12:49:58.434Z",
  "doubleMatched": false,
  "freeTrade": false,
  "id": "79",
  "lastModified": "2023-08-22T12:49:58.434Z",
  "matches": [],
  "maxPremium": null,
  "meansOfPayment": {
    "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
  },
  "message": "I confirm that only I, peach03a73739, control the address bcrt1qzd4zfctml24e6jwsjc7sd4t98euv6tc5pprmyf",
  "messageSignature": "IP3YBkHGd...bcltUY8=",
  "online": true,
  "paymentData": {
    "cash.lv.riga.baltic-honeybadger": {
      "country": "LV",
      "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"]
    },
    "paypal": {
      "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
    }
  },
  "publishingDate": "2023-08-22T12:49:58.434Z",
  "releaseAddress": "bcrt1qzd4zfctml24e6jwsjc7sd4t98euv6tc5pprmyf",
  "tradeStatus": "searchingForPeer",
  "type": "bid",
  "user": {
    "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
    ...
  }
}

HTTP Request

GET /v1/offers

Get Offers Summaries

List all offers summaries.

curl -X GET https://api.peachbitcoin.com/v1/offers/summary
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

[
  {
    "id": "1",
    "type": "ask",
    "contractId": "1-22",
    "lastModified": "2023-08-11T09:38:01.154Z",
    "creationDate": "2023-08-10T09:50:41.716Z",
    "amount": 50000,
    "matches": [],
    "prices": {
      "EUR": 13.04
    },
    "tradeStatus": "tradeCompleted",
    "fundingTxId": "841b151c1c9c5edb8bfe57df43f1580b6357023582e20a971ca9a0d557ba1e05"
  },
  ...
  {
    "id": "115",
    "type": "bid",
    "lastModified": "2023-08-22T15:35:24.650Z",
    "creationDate": "2023-08-22T15:35:24.650Z",
    "amount": [50000, 2560000],
    "matches": [],
    "tradeStatus": "searchingForPeer"
  }
]

HTTP Request

GET /v1/offers/summary

Post Buy Offer

Post a new buy offer.

curl -X POST "https://api.peachbitcoin.com/v1/offer/"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "type": "bid",
  "amount": [50000, 2330000],
  "meansOfPayment": {
    "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
  },
  "paymentData": {
    "cash.lv.riga.baltic-honeybadger": {
      "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"],
    },
    "paypal": {
      "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
    }
  },
  "releaseAddress": "bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds",
  "messageSignature": "ILVomp0EuVl9vLUoaiV0/Dx0CZS1PHaJ7YOZxqstLfuYTZ6vVIkGYeihnu4oBGAdnrfQAEZ2t0EuZMMF2jxNp5w=",
  "maxPremium": null
}'

The above command returns a response like this:

{
  "amount": [50000, 2330000],
  "creationDate": "2023-08-22T15:11:14.556Z",
  "doubleMatched": false,
  "escrowFee": 0.02,
  "freeTrade": false,
  "id": "113",
  "lastModified": "2023-08-22T15:11:14.556Z",
  "matches": [],
  "maxPremium": null,
  "meansOfPayment": {
    "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
  },
  "message": "I confirm that only I, peach03a73739, control the address bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds",
  "messageSignature": "ILVomp0EuVl9vLUoaiV0/Dx0CZS1PHaJ7YOZxqstLfuYTZ6vVIkGYeihnu4oBGAdnrfQAEZ2t0EuZMMF2jxNp5w=",
  "online": true,
  "paymentData": {
    "cash.lv.riga.baltic-honeybadger": {
      "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"]
    },
    "paypal": {
      "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
    }
  },
  "publishingDate": null,
  "releaseAddress": "bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds",
  "type": "bid",
  "user": {
    "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
    ...
  }
}

HTTP Request

POST /v1/offer/

Body Parameters

Name Type Required Description
type string yes bid
amount [number, number] yes Range within you want to buy sats
maxPremium number no The maximum premium you are willing to pay
meansOfPayment MeansOfPayment yes Object with Currency as keys and array of paymentMethod ids as values
paymentData OfferPaymentData yes Object with paymentMethod ids as keys and object with payment data hashes as values.
Payment data hashes are sha256 hashes and are based on the each original payment data fields. Each field must be hashed individually.
releaseAddress string yes Bitcoin address to release funds to complete trade.
messageSignature string yes As a buyer you must sign the following message template with the corresponding private keys of your releaseAddress:
I confirm that only I, peach<YOUR_ID>, control the address <RELEASE_ADDRESS>

Post Sell Offer

Post a new sell offer.

curl -X POST "https://api.peachbitcoin.com/v1/offer/"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "premium": 8,
  "type": "ask",
  "amount": 300000,
  "meansOfPayment": {
    "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
  },
  "paymentData": {
    "cash.lv.riga.baltic-honeybadger": {
      "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"],
    },
    "paypal": {
      "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
    }
  },
  "returnAddress": "bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds"
}'

The above command returns a response like this:

{
  "amount": 300000,
  "creationDate": "2023-08-22T15:23:20.475Z",
  "doubleMatched": false,
  "escrowFee": 0,
  "escrowNotifiedUser": false,
  "freeTrade": false,
  "funding": {
    "amounts": [],
    "confirmations": 0,
    "expiry": 4320,
    "status": "NULL",
    "txIds": [],
    "vouts": []
  },
  "fundingAmountDifferent": false,
  "id": "114",
  "lastModified": 2023 - 08 - 22 T15: 23: 20.475 Z,
  "matches": [],
  "meansOfPayment": {
    "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
  },
  "online": false,
  "paymentData": {
    "cash.lv.riga.baltic-honeybadger": {
      "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"]
    },
    "paypal": {
      "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
    }
  },
  "premium": 8,
  "prices": { "EUR": 77.69 },
  "publishingDate": null,
  "refunded": false,
  "released": false,
  "returnAddress": "bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds",
  "type": "ask",
  "user": {
    "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
    ...
  }
}

HTTP Request

POST /v1/offer/

Body Parameters

Name Type Required Description
type string yes ask
amount number yes The amount in sats you want to sell
premium number no The premium you are selling for
meansOfPayment MeansOfPayment yes Object with Currency as keys and array of paymentMethod ids as values
paymentData OfferPaymentData yes Object with paymentMethod ids as keys and object with payment data hashes as values.
Payment data hashes are sha256 hashes and are based on the each original payment data fields. Each field must be hashed individually.
returnAddress string yes Bitcoin address to return funds to in case of a canceled trade.

Create Escrow

Post a create escrow for offer.

curl -X POST "https://api.peachbitcoin.com/v1/offer/114"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "publicKey": "03e448b2397c1880e39853371af5346e7e7972c9d6e26dbbb39ff6c2227aa19c80"
}'

The above command returns a response like this:

{
  "escrow": "bcrt1q3urn30702x7m2mdqwavf295esde83m9hf25ykk49025mgxgpe6vqmxh700",
  "funding": {
    "confirmations": 0,
    "status": "NULL"
  },
  "offerId": "114"
}

HTTP Request

POST /v1/offer/:offerId/escrow

Body Parameters

Name Type Required Description
publicKey string yes Seller public key needed to create the multisig between seller and Peach

Get Funding Status

Get funding status of escrow.

curl -X GET https://api.peachbitcoin.com/v1/offer/114/escrow
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "escrow": "bcrt1q3urn30702x7m2mdqwavf295esde83m9hf25ykk49025mgxgpe6vqmxh700",
  "funding": {
    "amounts": [],
    "confirmations": 0,
    "derivationPath": "m/48'/0'/0'/0/114",
    "expiry": 576,
    "status": "NULL",
    "txIds": [],
    "vouts": []
  },
  "offerId": "114",
  "returnAddress": "bcrt1qlwpcjuude4mlmnvpfhenkwh7rcw06xkcp3d8ds",
  "userConfirmationRequired": false
}

HTTP Request

GET /v1/offer/:offerId/escrow

Confirm Escrow Funding

If you sent a different amount to the escrow address and userConfirmationRequired on the FundingStatus is true you'll have to confirm the funding amount through this endpoint.

curl -X POST "https://api.peachbitcoin.com/v1/offer/114/escrow/confirm"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/offer/:offerId/escrow/confirm

Update Buy Offer

Update buy offer preferences

curl -X POST "https://api.peachbitcoin.com/v1/offer/123"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "maxPremium": 10
}'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/offer/:offerId

Body Parameters

Name Type Required Description
maxPremium number no The maximum premium you are willing to pay

Update Sell Offer

Update sell offer preferences

curl -X POST "https://api.peachbitcoin.com/v1/offer/123"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "refundTx": "cHNidP8...sAAAA",
  "premium": 8,
}'

The above command returns a response like this:

{ "success": true }

HTTP Request

PATCH /v1/offer/:offerId

Body Parameters

Name Type Required Description
premium number no The premium you want to sell for
refundTx string no Presigned refund transaction which is base64 encoded. Used when requesting trade cancelation to get refunded as soon as buyer accepts.

Cancel Offer

You can cancel your offer as long as it's not in a trade.

curl -X POST "https://api.peachbitcoin.com/v1/offer/114/cancel"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

For buy offers, the above command returns a response like this:

{ "success": true }

For sell offers, the above command returns a response like this:

{
  "psbt": "cHNidP8BAFIC...GHdkZrAAA",
  "returnAddress": "bcrt1qthgtaqk8473rsta5a459h64qtj8ntgj0k74sk3",
  "amount": 285900,
  "fees": 14100,
  "satsPerByte": 100
}

HTTP Request

POST /v1/offer/:offerId/cancel

Get Refund PSBT

Once you canceled your sell offer, you can request the cancelation PSBT again to complete the refund

curl -X GET "https://api.peachbitcoin.com/v1/offer/114/refundPSBT"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "psbt": "cHNidP8BAFIC...GHdkZrAAA",
  "returnAddress": "bcrt1qthgtaqk8473rsta5a459h64qtj8ntgj0k74sk3",
  "amount": 285900,
  "fees": 14100,
  "satsPerByte": 100
}

HTTP Request

GET /v1/offer/:offerId/refundPSBT

Refund Sell Offer

Finalize sell offer refunding

curl -X GET "https://api.peachbitcoin.com/v1/offer/114/refund"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'
-H 'Content-Type: application/json' \
--data-raw '{
  "tx": "02000000000...028de75fd2ff22ac00000000",
}'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/offer/:offerId/refund

Body Parameters

Name Type Required Description
tx string yes The release transaction to be broadcasted

Re-publish Sell Offer

When your trade got canceled, you have the option to re-publish your sell offer.

curl -X GET "https://api.peachbitcoin.com/v1/offer/114/revive"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "newOfferId": "120" }

HTTP Request

POST /v1/offer/:offerId/revive

Match (Private)

Get Matches

Get matches for an offer.

curl -X GET https://api.peachbitcoin.com/v1/offer/114/matches
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{
  "offerId": "115",
  "matches": [{
    "creationDate": "2023-08-22T15:35:56.772Z",
    "lastModified": "2023-08-22T15:35:56.772Z",
    "user": {
      "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
      ...
    },
    "offerId": "107",
    "prices": { "EUR": 77.67 },
    "amount": 300000,
    "premium": 8,
    "escrow": "bcrt1q8u4al33hrayyqrnyxu5ut8l644lgtw6mxey77v9n8jqj0awkywws6fr47p",
    "matchedPrice": null,
    "meansOfPayment": {
      "EUR": ["cash.lv.riga.baltic-honeybadger", "paypal"]
    },
    "paymentData": {
      "cash.lv.riga.baltic-honeybadger": {
        "hashes": ["2312b8c8bcc4c5e8541893b5e3bc88d165ba83ea6f19fc747a5e1874226c1f08"],
        "country": "LV"
      },
      "paypal": {
        "hashes": ["fda659c82ae97ce2c4b26665e558a97796951f7691f85e97d693425a1eaeae21"]
      }
    },
    "selectedCurrency": null,
    "selectedPaymentMethod": null,
    "symmetricKeyEncrypted": "",
    "symmetricKeySignature": "",
    "matched": false,
    "unavailable": {
      "exceedsLimit": []
    }
  }],
  "totalMatches": 1
}

HTTP Request

GET /v1/offer/:offerId/matches

Match a Sell Offer

Match a sell offer

curl -X POST "https://api.peachbitcoin.com/v1/offer/match"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "matchingOfferId": "116",
  "currency": "EUR",
  "paymentMethod": "paypal",
  "price": 77.32,
  "premium": 8,
  "symmetricKeyEncrypted": "-----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
  "symmetricKeySignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----"
}'

The above command returns a response like this:

{ "matchedPrice": 77.33 }

HTTP Request

POST /v1/offer/:offerId/match

Body Parameters

Name Type Required Description
matchingOfferId string yes ID of offer you want to match
currency string yes The currency to match with
paymentMethod string yes The payment method to match with
premium string no Send the premium to ensure you match with the expected premium (in case the seller just changes it)
symmetricKeyEncrypted string yes PGP encrypted symmetric key. Ensure that the symmetric key is random and of sufficient entropy
symmetricKeySignature string yes PGP signature of symmetric key for verification

Unmatch a Sell Offer

Unmatch a sell offer

curl -X DELETE "https://api.peachbitcoin.com/v1/offer/match"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "matchingOfferId": "116"
}'

The above command returns a response like this:

{ "success": true }

HTTP Request

DELETE /v1/offer/:offerId/match

Body Parameters

Name Type Required Description
matchingOfferId string yes ID of offer you want to unmatch

Doublematch a buy Offer

Doublematch a buy offer

curl -X POST "https://api.peachbitcoin.com/v1/offer/match"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: application/json' \
--data-raw '{
  "matchingOfferId": "115",
  "currency": "EUR",
  "paymentMethod": "paypal",
  "price": 77.33,
  "premium": 8.06,
  "paymentDataEncrypted": "-----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
  "paymentDataSignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----"
}'

The above command returns a response like this:

{ 
  "success": true,
  "contractId": "116-115"
}

HTTP Request

POST /v1/offer/:offerId/match

Body Parameters

Name Type Required Description
matchingOfferId string yes ID of offer you want to match
currency string yes The currency to match with
paymentMethod string yes The payment method to match with
paymentDataEncrypted string yes PGP encrypted JSON stringified payment data
paymentDataSignature string yes PGP signature of JSON stringified payment data

Contract (Private)

Contract Details

Get details of a specific contract

curl https://api.peachbitcoin.com/v1/contract/123-456
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns JSON structured like this:

{
  "amount": 90000,
  "batchId": "26dc44bbe...f5de2",
  "batchReleasePsbt": "cHNid...sAAA=",
  "batchRevocationToken": "b9743b241f72484a8d77bb0b83b1a16e",
  "buyer": {
    "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
    ...
  },
  "buyerFee": 0.02,
  "cancelationRequested": false,
  "canceled": false,
  "country": "LV",
  "creationDate": "2023-08-17T07:57:41.789Z",
  "currency": "EUR",
  "disputeAcknowledgedByCounterParty": false,
  "disputeActive": false,
  "disputeDate": null,
  "disputeOutcomeAcknowledged": false,
  "disputeOutcomeAcknowledgedBy": [],
  "disputeResolvedDate": null,
  "escrow": "bc1qlhq...6u2vd",
  "hashedPaymentData": ["e1155ed7332cbe829987d033a0266f6278067969db76cfe7448388a193ba2cf6"],
  "id": "57-51",
  "isChatActive": true,
  "isEmailRequired": false,
  "lastModified": "2023-08-17T07:58:51.007Z",
  "messages": 0,
  "paymentConfirmed": "2023-08-17T07:57:54.663Z",
  "paymentDataEncrypted": "-----BEGIN PGP MESSAGE-----...----END PGP MESSAGE-----",
  "paymentDataSignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----",
  "paymentExpectedBy": "2137-12-20T23:00:00.000Z",
  "paymentMade": "2023-08-17T07:57:50.640Z",
  "paymentMethod": "cash.lv.riga.baltic-honeybadger",
  "premium": 4,
  "price": 25,
  "priceCHF": 23.94,
  "ratingBuyer": 1,
  "ratingSeller": 1,
  "releaseAddress": "bcrt1qzvle5erusx9lsqmpgq4ej5rfjdp94r04jnaj07",
  "releasePsbt": "cHNidP8...sAAAA",
  "releaseTransaction": "02000000000...028de75fd2ff22ac00000000",
  "releaseTxId": "24efff....46164",
  "seller": {
    "id": "02c3f68178d567253170cd47c896c5e4045e40026ef6f1e2e361d968552dc02496",
    ...
  },
  "sellerFee": 0,
  "symmetricKeyEncrypted": "-----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
  "symmetricKeySignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----",
  "tradeStatus": "tradeCompleted",
  "unreadMessages": 0
}

HTTP Request

GET /v1/contract/:contractId

Contract Summaries

Get summaries of a all user contracts

curl https://api.peachbitcoin.com/v1/contracts/summary
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns JSON structured like this:

[{
  "amount": 50000,
  "contractId": "1-22",
  "creationDate": "2023-08-10T09:50:41.716Z",
  "fundingTxId": "841b15...1e05",
  "id": "1",
  "lastModified": "2023-08-11T09:38:01.154Z",
  "matches": [],
  "prices": {
    "EUR": 13.03
  },
  "tradeStatus": "tradeCompleted",
  "type": "ask"
}, {
  "amount": 50000,
  "contractId": "2-24",
  "creationDate": "2023-08-10T09:50:41.716Z",
  "fundingTxId": "841b15...1e05",
  "id": "2",
  "lastModified": "2023-08-11T09:43:26.043Z",
  "matches": [],
  "prices": {
    "EUR": 13.03
  },
  "tradeStatus": "tradeCompleted",
  "type": "ask"
}]

HTTP Request

GET /v1/contracts/summary

Contracts

Get details of a all user contracts

curl https://api.peachbitcoin.com/v1/contracts
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns JSON structured like this:

[{
  "amount": 90000,
  "batchId": "26dc44bbe...f5de2",
  "batchReleasePsbt": "cHNid...sAAA=",
  "batchRevocationToken": "b9743b241f72484a8d77bb0b83b1a16e",
  "buyer": {
    "id": "03a73739b3f005fccb3f02ebeb2eae41b5d5c0c7dd3d448a00185c2c07f2b55dd1",
    ...
  },
  "buyerFee": 0.02,
  "cancelationRequested": false,
  "canceled": false,
  "country": "LV",
  "creationDate": "2023-08-17T07:57:41.789Z",
  "currency": "EUR",
  "disputeAcknowledgedByCounterParty": false,
  "disputeActive": false,
  "disputeDate": null,
  "disputeOutcomeAcknowledged": false,
  "disputeOutcomeAcknowledgedBy": [],
  "disputeResolvedDate": null,
  "escrow": "bc1qlhq...6u2vd",
  "hashedPaymentData": ["e1155ed7332cbe829987d033a0266f6278067969db76cfe7448388a193ba2cf6"],
  "id": "57-51",
  "isChatActive": true,
  "isEmailRequired": false,
  "lastModified": "2023-08-17T07:58:51.007Z",
  "messages": 0,
  "paymentConfirmed": "2023-08-17T07:57:54.663Z",
  "paymentDataEncrypted": "-----BEGIN PGP MESSAGE-----...----END PGP MESSAGE-----",
  "paymentDataSignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----",
  "paymentExpectedBy": "2137-12-20T23:00:00.000Z",
  "paymentMade": "2023-08-17T07:57:50.640Z",
  "paymentMethod": "cash.lv.riga.baltic-honeybadger",
  "premium": 4,
  "price": 25,
  "priceCHF": 23.94,
  "ratingBuyer": 1,
  "ratingSeller": 1,
  "releaseAddress": "bcrt1qzvle5erusx9lsqmpgq4ej5rfjdp94r04jnaj07",
  "releasePsbt": "cHNidP8...sAAAA",
  "releaseTransaction": "02000000000...028de75fd2ff22ac00000000",
  "releaseTxId": "24efff....46164",
  "seller": {
    "id": "02c3f68178d567253170cd47c896c5e4045e40026ef6f1e2e361d968552dc02496",
    ...
  },
  "sellerFee": 0,
  "symmetricKeyEncrypted": "-----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
  "symmetricKeySignature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----",
  "tradeStatus": "tradeCompleted",
  "unreadMessages": 0
}]

HTTP Request

GET /v1/contracts

Confirm Payment Made

Buyer: confirm that payment has been made.

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/payment/confirm"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true}

HTTP Request

POST /v1/contract/:contractId/payment/confirm

Confirm Payment Received

Confirm a payment has been made.

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/payment/confirm"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "txId": "24efff...46164" }

HTTP Request

POST /v1/contract/:contractId/payment/confirm

Rate Counterparty

After a trade has been completed, you can rate your counterparty.

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/user/rate"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/user/rate

Body Parameters

Name Type Required Description
rating -1 or 1 yes The rating to give your counterparty. -1 = 👎 and 1 = 👍
signature string yes The signature of the sha256 hash of the counter party's user id signed with the corresponding private key of your user id.

Cancel Contract

Cancels a contract as long as payment has not yet been made or at any time during cash trades. You cannot cancel while a dispute is active.

As a seller, this will request contract cancelation unless it's a cash trade or the time to make the payment has run out for the buyer.

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/cancel"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this if you are the buyer:

{ "success": true }

If you are the seller, and you can cancel right away, you'll receive a presigned PSBT for refund. The above command returns a response like this

{ "psbt": "cHNidP8...sAAAA" }

HTTP Request

POST /v1/contract/:contractId/cancel

Confirm Cancelation Request

After a seller requests cancelation, this endpoint will confirm and effectively cancel the contract.

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/cancel/confirm"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this if you are the buyer:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/cancel/confirm

Reject Cancelation Request

After a seller requests cancelation, this endpoint will reject the request and the trade will continue

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/cancel/reject"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this if you are the buyer:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/cancel/reject

Extend Payment Time

As a seller you have to wait up to 12 hours for the buyer to claim that the payment has been made. After this time runs out, you have the choice to extend the time or cancel the trade. This endpoint allows you to extend the timer by another 12 hours

curl -X PATCH https://api.peachbitcoin.com/v1/contract/123-456/cancel/extendTime
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this if you are the buyer:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/cancel/extendTime

Chat Log

Receive chat history.

curl -X GET https://api.peachbitcoin.com/v1/contract/123-456/chat
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

[
  {
    "date": "2021-09-17T14:41:41.605Z",
    "from": "26dc...5de2",
    "message": "----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
    "readBy": ["26dc...5de2"],
    "roomid": "123-456",
    "signature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----"
  }
  {
    "date": "2021-09-17T14:42:14.2345Z",
    "from": "26dc...5de2",
    "message": "----BEGIN PGP MESSAGE-----...-----END PGP MESSAGE-----",
    "readBy": ["26dc...5de2"],
    "roomid": "123-456",
    "signature": "-----BEGIN PGP SIGNATURE-----...-----END PGP SIGNATURE-----"
  }
]

HTTP Request

GET /v1/contract/:contractId/chat

Query Parameters

Name Type Required Description
page number no The page of the chat history. Each page contains 21 messages

Post Chat Message

Send a message via chat

curl -X GET https://api.peachbitcoin.com/v1/contract/123-456/chat
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28' \
-H 'Content-Type: multipart/form-data' \
-F 'message="Here is the proof of payment "'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/chat

Body Parameters

Name Type Required Description
message string yes The message to be sent (encrypted with symmetricKey)
signature string yes The PGP signature of the message

Set Chat Message Read

Tell server that messages have been read

curl -X POST "https://api.peachbitcoin.com/v1/contract/123-456/chat/received"
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/chat/received

Body Parameters

Name Type Required Description
start number yes The starting index of read messages
end number yes The last index of read messages

Raise a Dispute

Raise a dispute

curl -X GET https://api.peachbitcoin.com/v1/contract/123-456/dispute
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/dispute

Body Parameters

Name Type Required Description
email string depends The email to get in touch with, required when reason is noPayment.seller or noPayment.buyer
reason string yes The reason for the dispute: noPayment.seller,noPayment.buyer, unresponsive.seller, unresponsive.buyer, abusive,other
message string no A short description as to why the dispute has been raised
symmetricKeyEncrypted string yes The symmetric key used to share secrets with counter party. Encrypt this key with the public PGP key.

Acknowledge a Dispute

Acknowlegde a dispute when it has been raised against you

curl -X GET https://api.peachbitcoin.com/v1/contract/123-456/dispute/acknowledge
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/dispute/acknowledge

Body Parameters

Name Type Required Description
email string depends The email to get in touch with, required when reason is noPayment.seller or noPayment.buyer

Acknowledge a Dispute Outcome

Inform Peach and counterparty that you have acknowledged the dispute outcome

curl -X GET https://api.peachbitcoin.com/v1/contract/123-456/dispute/acknowledgeOutcome
-H 'Authorization: Bearer 5294ed7a-18dd-4ce7-ab9e-3ecda4c54f28'

The above command returns a response like this:

{ "success": true }

HTTP Request

POST /v1/contract/:contractId/dispute/acknowledgeOutcome

Data Types

To ensure effective communication and compatibility between the API and its clients, a set of defined data types is used. These data types establish a consistent format for data exchange, reducing the risk of misunderstandings and errors. This section outlines the different data types employed in the system and their corresponding descriptions, serving as a quick reference for developers working with the API.

PaymentMethod

All available payment methods can be requested via System Info.

PaymentData

Payment data is a simple JSON object that contains the type which is the PaymentMethod and payment fields + their value.

type PaymentData = {
  type: PaymentMethod
  [key: string]: any
}

Example

{
  "type": "paypal",
  "email": "[email protected]",
  "phone": "",
  "reference": "",
  "userName": ""
}
Payment Method Required Fields Optional Fields
airtelMoney phone reference
alias beneficiary
accountNumber
reference
bancolombia beneficiary
accountNumber
reference
bizum beneficiary
phone
reference
blik beneficiary
phone
reference
cbu beneficiary
accountNumber
reference
chippercash userName reference
cvu beneficiary
accountNumber
reference
eversend userName reference
fasterPayments beneficiary
ukBankAccount
ukSortCode
reference
friends24 beneficiary
phone
reference
giftCard.amazon.XZY beneficiary
email
reference
instantSepa beneficiary
iban
bic
reference
iris beneficiary
phone
reference
keksPay beneficiary
phone
reference
liquid receiveAddress
lnurl lnurlAddress
lydia beneficiary
phone
reference
m-pesa phone reference
mbWay beneficiary
phone
reference
mercadoPago At least one:
phone
email
reference
mobilePay beneficiary
phone
reference
moov phone reference
mtn phone reference
n26 userName
email
phone
reference
nationalTransferBG beneficiary
iban OR accountNumber
bic
reference
nationalTransferCZ beneficiary
iban OR accountNumber
bic
reference
nationalTransferDK beneficiary
iban OR accountNumber
bic
reference
nationalTransferHU beneficiary
iban OR accountNumber
bic
reference
nationalTransferNO beneficiary
iban OR accountNumber
bic
reference
nationalTransferPL beneficiary
iban OR accountNumber
bic
reference
nationalTransferRO beneficiary
iban OR accountNumber
bic
reference
nationalTransferTR beneficiary
iban OR accountNumber
bic
reference
nationalTransferNG beneficiary
accountNumber
reference
nequi beneficiary
phone
reference
neteller beneficiary
email
reference
orangeMoney phone reference
papara beneficiary
phone
reference
payday userName reference
paylib beneficiary
phone
reference
paypal At least one:
userName
email
phone
reference
paysera beneficiary
phone
reference
rappipay phone reference
revolut userName
email
phone
reference
satispay beneficiary
phone
reference
sepa beneficiary
iban
bic
reference
sinpe beneficiary
iban
bic
reference
sinpeMovil beneficiary
phone
reference
skrill beneficiary
email
reference
straksbetaling beneficiary
accountNumber
reference
swish beneficiary
phone
reference
twint beneficiary
phone
reference
verse beneficiary
phone
reference
vipps beneficiary
phone
reference
wave phone reference
wise At least one:
userName
email
phone
reference

MeansOfPayment

The means of payment are a map of currencies and PaymentMethod.

type MeansOfPayment = {
  [key?: Currency]: PaymentMethod[]
}

Example

{
  "EUR": ["sepa", "paypal"],
  "CHF": ["twint", "paypal"]
}

Errors

The Peach API uses the following error codes:

Error Code ID Description
400 BAD_REQUEST Your request is invalid.
400 FORM_INVALID The form data is invalid.
400 INVALID_PGP_SIGNATURE The PGP signature is invalid.
400 INVALID_SIGNATURE The signature is invalid.
400 TRANSACTION_INVALID The transaction is invalid.
401 AUTHENTICATION_FAILED Authentication failed.
401 CANCELED The operation was canceled.
401 CANNOT_DOUBLEMATCH Unable to double match.
401 CANNOT_MATCH Unable to match.
401 CONTRACT_EXISTS Contract already exists.
401 NOT_ENOUGH_POINTS Not enough points for the operation.
401 OFFER_TAKEN Offer has already been taken.
401 PAYMENT_HASH_INVALID Invalid payment hash.
401 PGP_MISSING PGP key is missing.
401 TRADING_LIMIT_REACHED Trading limit has been reached.
401 UNAUTHORIZED Unauthorized access.
401 USER_EXISTS User already exists.
403 ACCOUNT_BANNED Account is banned.
404 NOT_FOUND The requested resource was not found.
409 ALREADY_TAKEN The resource is already taken.
409 DUPLICATE Duplicate resource found.
429 TOO_MANY_REQUESTS Too many requests.
451 UNAVAILABLE_FOR_LEGAL_REASONS Unavailable due to legal reasons (i.e. you request from a country Peach does not offer it's services to)
500 AUTHENTICATION_FAILURE Internal authentication error.
500 INTERNAL_SERVER_ERROR Internal server error.
503 SERVICE_UNAVAILABLE The service is currently unavailable.