githubEdit

Updating a Request

After a request is created, it can be updated by the authorized parties. Each update requires a signature and is persisted to the Request Network.

Summary of Actions

Action
Description
Authorized Role

accept

Accept a request, indicating that it will be paid

Payer

cancel

Cancel a request

Payee or Payer

reduceExpectedAmount

Reduce the expected amount

Payee

increaseExpectedAmount

Increase the expected amount

Payer

addStakeholders

Grant 1 or more third parties access to view an encrypted request

Payee, Payer, or Third Party

Examples

Initialize the Request Client

First, retrieve the request you want to update. You must provide a signatureProvider to sign the update transactions.

const { RequestNetwork, Types } = require("@requestnetwork/request-client.js");

const requestClient = new RequestNetwork({
  nodeConnectionConfig: { baseURL: "https://sepolia.gateway.request.network/" },
  signatureProvider: epkSignatureProvider, // Required for updates
});

const request = await requestClient.fromRequestId('YOUR_REQUEST_ID');

Accept a Request (Payer)

The payer can accept a request to signal their intention to pay.

Cancel a Request (Payee or Payer)

Either the payee or the payer can cancel a request.

Increase Expected Amount (Payer)

The payer can increase the expected amount (e.g., adding a tip or adjusting for additional services).

Reduce Expected Amount (Payee)

The payee can reduce the expected amount (e.g., applying a discount).

Last updated

Was this helpful?