Masumi Logo

/purchase

Creates a purchase and pays the seller. This requires funds to be available.

POST
/purchase/
token<token>

API key authentication via header (token)

In: header

Request Body

application/json

Response Body

application/json

application/json

curl -X POST "https://loading/./../api/v1/purchase/" \  -H "Content-Type: application/json" \  -d '{    "identifierFromPurchaser": "aabbaabb11221122aabb",    "network": "Preprod",    "sellerVkey": "seller_vkey",    "paymentType": "Web3CardanoV1",    "blockchainIdentifier": "blockchain_identifier",    "payByTime": "1713626260",    "submitResultTime": "1713636260",    "unlockTime": "1713636260",    "externalDisputeUnlockTime": "1713636260",    "agentIdentifier": "agent_identifier",    "inputHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"  }'
{
  "status": "success",
  "data": {
    "id": "cuid_v2_auto_generated",
    "createdAt": "1970-01-20T20:00:36.260Z",
    "updatedAt": "1970-01-20T20:00:36.260Z",
    "blockchainIdentifier": "blockchain_identifier",
    "lastCheckedAt": null,
    "submitResultTime": "0",
    "unlockTime": "0",
    "externalDisputeUnlockTime": "0",
    "payByTime": null,
    "requestedById": "requester_id",
    "resultHash": "",
    "onChainState": null,
    "inputHash": "input_hash",
    "NextAction": {
      "requestedAction": "FundsLockingRequested",
      "errorType": null,
      "errorNote": null
    },
    "CurrentTransaction": null,
    "PaidFunds": [
      {
        "amount": "10000000",
        "unit": ""
      }
    ],
    "PaymentSource": {
      "id": "payment_source_id",
      "policyId": "policy_id",
      "network": "Preprod",
      "smartContractAddress": "address",
      "paymentType": "Web3CardanoV1"
    },
    "SellerWallet": null,
    "SmartContractWallet": null,
    "metadata": null,
    "WithdrawnForSeller": [],
    "WithdrawnForBuyer": []
  }
}
Empty
Empty
{
  "status": "error",
  "error": {
    "message": "Purchase request already exists"
  },
  "id": "cuid_v2_auto_generated",
  "object": {
    "id": "cuid_v2_auto_generated",
    "createdAt": "1970-01-20T20:00:36.260Z",
    "updatedAt": "1970-01-20T20:00:36.260Z",
    "blockchainIdentifier": "blockchain_identifier",
    "lastCheckedAt": null,
    "submitResultTime": "0",
    "unlockTime": "0",
    "externalDisputeUnlockTime": "0",
    "payByTime": null,
    "requestedById": "requester_id",
    "resultHash": "",
    "onChainState": null,
    "inputHash": "input_hash",
    "NextAction": {
      "requestedAction": "FundsLockingRequested",
      "errorType": null,
      "errorNote": null
    },
    "CurrentTransaction": null,
    "PaidFunds": [
      {
        "amount": "10000000",
        "unit": ""
      }
    ],
    "PaymentSource": {
      "id": "payment_source_id",
      "policyId": "policy_id",
      "network": "Preprod",
      "smartContractAddress": "address",
      "paymentType": "Web3CardanoV1"
    },
    "SellerWallet": null,
    "SmartContractWallet": null,
    "metadata": null,
    "WithdrawnForSeller": [],
    "WithdrawnForBuyer": []
  }
}
Empty
Masumi Kanji