POST api/v1/secondarymarket/buy
Buy loans from secondary market.
Requires authorization!
Requires scope SmBuy
Response Codes
202
– Successfully accepted buy request.400
– No items specified400
– Too many items. Max items 100401
– User is not Authorized403
– User has no rights404
– Not found409
– Investment cannot be bought
Request Information
URI Parameters
None.
Body Parameters
SecondMarketBuyRequestName | Description | Type | Additional information |
---|---|---|---|
ItemIds |
Secondary market item ids to buy |
Collection of globally unique identifier |
None. |
Request Formats
application/json, text/json
Sample:
{ "ItemIds": [ "524a383e-19db-4559-a667-11a9e359b787", "a84122fc-f201-4825-9119-ac0cb58d8a80" ] }
application/xml, text/xml
Sample:
<SecondMarketBuyRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Sobralaen.Api.Models"> <ItemIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:guid>524a383e-19db-4559-a667-11a9e359b787</d2p1:guid> <d2p1:guid>a84122fc-f201-4825-9119-ac0cb58d8a80</d2p1:guid> </ItemIds> </SecondMarketBuyRequest>
application/x-www-form-urlencoded
Sample:
ItemIds[0]=524a383e-19db-4559-a667-11a9e359b787&ItemIds[1]=a84122fc-f201-4825-9119-ac0cb58d8a80
Response Information
Resource Description
Buy loans from secondary market.
ApiResultName | Description | Type | Additional information |
---|---|---|---|
Success |
Indicates if the request was successfull or not.
|
boolean |
Required |
Errors |
Error(s) accociated with the API request. |
Collection of ApiError |
None. |
Response Formats
application/json, text/json
Sample:
{ "Success": true, "Errors": [ { "Code": 1, "Message": "sample string-2", "Details": "sample string-3" }, { "Code": 1, "Message": "sample string-2", "Details": "sample string-3" } ] }
application/xml, text/xml
Sample:
<ApiResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Sobralaen.Api.Models"> <Errors> <ApiError> <Code>1</Code> <Details>sample string-3</Details> <Message>sample string-2</Message> </ApiError> <ApiError> <Code>1</Code> <Details>sample string-3</Details> <Message>sample string-2</Message> </ApiError> </Errors> <Success>true</Success> </ApiResult>