Masumi Logo

/payment

Creates a payment request and identifier. This will check incoming payments in the background.

POST
/payment
token<token>

API key authentication via header (token)

In: header

inputHashstring

The hash of the input data of the payment, should be sha256 hash of the input data, therefore needs to be in hex string format

Lengthlength <= 250
networkstring

The network the payment will be received on

Value in"Preprod" | "Mainnet"
agentIdentifierstring

The identifier of the agent that will be paid

Length57 <= length <= 250
RequestedFunds?array<object>

The amounts of the payment, should be null for fixed amount

paymentTypestring

The type of payment contract used

Value in"Web3CardanoV1"
payByTime?string

The time after which the payment has to be submitted to the smart contract

Default"1970-01-01T12:00:00.000Z"
submitResultTime?string

The time after which the payment has to be submitted to the smart contract

Default"1970-01-01T12:00:00.000Z"
unlockTime?string

The time after which the payment will be unlocked

externalDisputeUnlockTime?string

The time after which the payment will be unlocked for external dispute

metadata?string

Metadata to be stored with the payment request

identifierFromPurchaserstring

The a unique nonce from the purchaser. Required to be in hex format

Length14 <= length <= 26

Response Body

curl -X POST "https://loading/./../api/v1/payment/" \
  -H "Content-Type: application/json" \
  -d '{
    "agentIdentifier": "agent_identifier",
    "network": "Preprod",
    "inputHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "payByTime": "1970-01-20T20:00:26.260Z",
    "metadata": "(private) metadata to be stored with the payment request",
    "paymentType": "Web3CardanoV1",
    "submitResultTime": "1970-01-20T20:00:36.260Z",
    "identifierFromPurchaser": "aabbaabb11221122aabb"
  }'
{
  "status": "success",
  "data": {
    "id": "cuid_v2_auto_generated",
    "inputHash": "input_hash",
    "blockchainIdentifier": "blockchain_identifier",
    "createdAt": "1970-01-20T20:00:36.260Z",
    "updatedAt": "1970-01-20T20:00:36.260Z",
    "payByTime": "0",
    "submitResultTime": "0",
    "unlockTime": "0",
    "externalDisputeUnlockTime": "0",
    "lastCheckedAt": null,
    "requestedById": "requester_id",
    "resultHash": "result_hash",
    "onChainState": null,
    "NextAction": {
      "requestedAction": "AuthorizeRefundRequested",
      "errorType": null,
      "errorNote": null,
      "resultHash": null
    },
    "RequestedFunds": [
      {
        "amount": "10000000",
        "unit": ""
      }
    ],
    "PaymentSource": {
      "id": "payment_source_id",
      "policyId": "policy_id",
      "network": "Preprod",
      "smartContractAddress": "address",
      "paymentType": "Web3CardanoV1"
    },
    "BuyerWallet": null,
    "SmartContractWallet": null,
    "metadata": null,
    "WithdrawnForSeller": [],
    "WithdrawnForBuyer": []
  }
}
Empty
Empty
Empty