https://developers.coinbase.com/api/v2#create-a-new-order-for-a-checkout
776290
def create_checkout_order(self, checkout_id, **params):
        """"""
        response = self._post('v2', 'checkouts', checkout_id, 'orders', data=params)
        return self._make_api_object(response, Order)
21004
private boolean placeOrderOrderOnAPI(final BitfinexNewOrder order) throws Exception {
		final CountDownLatch waitLatch = new CountDownLatch(1);

		final Consumer<BitfinexSubmittedOrder> ordercallback = (o) -> {
			if(Objects.equals(o.getClientId(), order.getClientId())) {
				waitLatch.countDown();
			}
		}
584289
def order_book(self, group=True, base="btc", quote="usd"):
        
        params = {'group': group}
        url = self._construct_url("order_book/", base, quote)
        return self._get(url, params=params, return_json=True, version=2)
1119340
def createStopOrder(self, quantity, parentId=0, stop=0., trail=None,
            transmit=True, group=None, stop_limit=False, rth=False, tif="DAY",
            account=None):

        
        if trail:
            if trail == "percent":
                order = self.createOrder(quantity,
                            trailingPercent = stop,
                            transmit  = transmit,
                            orderType = dataTypes["ORDER_TYPE_TRAIL_STOP"],
                            ocaGroup  = group,
                            parentId  = parentId,
                            rth       = rth,
                            tif       = tif,
                            account   = account
                        )
            else:
                order = self.createOrder(quantity,
                            trailStopPrice = stop,
                            stop      = stop,
                            transmit  = transmit,
                            orderType = dataTypes["ORDER_TYPE_TRAIL_STOP"],
                            ocaGroup  = group,
                            parentId  = parentId,
                            rth       = rth,
                            tif       = tif,
                            account   = account
                        )

        else:
            order = self.createOrder(quantity,
                        stop      = stop,
                        price     = stop if stop_limit else 0.,
                        transmit  = transmit,
                        orderType = dataTypes["ORDER_TYPE_STOP_LIMIT"] if stop_limit else dataTypes["ORDER_TYPE_STOP"],
                        ocaGroup  = group,
                        parentId  = parentId,
                        rth       = rth,
                        tif       = tif,
                        account   = account
                    )
        return order
491231
def create_checkout(self, **params):
        """"""
        for required in ['amount', 'currency', 'name']:
            if required not in params:
                raise ValueError("Missing required parameter: %s" % required)
        response = self._post('v2', 'checkouts', data=params)
        return self._make_api_object(response, Checkout)
759957
def new
      @order = Effective::Order.new

      if params[:user_id]
        @order.user = User.where(id: params[:user_id]).first
      end

      if params[:duplicate_id]
        @duplicate = Effective::Order.deep.find(params[:duplicate_id])
        EffectiveOrders.authorize!(self, :show, @duplicate)

        @order.add(@duplicate)
      end

      @page_title = 'New Order'

      raise 'please install cocoon gem to use this page' unless defined?(Cocoon)

      authorize_effective_order!
    end
313532
private Order create(
            final String number,
            final String customerName,
            final LocalDate date,
            final String preferences,
            final ExecutionContext executionContext) {
        return executionContext.add(this, orders.create(number, customerName, date, preferences));
    }
764804
private static Object adaptOrder(Order order) {
    OrderCreateApiRequest.OrderCreateApiRequestBuilder request = OrderCreateApiRequest.builder();
    boolean hasClientId = false;
    for (IOrderFlags flag : order.getOrderFlags()) {
      if (flag instanceof KucoinOrderFlags) {
        request.clientOid(((KucoinOrderFlags) flag).getClientId());
        hasClientId = true;
      } else if (flag instanceof TimeInForce) {
        request.timeInForce(((TimeInForce) flag).name());
      }
    }
    if (!hasClientId) {
      request.clientOid(UUID.randomUUID().toString());
    }
    return request
        .symbol(adaptCurrencyPair(order.getCurrencyPair()))
        .size(order.getOriginalAmount())
        .side(adaptSide(order.getType()));
  }
545795
function _doRefund($oID, $amount = 0) {
    global $db, $messageStack;
    $_POST['refamt'] = preg_replace('/[^0-9.%]/', '', $_POST['refamt']);
    $new_order_status = (int)MODULE_PAYMENT_LINKPOINT_API_REFUNDED_ORDER_STATUS_ID;
    if ($new_order_status == 0) $new_order_status = 1;
    $proceedToRefund = true;
    $refundNote = strip_tags(zen_db_input($_POST['refnote']));
    if (isset($_POST['refconfirm']) && $_POST['refconfirm'] != 'on') {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_REFUND_CONFIRM_ERROR, 'error');
      $proceedToRefund = false;
    }
    if (isset($_POST['buttonrefund']) && $_POST['buttonrefund'] == MODULE_PAYMENT_LINKPOINT_API_ENTRY_REFUND_BUTTON_TEXT) {
      $refundAmt = (float)$_POST['refamt'];
      $new_order_status = (int)MODULE_PAYMENT_LINKPOINT_API_REFUNDED_ORDER_STATUS_ID;
      if ($refundAmt == 0) {
        $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_INVALID_REFUND_AMOUNT, 'error');
        $proceedToRefund = false;
      }
    }
    if (isset($_POST['cc_number']) && (int)trim($_POST['cc_number']) == 0) {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_CC_NUM_REQUIRED_ERROR, 'error');
    }
    if (isset($_POST['trans_id']) && (int)trim($_POST['trans_id']) == 0) {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_TRANS_ID_REQUIRED_ERROR, 'error');
      $proceedToRefund = false;
    }

    $sql = "select lp_trans_num, transaction_time from " . TABLE_LINKPOINT_API . " where order_id = " . (int)$oID . " and transaction_result = 'APPROVED' order by transaction_time DESC";
    $query = $db->Execute($sql);
    if ($query->RecordCount() < 1) {
      $messageStack->add_session(MODULE_PAYMENT_LINKPOINT_API_TEXT_NO_MATCHING_ORDER_FOUND, 'error');
      $proceedToRefund = false;
    }
    /**
     * Submit refund request to gateway
     */
    if ($proceedToRefund) {
      unset($myorder);
      $myorder["ordertype"] = 'CREDIT';
      $myorder["oid"] = $query->fields['lp_trans_num'];
      if ($_POST['trans_id'] != '') $myorder["tdate"] = $_POST['trans_id'];
      $myorder["chargetotal"] = number_format($refundAmt, 2, '.', '');
      $myorder["comments"]  = htmlentities($refundNote, ENT_QUOTES, 'UTF-8');

      $result = $this->_sendRequest($myorder);
      $response_alert = $result['r_approved'] . ' ' . $result['r_error'] . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');
      $this->reportable_submit_data['Note'] = $refundNote;
      $failure = ($result["r_approved"] != "APPROVED");
      if ($failure) {
        $messageStack->add_session($response_alert, 'error');
      } else {
        // Success, so save the results
        $this->_updateOrderStatus($oID, $new_order_status, 'REFUND INITIATED. Order ID:' . $result['r_ordernum'] . ' - ' . 'Trans ID: ' . $result['r_tdate'] . "\n" . 'Amount: ' . $myorder["chargetotal"] . "\n" . $refundNote);
        $messageStack->add_session(sprintf(MODULE_PAYMENT_LINKPOINT_API_TEXT_REFUND_INITIATED, $result['r_tdate'], $result['r_ordernum']), 'success');
        return true;
      }
    }
    return false;
  }
