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"
       }
    

    Request price by quote amount

     + POST /platform/offers
        
     + Request
       {
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah", 
         "limitType": "eotc",
         "orderType": "buy",   
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "quoteAmount": "1000"
       }
       
     + Response 201 Created
       {
         "offerId": "8822",
         "status": "new",
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",   
         "limitType": "eotc",
         "orderType": "buy",  
         "baseCurrency": "BTC",
         "quoteCurrency": "USD",
         "quoteAmount": "1000"
       }
    
  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.029790561",
         "quoteAmount": "1000",
         "price": "33567.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",
         "offerId": "8822",
         "amount": "0.029790561",   // need to specify "amount" or "quoteAmount", depends of offer
         "quoteAmount": "1000",
         "priceLimit": "33567.6789"    
       }    
       
     + Response 201 Created
       {
         "orderId": "35981617",
         "externalOrderId": "F7FCCFD3-B61B-4467-B456-B0FC27CE4494",
         "status": "working",
         "orderType": "buy",
         "portfolioId": "oishiphoosaipho9ooTikohk5foo4Wah",
         ...
       }