Skip to main content
The AGG design connects a payer’s available funds with the asset and destination requested by a merchant or application. It covers payment requirements, route selection, and coordination with a payment facilitator where one is used. SW4P is the intelligent routing and settlement system for moving value across the internet. It coordinates route selection, fees, execution, confirmation, recovery, and accounting for the result.

Payment Requirements

A payment-gated resource can use an HTTP 402 Payment Required response to tell a client that a payment is needed. The payment request describes the purpose, amount, asset, recipient, and intended destination. The client needs enough information to present the request and follow its outcome. The exact message format and supported payment methods belong to the selected application and integration.

Routes and Facilitators

A route describes how the payer’s funds can satisfy the request. It may involve a direct transfer, an asset conversion, movement between networks, or a combination of steps. Route selection considers:
  • The source asset and the asset the recipient is to receive.
  • The source and destination networks.
  • Available liquidity or transfer mechanisms.
  • Network, conversion, execution, and service costs.
  • The expected amount received and any allowed change in the conversion price.
  • Timing, confirmation requirements, and recovery if a step is interrupted.
A payment facilitator is a service that helps handle payment verification or settlement. The routing model needs to account for the facilitator’s supported requests, fees, response handling, and settlement records. Use the chosen application’s route and quote information to understand the operation being offered.

Authorisation and Settlement

The person or agent initiating a payment must have authority to use the funds. The application’s rules define the requested operation, spending limits, and required approvals. The settlement design connects four responsibilities:
  1. Review the payment request, route, recipient, and costs.
  2. Authorise the operation under the applicable limits.
  3. Execute the route and follow its confirmation.
  4. Record the result against the original payment request.
A route may include asset conversion, fee handling, a transfer to the recipient, and an attribution record such as an order reference. The selected execution method determines how those steps are carried out. The application uses the confirmed result to determine whether its payment requirement has been satisfied.

Fees and Payment Records

The quote should identify the amount the recipient is expected to receive, the costs that apply, and who pays each cost. Any platform or service fee belongs to the terms of the selected route or application. Gas arrangements also belong to the route. Where a sponsorship arrangement is offered, the payment information needs to identify which costs it covers and who funds them. Payment records connect the request, authorisation, incurred costs, recipient, and confirmed outcome. Keeping those references together helps an application account for the payment and answer questions about its status.

Routes Across Networks

A route between networks has steps on both the source and destination. A native burn-and-mint route, for example, burns the source asset, obtains the required attestation, and mints on the destination. Other routes use different mechanisms. The route record needs to distinguish what has completed on the source from what has completed on the destination. The selected application’s route information identifies the transfer method, dependencies, and way to follow progress.

Errors and Recovery

An unavailable route, declined authorisation, and partially executed transfer require different next steps. The client should retain the payment reference and the recorded state of the operation. Recovery uses that state to determine what completed, what remains outstanding, and whether the next action continues the existing operation. The application also needs a way to explain an interruption to the payer and connect the request with the relevant support or recovery process.

Integration References

Hyperlink describes how a payment request can be presented through a link. @sw4p/kit introduces agent-facing tools and payment messages that connect to SW4P. Use the selected component’s documentation for its concrete interfaces, authentication, route information, and operating requirements.
Related: SW4P · Hyperlink · @sw4p/kit