318612
@RequestMapping(path = "", method = RequestMethod.POST)
    public ResponseEntity<Order> createOrder(@RequestBody OrderInfo orderInfo) {
        Order order = orderService.createOrder(orderInfo);
        if(order != null){
            return new ResponseEntity<Order>(order, HttpStatus.CREATED);
        }
        return new ResponseEntity<Order>(HttpStatus.BAD_REQUEST);
    }
945128
public static OrderBook adaptOrderBook(
      CryptopiaOrderBook cryptopiaOrderBook, CurrencyPair currencyPair) {
    List<LimitOrder> asks =
        createOrders(currencyPair, Order.OrderType.ASK, cryptopiaOrderBook.getAsks());
    List<LimitOrder> bids =
        createOrders(currencyPair, Order.OrderType.BID, cryptopiaOrderBook.getBids());

    return new OrderBook(new Date(), asks, bids);
  }
669376
public function create($orderIncrementId, $itemsQty = null, $comment = null, $email = null, $includeComment = null)
    {
        return $this->__createAction('order_shipment.create', func_get_args());
    }
96379
public static CryptonitGenericOrder adaptOrder(
      String orderId, CryptonitOrderStatusResponse cryptonitOrderStatusResponse) {

    CryptonitOrderTransaction[] cryptonitTransactions =
        cryptonitOrderStatusResponse.getTransactions();
    CurrencyPair currencyPair = null;
    Date date = null;
    BigDecimal averagePrice = null;
    BigDecimal cumulativeAmount = null;
    BigDecimal totalFee = null;
    // Use only the first transaction, because we assume that for a single order id all transactions
    // will
    // be of the same currency pair
    if (cryptonitTransactions.length > 0) {
      currencyPair = adaptCurrencyPair(cryptonitTransactions[0]);
      date = cryptonitTransactions[0].getDatetime();

      averagePrice =
          Arrays.stream(cryptonitTransactions)
              .map(t -> t.getPrice())
              .reduce((x, y) -> x.add(y))
              .get()
              .divide(BigDecimal.valueOf(cryptonitTransactions.length), 2);

      cumulativeAmount =
          Arrays.stream(cryptonitTransactions)
              .map(t -> getBaseCurrencyAmountFromCryptonitTransaction(t))
              .reduce((x, y) -> x.add(y))
              .get();

      totalFee =
          Arrays.stream(cryptonitTransactions)
              .map(t -> t.getFee())
              .reduce((x, y) -> x.add(y))
              .get();
    }

    OrderStatus orderStatus =
        adaptOrderStatus(cryptonitOrderStatusResponse.getStatus(), cryptonitTransactions.length);

    CryptonitGenericOrder cryptonitGenericOrder =
        new CryptonitGenericOrder(
            null, // not discernable from response data
            null, // not discernable from the data
            currencyPair,
            orderId,
            date,
            averagePrice,
            cumulativeAmount,
            totalFee,
            orderStatus);

    return cryptonitGenericOrder;
  }
