Link

EOTC

  1. Request available pairs

     + GET /platform/pairs?eotc=true
        
     + Response 200 OK
       {
         "currenciesPairs": [
           {
             "baseCurrency": "BTC",
             "quoteCurrency": "USD"
           },
           {
             "baseCurrency": "BTC",
             "quoteCurrency": "USDT"
           }
         ]
       } 
    
  2. Request price

     + POST /platform/offers
        
     + Request
       {
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",   // your portfolioId you want to trade with
         "limitType": "eotc",
         "orderType": "buy",     // buy or sell
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "amount": "0.01"
       } 
       
     + Response 201 Created
       {
         "offerId": "8822",
         "status": "new",
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",   
         "limitType": "eotc",
         "orderType": "buy",  
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "amount": "0.01"
       }
    
  3. Check price

    You should periodically ask for offer price until “price” appears

     + GET /platform/offers/{offerId}
        
     + Response 200 OK
       {
         "offerId": "8822",
         "status": "working",    // may be "new", "waiting", "working" and "canceled"
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",   
         "limitType": "eotc",
         "orderType": "buy",  
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "amount": "0.01",
         "price": "10567.6789",
         "expiredAt": "1595916853000"   // expiration time, timestamp in millis
       } 
    
  4. Create order

    When offers price is received, you can trade it

     + POST /platform/orders
        
     + Request
       {
         "externalOrderId": "F7FCCFD3-B61B-4467-B456-B0FC27CE4494",       // uniq external order id, UUID for example
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",
         "limitType": "eotc",
         "orderType": "buy",
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "amount": "0.01",    // should be equal current offer amount
         "offerId": "8822",      // {offerId} from request described above
         "priceLimit": "10567.6789"    // should be equal current offer price
       }    
       
     + Response 201 Created
       {
         "orderId": "35981617",
         "externalOrderId": "F7FCCFD3-B61B-4467-B456-B0FC27CE4494",
         "status": "working",
         "orderType": "buy",
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",
         ...
       }