Buy an offer

Endpoint to buy a certain offer

To buy an offer: use POST /fulfillments with type=PURCHASE

Buy an offer

POST https://api.venly.market/fulfillments

Request Body

NameTypeDescription

type*

String

PURCHASE or REIMBURSEMENT

offerId*

String

The Offer being bought

amount*

String

The amount of items being bought (should be equal or less than Offer.amount)

walletAddress

String

(optional) Address to where the bought NFT should be send

userId

String

id of the sub-user buying the Offer

Example

Request

POST https://api.venly.market/fulfillments

Request Body (when buying for yourself)

You need to specify the walletAddress to where the NFT needs to be send.

{
  "type": "PURCHASE",
  "offerId": "83f9abd1-e82e-4ee1-93b2-d0370f833e6f",
  "amount": "1",
  "walletAddress": "0xc0ffee254729296a45a3885639AC7E10F9d54979"
}

Request Body (when buying on behalf of your sub-user)

You can specify a sub-user-id, when you want to register a sale for a sub-user (see creating a sub-user). The NFT will be send to the specified wallet-address.

{
  "type": "PURCHASE",
  "offerId": "83f9abd1-e82e-4ee1-93b2-d0370f833e6f",
  "amount": "1",
  "walletAddress": "0xc0ffee254729296a45a3885639AC7E10F9d54979",
  "userId": "d6805fe3-ec41-4241-a510-5cb418f7bc3c"
}

Response

{
  "success": true,
  "result": {
    "id": "dcba3a7c-0e41-46a9-bd97-7eb59746f94e",
    "type": "PURCHASE",
    "offerId": "83f9abd1-e82e-4ee1-93b2-d0370f833e6f",
    "amount": 1,
    "status": "QUEUED",
    "creationDate": "2022-04-20T13:26:58.809242",
    "pricePerItem": 50,
    "buyer": {
      "id": "e38336b6-3307-4737-bf82-3a3a39269147",
      "nickname": "Pieter",
      "email": "pieter.hens@arkane.network"
    }
  }
}

Last updated