NAV Navbar
HTTP Curl Go JavaScript NodeJS Python Ruby
  • Bity Exchange API v2.0
  • Orders
  • Currencies
  • Schemas
  • Bity Exchange API v2.0

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    The present document gives the technical details enabling one to make request to and understand the responses of the Exchange API. Should you want to know what is possible to do with the API, please consult the product guide or have a look at the product page.

    Version 2 of the Exchange API (this version) is stable and should be considered reliable. However, Bity reserves itself the right to correct bugs in these API endpoints without considering such corrections as being breaking changes.

    Connection to the API happens over HTTP/1.1 (RFC 7231) and HTTP State Management (RFC 6265) is required. Most libraries and user-agents allowing HTTP requests to be performed already implements that for you as long as cookies are not disabled and that you are requesting credentials to be included in the requests.

    API clients of registered partners add an optional Client-ID header to the requests. This enables partners to benefit from profit sharing. See the corresponding section of the product guide for more details.

    The OpenAPI definition in YAML format is available here.

    Base URLs:

    Terms of service Web: Bity SA

    Orders

    Estimate the amount of an order

    Code samples

    POST https://exchange.api.bity.com/v2/orders/estimate HTTP/1.1
    Host: exchange.api.bity.com
    Content-Type: application/json
    Accept: application/json
    
    
    curl -X POST https://exchange.api.bity.com/v2/orders/estimate \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      --data '{
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR"
      }
    }'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://exchange.api.bity.com/v2/orders/estimate", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    };
    
    var inputBody = {
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR"
      }
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/orders/estimate',
      method: 'post',
      data: JSON.stringify(inputBody),
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = {
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR"
      }
    };
    const headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/orders/estimate',
    {
      method: 'POST',
      body: JSON.stringify(inputBody),
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    data = {
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR"
      }
    }
    
    r = requests.post('https://exchange.api.bity.com/v2/orders/estimate',
        params={},
        data=json.dumps(data),
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://exchange.api.bity.com/v2/orders/estimate',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /orders/estimate

    The endpoint is similar to the endpoints allowing an order to be placed. However, only the currencies and the input or output amount are specified in the request.

    Estimate the output amount corresponding to an input amount

    To estimate the output amount simply place the amount in the input.

    Estimate the input amount corresponding to an output amount

    To estimate the input amount simply place the amount in the output.

    Body parameter

    Estimating the output amount for a given input amount.

    {
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR"
      }
    }
    

    Parameters

    Name In Type Required Description
    input body AmountEstimationRequestInputOutput true none
    » amount body string false none
    » currency body CurrencyCode true none
    output body AmountEstimationRequestInputOutput true none

    Example responses

    Example response when specifying input or output.

    {
      "input": {
        "currency": "BTC",
        "amount": "1.00000000"
      },
      "output": {
        "currency": "EUR",
        "amount": "3087.86"
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful operation Inline
    400 Bad Request Malformed request.
    Invalid currency code.
    Invalid currency pair.
    Invalid amount.
    None

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    » input AmountEstimationInput true none none
    »» amount string false none none
    »» currency CurrencyCode true none none
    »» object_information_optional boolean false none When true, indicates that it is not required to provide information about the object which is going to pay the order.
    »» minimum_amount string false none none
    » output AmountEstimationOutput true none none
    »» amount string false none none
    »» currency CurrencyCode true none none
    »» minimum_amount string false none none

    Place an order

    Code samples

    POST https://exchange.api.bity.com/v2/orders HTTP/1.1
    Host: exchange.api.bity.com
    Content-Type: application/json
    
    
    curl -X POST https://exchange.api.bity.com/v2/orders \
      -H 'Content-Type: application/json' \
      --data '{
      "input": {
        "amount": "0.5",
        "currency": "ETH",
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "output": {
        "currency": "CHF",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX",
        "owner": {
          "name": "John Doe",
          "address": "Brückenstrasse 12",
          "zip": "3000",
          "city": "Bern",
          "country": "CH"
        }
      }
    }'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://exchange.api.bity.com/v2/orders", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Content-Type': 'application/json'
    };
    
    var inputBody = {
      "input": {
        "amount": "0.5",
        "currency": "ETH",
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "output": {
        "currency": "CHF",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX",
        "owner": {
          "name": "John Doe",
          "address": "Brückenstrasse 12",
          "zip": "3000",
          "city": "Bern",
          "country": "CH"
        }
      }
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/orders',
      method: 'post',
      data: JSON.stringify(inputBody),
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = {
      "input": {
        "amount": "0.5",
        "currency": "ETH",
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "output": {
        "currency": "CHF",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX",
        "owner": {
          "name": "John Doe",
          "address": "Brückenstrasse 12",
          "zip": "3000",
          "city": "Bern",
          "country": "CH"
        }
      }
    };
    const headers = {
      'Content-Type': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/orders',
    {
      method: 'POST',
      body: JSON.stringify(inputBody),
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Content-Type': 'application/json'
    }
    data = {
      "input": {
        "amount": "0.5",
        "currency": "ETH",
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "output": {
        "currency": "CHF",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX",
        "owner": {
          "name": "John Doe",
          "address": "Brückenstrasse 12",
          "zip": "3000",
          "city": "Bern",
          "country": "CH"
        }
      }
    }
    
    r = requests.post('https://exchange.api.bity.com/v2/orders',
        params={},
        data=json.dumps(data),
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post 'https://exchange.api.bity.com/v2/orders',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /orders

    It is possible to specify amount in the input or output in which case the corresponding input or output amount will be computed. The input or output amount can be estimated beforehand using the dedicated endpoint, see "Estimate the amount of an order". The input object must in principle contain the IBAN or crypto address which will be used to pay the order. In some cases, this is optional. See "Estimate the amount of an order" to figure out if this information can be omitted or not. Omitting the information increases the number of situations were we can be required to cancel an order uppon reception of the funds. To ensure a reliable execution of your order, the crypto address or IBAN must be provided and the paiment must be made from the provided object. Please note that without KYC, crypto-addresses and bank accounts are currently limited to a volume of 5000 CHF over a period of 365 days. We are unfortunately currently unable to send EUR payments to all IBANs. At this time, crypto-to-EUR orders are only possible with IBANs of the following countries: Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Iceland, Ireland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Monaco, Netherlands, Norway, Poland, Portugal, Romania, San Marino, Spain, Slovakia, Slovenia, Sweden, Switzerland, UK and Northern Ireland. This list of supported countries for EUR output will grow.

    Body parameter

    Crypto-to-fiat example.

    {
      "input": {
        "amount": "0.5",
        "currency": "ETH",
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "output": {
        "currency": "CHF",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX",
        "owner": {
          "name": "John Doe",
          "address": "Brückenstrasse 12",
          "zip": "3000",
          "city": "Bern",
          "country": "CH"
        }
      }
    }
    

    Parameters

    Name In Type Required Description
    contact_person body object false Information of a contact person to be used in case something unforeseen happens with the order. This information is optional. The customer can always get in touch with support via the order status page.
    » email body string false none
    input body OrderInputOutput true none
    » currency body CurrencyCode true none
    » amount body string false none
    » type body OrderInputOutputType false none
    » crypto_address body string false Only valid if type is crypto_address.
    » iban body string false Only valid if type is bank_account.
    » bic_swift body string false Only valid if type is bank_account.
    » reference body string false Only valid if type is bank_account. It can only be present as output.
    » owner body object false Only valid if type is bank_account.
    »» name body string false none
    »» address body string false none
    »» address_complement body string false none
    »» zip body string false none
    »» city body string false none
    »» state body string false none
    »» country body string false Must contain the two-letter country code (ISO 3166-1 alpha-2).
    » output body OrderInputOutput true none

    Detailed descriptions

    » reference: Only valid if type is bank_account. It can only be present as output. The length and the set of supported characters varies depending on the banks and networks involved. To avoid producing the "invalid_bank_account_reference" error, keep the reference short (32 characters or less is recommended) and use only simple characters (using only characters in a-z, A-Z, 0-9 and space is recommended).

    Enumerated Values

    Parameter Value
    » type crypto_address
    » type bank_account

    Responses

    Status Meaning Description Schema
    201 Created The order has been successfully created.
    The Location header contains the URI (which can be relative) at which the order status and details can be retrieved. That is the Location header is meant to be interpreted as per RFC 7231 section 7.1.2. None
    400 Bad Request Following cases:
    Unsupported currency pair.
    Quota exceeded for the bank account or crypto-address.
    Internal error.
    None

    List previously placed orders

    Code samples

    GET https://exchange.api.bity.com/v2/orders HTTP/1.1
    Host: exchange.api.bity.com
    Accept: application/json
    
    
    curl -X GET https://exchange.api.bity.com/v2/orders \
      -H 'Accept: application/json'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://exchange.api.bity.com/v2/orders", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Accept': 'application/json'
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/orders',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/orders',
    {
      method: 'GET',
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://exchange.api.bity.com/v2/orders',
        params={},
    
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://exchange.api.bity.com/v2/orders',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /orders

    Get a list of previously placed orders. Depending on the authentication method used different orders will be returned.

    Example responses

    200 Response

    {
      "orders": [
        {
          "id": "209a6210-4ea3-43e4-ba92-73aac60fb10c",
          "payment_details": {
            "type": "crypto_address",
            "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
          },
          "input": {
            "currency": "ETH",
            "amount": "0.5",
            "type": "crypto_address",
            "crypto_address": "0x24305d091f79ee490a34de080b0db5773be5bef4"
          },
          "output": {
            "currency": "CHF",
            "amount": "104.95",
            "type": "bank_account",
            "iban": "CH3600000000000000000",
            "bic_swift": "BCNNCH22",
            "owner": {
              "name": "John Doe",
              "country": "CH",
              "city": "Neuchatel",
              "address": "Rue des Fahrys 2"
            }
          },
          "timestamp_created": "2019-01-24T13:14:07.368Z",
          "timestamp_cancelled": "2019-01-25T01:06:11.632Z",
          "legacy_status": "CANC"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful operation. Inline

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    » orders [Order] true none none
    »» id string true none Unique identifier of the order.
    »» timestamp_awaiting_payment_since string(date-time) false none Date and time at which the order became executable and at which the payment information was made available.
    »» timestamp_cancelled string(date-time) false none Date and time at which the order was cancelled.
    »» timestamp_created string(date-time) true none Date and time at which the client submitted the initial information regarding this order.
    »» timestamp_executed string(date-time) false none Date and time at which the output amount was sent.
    »» timestamp_payment_received string(date-time) false none Date and time at which the input amount is confirmed to have been received.
    »» timestamp_price_guaranteed string(date-time) false none When present, the price is locked until the current time exceeds that particular timestamp. If the payment of the appropriate input amount is received before the indicated time, then the currently shown output amount will be sent. If the payment is received at a later time, execution of the order will use the market price instead. When absent, indicates that the price has not been locked yet.
    »» input OrderInputOutput true none none
    »»» currency CurrencyCode true none none
    »»» amount string false none none
    »»» type OrderInputOutputType false none none
    »»» crypto_address string false none Only valid if type is crypto_address.
    »»» iban string false none Only valid if type is bank_account.
    »»» bic_swift string false none Only valid if type is bank_account.
    »»» reference string false none Only valid if type is bank_account. It can only be present as output. The length and the set of supported characters varies depending on the banks and networks involved. To avoid producing the "invalid_bank_account_reference" error, keep the reference short (32 characters or less is recommended) and use only simple characters (using only characters in a-z, A-Z, 0-9 and space is recommended).
    »»» owner object false none Only valid if type is bank_account.
    »»»» name string false none none
    »»»» address string false none none
    »»»» address_complement string false none none
    »»»» zip string false none none
    »»»» city string false none none
    »»»» state string false none none
    »»»» country string false none Must contain the two-letter country code (ISO 3166-1 alpha-2).
    »»» message_to_sign MessageToSign false none A message to be signed. The signature must be sent in the body of a POST request to the URL specified by "signature_submission_url". This endpoint returns a 204 status code uppon submission of a valid signature. The message must be encoded as UTF-8 and the resulting sequence of bytes signed. Make sure to keep the message intact, including all white spaces. Use "eth_sign" with Ethereum addresses and "signmessage" with Bitcoin addresses. Keep the signature in the format provided by those calls (at the time of writing it is an hexadecimal string for Ethereum and base64 string for Bitcoin).
    »»»» body string true none none
    »»»» signature_submission_url string true none none
    »»» output OrderInputOutput true none none
    »»» payment_details object false none none
    »»»» type OrderInputOutputType false none none
    »»»» crypto_address string false none Only valid if type is crypto_address.
    »»»» account_number string false none none
    »»»» bank_address string false none none
    »»»» bank_code string false none none
    »»»» iban string false none none
    »»»» recipient string false none none
    »»»» swift_bic string false none none
    »»»» reference string false none The reference (also known as communication) that must be included in the payment.

    Enumerated Values

    Property Value
    type crypto_address
    type bank_account
    type crypto_address
    type bank_account

    Get the details of an order

    Code samples

    GET https://exchange.api.bity.com/v2/orders/{order_uuid} HTTP/1.1
    Host: exchange.api.bity.com
    Accept: application/json
    
    
    curl -X GET https://exchange.api.bity.com/v2/orders/{order_uuid} \
      -H 'Accept: application/json'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://exchange.api.bity.com/v2/orders/{order_uuid}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Accept': 'application/json'
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/orders/{order_uuid}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/orders/{order_uuid}',
    {
      method: 'GET',
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://exchange.api.bity.com/v2/orders/{order_uuid}',
        params={},
    
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://exchange.api.bity.com/v2/orders/{order_uuid}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /orders/{order_uuid}

    Please note the following:

    If the amount paid is not exactly the input amount, we can be required to cancel the order, or the output amount will be adjusted and extra fees could be charged.
    If it is sent in multiple transactions, we can be required to cancel the order and extra processing fees could be charged.

    Minimal details

    When the request does not include sufficient credentials, only minimal information is returned. If you are unexpectedly receiving only minimal details, please make sure you are making all the requests to the correct URLs and that cookies are accepted and handled according to RFC 6265. Most user agents handle that for you but cookies must not be disabled and you may have to request the user-agent to include credentials in the request.

    Output address signature

    When the customer is not authenticated or has not gone through the KYC process, crypto-to-crypto and fiat-to-crypto orders require the signature of a message by the output address for the order to become executable. When such a signature is required "message_to_sign" is included in the response. The price will not be fixed and the payment details will not be provided before the signature of the message is submitted.

    Input and output objects

    The input type and output type can be one of "crypto_address" or "bank_account".
    In case it is "crypto_address" the object additionally contains "crypto_address".
    In case it is "bank_account" the object additionally contains "iban".
    Whenever the input object contains iban or crypto_address, the input must be paid from the corresponding object. If this is not the case, we can be required to cancel the order and perform a refund uppon reception of the funds and extra fees can be charged.

    Payment details

    This object describes how to pay the input amount. There are two different possible types of payment details: "crypto_address" and "bank_account". Both types are described bellow. The amount and the associated currency is found in the input object.

    Crypto address

    When the payment must be made to a crypto address, the type is "crypto_address" and the address to use as a destination address is found in the "crypto_address" attribute.

    Bank account

    When the payment must be made to a bank account, the type is "bank_account". In most cases the banks involved in sending, transmitting and receiving the payment will require the IBAN, SWIFT code and the bank account owner name and address to process the payment. This is reflected by the information provided in the response:


    Parameters

    Name In Type Required Description
    order_uuid path string true ID of the order.

    Example responses

    200 Response

    {
      "id": "209a6210-4ea3-43e4-ba92-73aac60fb10c",
      "payment_details": {
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "input": {
        "currency": "ETH",
        "amount": "0.5",
        "type": "crypto_address",
        "crypto_address": "0x24305d091f79ee490a34de080b0db5773be5bef4"
      },
      "output": {
        "currency": "CHF",
        "amount": "104.95",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "BCNNCH22",
        "owner": {
          "name": "John Doe",
          "country": "CH",
          "city": "Neuchatel",
          "address": "Rue des Fahrys 2"
        }
      },
      "timestamp_created": "2019-01-24T13:14:07.368Z",
      "timestamp_cancelled": "2019-01-25T01:06:11.632Z",
      "legacy_status": "CANC"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Order successfully retrieved. Inline
    400 Bad Request Order with such ID not found. None

    Response Schema

    Enumerated Values

    Property Value
    type crypto_address
    type bank_account
    type crypto_address
    type bank_account

    Sign proof of wallet ownership message

    Code samples

    POST https://exchange.api.bity.com/v2/orders/{order_uuid}/signature HTTP/1.1
    Host: exchange.api.bity.com
    Content-Type: */*
    
    
    curl -X POST https://exchange.api.bity.com/v2/orders/{order_uuid}/signature \
      -H 'Content-Type: */*' \
      --data '0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"*/*"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://exchange.api.bity.com/v2/orders/{order_uuid}/signature", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Content-Type': '*/*'
    };
    
    var inputBody = 0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7;
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/orders/{order_uuid}/signature',
      method: 'post',
      data: JSON.stringify(inputBody),
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = 0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7;
    const headers = {
      'Content-Type': '*/*'
    };
    
    fetch('https://exchange.api.bity.com/v2/orders/{order_uuid}/signature',
    {
      method: 'POST',
      body: JSON.stringify(inputBody),
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Content-Type': '*/*'
    }
    data = 0x7709bc9c45926cc4d9791d868ad6c81883b624db44fbae1e62c0e6cc6c19784b74eb7
    
    r = requests.post('https://exchange.api.bity.com/v2/orders/{order_uuid}/signature',
        params={},
        data=json.dumps(data),
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => '*/*'
    }
    
    result = RestClient.post 'https://exchange.api.bity.com/v2/orders/{order_uuid}/signature',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /orders/{order_uuid}/signature

    Submit the signature of the message provided in the order details. Do not build the URL of this endpoint but instead use the value of signature_submission_url included along the message to be signed in the order details. The body of the request must contain the signature of the message.

    Body parameter

    Example of message signed with an Ethereum address.

    Parameters

    Name In Type Required Description
    order_uuid path string true ID of the order.

    Responses

    Status Meaning Description Schema
    204 No Content The signature is correct and the order has been executed. None
    400 Bad Request The signature is invalid. None
    404 Not Found The associated order could not be found or there is no message to sign. None
    502 Bad Gateway Internal error. None
    503 Service Unavailable Internal error. None
    504 Gateway Time-out Internal error. None

    Currencies

    List currencies

    Code samples

    GET https://exchange.api.bity.com/v2/currencies HTTP/1.1
    Host: exchange.api.bity.com
    Accept: application/json
    
    
    curl -X GET https://exchange.api.bity.com/v2/currencies \
      -H 'Accept: application/json'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://exchange.api.bity.com/v2/currencies", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Accept': 'application/json'
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/currencies',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/currencies',
    {
      method: 'GET',
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://exchange.api.bity.com/v2/currencies',
        params={},
    
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://exchange.api.bity.com/v2/currencies',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /currencies

    Parameters

    Name In Type Required Description
    tags query array[string] false Comma-separated list of tags. Currencies that contain all tags will be filtered.

    Enumerated Values

    Parameter Value
    tags crypto
    tags erc20
    tags ethereum
    tags fiat

    Example responses

    List currencies without any filter.

    {
      "currencies": [
        {
          "code": "BTC",
          "tags": [
            "crypto"
          ]
        },
        {
          "code": "CHF",
          "tags": [
            "fiat"
          ]
        },
        {
          "code": "ETH",
          "tags": [
            "crypto",
            "ethereum"
          ]
        },
        {
          "code": "EUR",
          "tags": [
            "fiat"
          ]
        },
        {
          "code": "REP",
          "tags": [
            "crypto",
            "ethereum",
            "erc20"
          ]
        }
      ]
    }
    

    List currencies filtering by "fiat".

    [
      {
        "code": "CHF",
        "tags": [
          "fiat"
        ]
      },
      {
        "code": "EUR",
        "tags": [
          "fiat"
        ]
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK Successful operation Inline

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    » currencies [CurrencyDetails] true none none
    »» code CurrencyCode true none none
    »» tags [CurrencyTag] true none none

    Get a single currency

    Code samples

    GET https://exchange.api.bity.com/v2/currencies/{currency_code} HTTP/1.1
    Host: exchange.api.bity.com
    Accept: application/json
    
    
    curl -X GET https://exchange.api.bity.com/v2/currencies/{currency_code} \
      -H 'Accept: application/json'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://exchange.api.bity.com/v2/currencies/{currency_code}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Accept': 'application/json'
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/currencies/{currency_code}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/currencies/{currency_code}',
    {
      method: 'GET',
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://exchange.api.bity.com/v2/currencies/{currency_code}',
        params={},
    
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://exchange.api.bity.com/v2/currencies/{currency_code}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /currencies/{currency_code}

    Parameters

    Name In Type Required Description
    currency_code path CurrencyCode true none

    Example responses

    200 Response

    {
      "code": "ETH",
      "tags": [
        "crypto",
        "ethereum"
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful operation CurrencyDetails
    404 Not Found Currency not found or unsupported None

    List currency pairs

    Code samples

    GET https://exchange.api.bity.com/v2/pairs HTTP/1.1
    Host: exchange.api.bity.com
    Accept: application/json
    
    
    curl -X GET https://exchange.api.bity.com/v2/pairs \
      -H 'Accept: application/json'
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://exchange.api.bity.com/v2/pairs", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    var headers = {
      'Accept': 'application/json'
    };
    
    $.ajax({
      url: 'https://exchange.api.bity.com/v2/pairs',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept': 'application/json'
    };
    
    fetch('https://exchange.api.bity.com/v2/pairs',
    {
      method: 'GET',
      headers: headers
    }).then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import json
    import requests
    
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://exchange.api.bity.com/v2/pairs',
        params={},
    
        headers=headers)
    
    print(r.json())
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://exchange.api.bity.com/v2/pairs',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /pairs

    Gets a list of all the currency pairs that can be traded through the Bity platform.

    Parameters

    Name In Type Required Description
    input query string false Retrieve all pairs for given input currency code. This parameter can be repeated several times to match many input currencies.
    output query string false Retrieve all pairs for given output currency code. This parameter can be repeated several times to match many output currencies.
    enabled query string false Retrieve all pairs that are enabled for trading or not.

    Example responses

    List currency pairs without any filter.

    {
      "pairs": [
        {
          "input": "BTC",
          "output": "CHF",
          "enabled": true
        },
        {
          "input": "CHF",
          "output": "BTC",
          "enabled": true
        },
        {
          "input": "ETH",
          "output": "REP",
          "enabled": true
        },
        {
          "input": "EUR",
          "output": "ETH",
          "enabled": true
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful operation Inline

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    » pairs [CurrencyPair] true none none
    »» input CurrencyCode true none none
    »» output CurrencyCode true none none
    »» enabled boolean true none none

    Schemas

    CurrencyDetails

    {
      "code": "ETH",
      "tags": [
        "crypto",
        "ethereum"
      ]
    }
    
    

    Properties

    Name Type Required Restrictions Description
    code CurrencyCode true none none
    tags [CurrencyTag] true none none

    AmountEstimationRequestInputOutput

    {
      "amount": "string",
      "currency": "BTC"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    amount string false none none
    currency CurrencyCode true none none

    AmountEstimationInput

    {
      "amount": "0.1",
      "minimum_amount": "0.01",
      "currency": "BTC"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    amount string false none none
    currency CurrencyCode true none none
    object_information_optional boolean false none When true, indicates that it is not required to provide information about the object which is going to pay the order.
    minimum_amount string false none none

    AmountEstimationOutput

    {
      "amount": "0.1",
      "minimum_amount": "0.01",
      "currency": "BTC"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    amount string false none none
    currency CurrencyCode true none none
    minimum_amount string false none none

    CurrencyCode

    "BTC"
    
    

    Properties

    Name Type Required Restrictions Description
    anonymous string false none none

    CurrencyPair

    {
      "enabled": true,
      "input": "BTC",
      "output": "CHF"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    input CurrencyCode true none none
    output CurrencyCode true none none
    enabled boolean true none none

    CurrencyTag

    "crypto"
    
    

    Properties

    Name Type Required Restrictions Description
    anonymous string false none none

    Enumerated Values

    Property Value
    anonymous crypto
    anonymous erc20
    anonymous ethereum
    anonymous fiat

    MessageToSign

    {
      "body": "string",
      "signature_submission_url": "string"
    }
    
    

    A message to be signed. The signature must be sent in the body of a POST request to the URL specified by "signature_submission_url". This endpoint returns a 204 status code uppon submission of a valid signature. The message must be encoded as UTF-8 and the resulting sequence of bytes signed. Make sure to keep the message intact, including all white spaces. Use "eth_sign" with Ethereum addresses and "signmessage" with Bitcoin addresses. Keep the signature in the format provided by those calls (at the time of writing it is an hexadecimal string for Ethereum and base64 string for Bitcoin).

    Properties

    Name Type Required Restrictions Description
    body string true none none
    signature_submission_url string true none none

    OrderMinimal

    {
      "id": "f4e05c68-8a70-4678-b97c-ea30dc0daaa3",
      "timestamp_created": "2019-02-01T10:00:00.000Z",
      "timestamp_awaiting_payment_since": "2019-02-01T10:02:00.000Z",
      "timestamp_price_guaranteed": "2020-02-01T10:12:00.000Z"
    }
    
    

    Minimal information of a previously placed order. This information can be retrieved without authentication.

    Properties

    Name Type Required Restrictions Description
    id string true none Unique identifier of the order.
    timestamp_awaiting_payment_since string(date-time) false none Date and time at which the order became executable and at which the payment information was made available.
    timestamp_cancelled string(date-time) false none Date and time at which the order was cancelled.
    timestamp_created string(date-time) true none Date and time at which the client submitted the initial information regarding this order.
    timestamp_executed string(date-time) false none Date and time at which the output amount was sent.
    timestamp_payment_received string(date-time) false none Date and time at which the input amount is confirmed to have been received.
    timestamp_price_guaranteed string(date-time) false none When present, the price is locked until the current time exceeds that particular timestamp. If the payment of the appropriate input amount is received before the indicated time, then the currently shown output amount will be sent. If the payment is received at a later time, execution of the order will use the market price instead. When absent, indicates that the price has not been locked yet.

    Order

    {
      "id": "209a6210-4ea3-43e4-ba92-73aac60fb10c",
      "payment_details": {
        "type": "crypto_address",
        "crypto_address": "0xf35074bbd0a9aee46f4ea137971feec024ab7048"
      },
      "input": {
        "currency": "ETH",
        "amount": "0.5",
        "type": "crypto_address",
        "crypto_address": "0x24305d091f79ee490a34de080b0db5773be5bef4"
      },
      "output": {
        "currency": "CHF",
        "amount": "104.95",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "BCNNCH22",
        "owner": {
          "name": "John Doe",
          "country": "CH",
          "city": "Neuchatel",
          "address": "Rue des Fahrys 2"
        }
      },
      "timestamp_created": "2019-01-24T13:14:07.368Z",
      "timestamp_cancelled": "2019-01-25T01:06:11.632Z",
      "legacy_status": "CANC"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    id string true none Unique identifier of the order.
    timestamp_awaiting_payment_since string(date-time) false none Date and time at which the order became executable and at which the payment information was made available.
    timestamp_cancelled string(date-time) false none Date and time at which the order was cancelled.
    timestamp_created string(date-time) true none Date and time at which the client submitted the initial information regarding this order.
    timestamp_executed string(date-time) false none Date and time at which the output amount was sent.
    timestamp_payment_received string(date-time) false none Date and time at which the input amount is confirmed to have been received.
    timestamp_price_guaranteed string(date-time) false none When present, the price is locked until the current time exceeds that particular timestamp. If the payment of the appropriate input amount is received before the indicated time, then the currently shown output amount will be sent. If the payment is received at a later time, execution of the order will use the market price instead. When absent, indicates that the price has not been locked yet.
    input OrderInputOutput true none none
    message_to_sign MessageToSign false none A message to be signed. The signature must be sent in the body of a POST request to the URL specified by "signature_submission_url". This endpoint returns a 204 status code uppon submission of a valid signature. The message must be encoded as UTF-8 and the resulting sequence of bytes signed. Make sure to keep the message intact, including all white spaces. Use "eth_sign" with Ethereum addresses and "signmessage" with Bitcoin addresses. Keep the signature in the format provided by those calls (at the time of writing it is an hexadecimal string for Ethereum and base64 string for Bitcoin).
    output OrderInputOutput true none none
    payment_details object false none none
    » type OrderInputOutputType false none none
    » crypto_address string false none Only valid if type is crypto_address.
    » account_number string false none none
    » bank_address string false none none
    » bank_code string false none none
    » iban string false none none
    » recipient string false none none
    » swift_bic string false none none
    » reference string false none The reference (also known as communication) that must be included in the payment.

    OrderInputOutput

    {
      "input": {
        "currency": "ETH",
        "amount": "0.5",
        "type": "crypto_address",
        "crypto_address": "0x24305d091f79ee490a34de080b0db5773be5bef4"
      },
      "output": {
        "currency": "CHF",
        "amount": "104.95",
        "type": "bank_account",
        "iban": "CH3600000000000000000",
        "bic_swift": "XXXXCHXXXXX"
      }
    }
    
    

    Properties

    Name Type Required Restrictions Description
    currency CurrencyCode true none none
    amount string false none none
    type OrderInputOutputType false none none
    crypto_address string false none Only valid if type is crypto_address.
    iban string false none Only valid if type is bank_account.
    bic_swift string false none Only valid if type is bank_account.
    reference string false none Only valid if type is bank_account. It can only be present as output. The length and the set of supported characters varies depending on the banks and networks involved. To avoid producing the "invalid_bank_account_reference" error, keep the reference short (32 characters or less is recommended) and use only simple characters (using only characters in a-z, A-Z, 0-9 and space is recommended).
    owner object false none Only valid if type is bank_account.
    » name string false none none
    » address string false none none
    » address_complement string false none none
    » zip string false none none
    » city string false none none
    » state string false none none
    » country string false none Must contain the two-letter country code (ISO 3166-1 alpha-2).

    OrderInputOutputType

    "crypto_address"
    
    

    Properties

    Name Type Required Restrictions Description
    anonymous string false none none

    Enumerated Values

    Property Value
    anonymous crypto_address
    anonymous bank_account