Create a new purchase request and pay. (access required +PAY)
Changed onCreates a purchase and pays the seller. This requires funds to be available.
Request
- Base URL: ./../api/v1/ (relative, and the document was published on a file host, not at the API’s origin)
- URL: ./../api/v1/purchase
- Auth: API key in header token
Request body
Example request
{
"identifierFromPurchaser": "aabbaabb11221122aabb",
"network": "Preprod",
"sellerVkey": "seller_vkey",
"blockchainIdentifier": "blockchain_identifier",
"payByTime": "1713626260",
"submitResultTime": "1713636260",
"unlockTime": "1713636260",
"externalDisputeUnlockTime": "1713636260",
"agentIdentifier": "agent_identifier",
"inputHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}Response
Purchase request created
Example response
{
"status": "Success",
"data": {
"id": "cuid_v2_auto_generated",
"blockchainIdentifier": "blockchain_identifier",
"agentIdentifier": "agent_identifier",
"agentName": "Example Agent",
"pricingType": "Fixed",
"createdAt": "1970-01-20T20:00:36.260Z",
"updatedAt": "1970-01-20T20:00:36.260Z",
"lastCheckedAt": null,
"payByTime": null,
"submitResultTime": "0",
"unlockTime": "0",
"externalDisputeUnlockTime": "0",
"requestedById": "requester_id",
"onChainState": null,
"forceLayer": null,
"paymentForceLayer": null,
"collateralReturnLovelace": null,
"buyerReturnAddress": null,
"sellerReturnAddress": null,
"cooldownTime": 0,
"cooldownTimeOtherParty": 0,
"inputHash": "input_hash",
"resultHash": null,
"NextAction": {
"requestedAction": "FundsLockingRequested",
"errorType": null,
"errorNote": null
},
"CurrentTransaction": null,
"PaidFunds": [
{
"unit": "",
"amount": "10000000"
}
],
"PaymentSource": {
"id": "payment_source_id",
"policyId": "policy_id",
"network": "Preprod",
"paymentSourceType": "Web3CardanoV1",
"smartContractAddress": "address"
},
"SellerWallet": null,
"SmartContractWallet": null,
"metadata": null,
"WithdrawnForSeller": [],
"WithdrawnForBuyer": [],
"totalBuyerCardanoFees": 0,
"totalSellerCardanoFees": 0,
"nextActionOrOnChainStateOrResultLastChangedAt": "1970-01-20T20:00:36.260Z",
"nextActionLastChangedAt": "1970-01-20T20:00:36.260Z",
"onChainStateOrResultLastChangedAt": "1970-01-20T20:00:36.260Z"
}
}Changes
- breaking
the
//request property's maxLength was decreased to19 - breaking
added the pattern
^\d+$to the request property// - breaking
added the pattern
^\d+$to the request property - breaking
added the pattern
^\d+$to the request property - breaking
added the pattern
^\d+$to the request property - breaking
added the pattern
^\d+$to the request property - warning
the
request property's maxLength was set to19 - warning
the
request property's maxLength was set to19 - warning
the
request property's maxLength was set to19 - warning
the
request property's maxLength was set to19 - info
added the new optional request property
- info
added the new optional request property
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the required property
/to the response with the status - info
added the required property
/to the response with the status - info
added the required property
/to the response with the status - info
added the required property
/to the response with the status
- breaking
- breaking
removed the required property
/from the response with the status - breaking
removed the required property
/from the response with the status - breaking
removed the required property
/from the response with the status - breaking
removed the required property
/from the response with the status - warning
removed the request property
- warning
removed the request property
- warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - warning
removed the optional property
//from the response with the status - info
the
//request property's maxLength was increased from19to25 - info
removed the pattern
^\d+$from the request property// - info
removed the pattern
^\d+$from the request property - info
removed the pattern
^\d+$from the request property - info
removed the pattern
^\d+$from the request property - info
removed the pattern
^\d+$from the request property
- breaking