Create a fulfillment for an offer

Endpoint to create a fulfillment from an offer. A fulfillment can be a PURCHASE (when buying 1 or more items from the offer) or a REIMBURSEMENT (when returning items to the seller).

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

Request Body

NameTypeDescription

offerId*

String

The offer ID

amount

String

Amount to be bought / reimbursed

type*

String

PURCHASE or REIMBURSEMENT

userId*

String

The user buying or being reimbursed

externalUserId

String

External User Id (only for PURCHASE)

walletAddress

String

Buyer wallet address (only for PURCHASE)

{
    // Response
}

Examples

* Create a purchase

A purchase can be created only if offer is in status READY and has remaining items

A purchase can only be created for an offer of type SALE (not for AUCTIONS).

A purchase goes firstly in status QUEUED, PROCESSING and then COMPLETED or ERROR if something went wrong.

You can supply an externalBuyerId when creating a fulfillment. Note that if you are buying open / public offers, the externalBuyerId will be visible to other parties. Please do not supply sensitive information in the externalBuyerId (like email address).

Request body

{
    "type": "PURCHASE",
    "offerId": "ba60a7b2-a360-4f88-accc-bd048aac889d",
    "userId": "7c344b6c-2a05-4597-95ce-9b48e07f8e50",
    "externalUserId": "00u2vuh033UE8uC8Y4x7",
    "walletAddress": "0x39069fb544c7e25122b8a54cd7b982d34d11e470",
    "amount": 10
}

Response body

{
    "id": "45c9efd6-720d-7951-cf48-e5fc79aa394d",
    "type": "PURCHASE",
    "offerId": "ba60a7b2-a360-4f88-accc-bd048aac889d",
    "amount": 10,
    "status": "QUEUED",
    "creationDate": "2021-04-16T07:21:31.625947",
    "pricePerItem": 1,
    "buyerId": "7c344b6c-2a05-4597-95ce-9b48e07f8e50",
    "buyer": {
        "id": "7c344b6c-2a05-4597-95ce-9b48e07f8e50",
        "nickname": "Gaiming Market"
    },
    "externalBuyerId": "00u2vuh033UE8uC8Y4x7",
    "buyerWalletAddress": "0x39069fb544c7e25122b8a54cd7b982d34d11e470"
}

Last updated