# BuyInContract

PATH: /aurora.core.apiengine.contractsv1.ContractService/BuyInContract

  ### Buying-In Against Recalled Contracts
Where a lender has requested a recall of a contract, but the borrower has not returned the shares before the
allowed_execution_date indicated on the Contract Recall, the lender may buy-in the shares against the borrower.

Aurora acts as a gateway to capture the purchase price and quantity of this buy-in, allowing the lender to reclaim
the costs of the buy-in against the borrower, and adjusting the contract records within Aurora and downstream clearing and settlement.
The lender may submit the execution price and quantity of shares by submitting this message.

Note that buy-ins are allocated against outstanding recalls for the indicated contract on a first-in-first-out basis,
and therefore a contract_recall_id is not supported in this message.

The submitted buy-in details must be processed by DTC before updating outstanding contracts and recall request(s)
within Aurora.

Endpoint: POST /aurora.core.apiengine.contractsv1.ContractService/BuyInContract
Version: v1.23.0
Security: Bearer

## Request fields (application/json):

  - `avg_price_per_share` (string, required)
    Average price per share for buy-in

  - `id` (string, required)
    Contract identifier (persistent contract identifier inside Aurora system)

  - `quantity` (string, required)
    Amount of shares to buy-in

  - `request_id` (string)
    An optional identifier provided by the user to help associate the order request any internal record keeping.
If the same value is observed recently then the request will be rejected.

## Response 200 fields (application/json):

  - `buyin` (object, required)
    Fields: id, contract_id, quantity, price, status

  - `buyin.contract_id` (string, required)
    Contract identifier (persistent identifier inside Aurora system)

  - `buyin.id` (string, required)
    Buy-in identifier (persistent identifier inside Aurora system for the return)

  - `buyin.price` (string, required)
    Average price of the shares bought-in

  - `buyin.quantity` (string, required)
    Amount of shares being bought-in

  - `buyin.status` (string, required)
    ContractBuyInStatus : the state a Buy-In is in now
    Enum: "PENDING", "ACCEPTED", "REJECTED"