128223
function get(uuid, callback) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var order_url = this.coinjar.merchant.orders_endpoint + '/',
    resource = this.coinjar.merchant.api_endpoint +
      '/v1/orders/' +
      uuid +
      '.json';

  request.get(resource)
    .auth(this.coinjar.merchant.uuid, this.coinjar.merchant.secret)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      // build the payment page url
      response.body.order.payment_page_url = order_url + response.body.order.uuid;
      return callback(null, response.body.order);
    });
}
152586
def send_margin_order(self, acc_id, amount, symbol, _type, price=0, _async=False):
        

        params = {
            'account-id': acc_id,
            'amount': amount,
            'symbol': symbol,
            'type': _type,
            'source': 'margin-api'
        }
        if price:
            params['price'] = price

        path = '/v1/order/orders/place'
        return api_key_post(params, path, _async=_async)
1138622
def get_checkouts(self, **params):
        """"""
        response = self._get('v2', 'checkouts', params=params)
        return self._make_api_object(response, Checkout)
402485
public static String makeMercadoBitcoinOrderId(CurrencyPair currencyPair, String orderId) {

    String pair;

    if (currencyPair.equals(CurrencyPair.BTC_BRL)) {
      pair = "btc_brl";
    } else if (currencyPair.equals(new CurrencyPair(Currency.LTC, Currency.BRL))) {
      pair = "ltc_brl";
    } else {
      throw new NotAvailableFromExchangeException();
    }

    return pair + ":" + orderId;
  }