Settle

Validates a client's signed payment payload and, if valid, submits the payment transaction to the Casper Network. The facilitator's account pays the gas (motes) for the settlement deploy; the CEP-18 tokens are transferred from the payer to the payee via the transfer_with_authorization contract entry point.

POST /settle

Request body

The request body has the same shape as /verify.

Property
Type
Required
Description

paymentPayload

object

Yes

The signed payment payload submitted by the client.

paymentRequirements

object

Yes

The payment requirements declared by the resource server.

See Verify for the full schema of paymentPayload and paymentRequirements.

Response

The response always returns HTTP 200. The success field indicates whether settlement succeeded.

Property
Type
Description

success

boolean

true if the payment was settled on-chain, false otherwise.

transaction

string

Casper deploy hash of the settlement transaction (64 hex characters).

network

string

CAIP-2 network identifier where the payment was settled.

payer

string

Casper account hash of the payer.

errorReason

string

Machine-readable error code, present when success is false.

errorMessage

string

Human-readable error description, present when success is false.

Error codes

In addition to all verification error codes, the following codes may appear during settlement:

Code
Description

network_mismatch

The facilitator has no signing key configured for the requested network.

verification_failed

The payload failed pre-settlement verification.

build_deploy_failed

Failed to build the Casper TransactionV1.

sign_deploy_failed

Failed to sign the transaction with the facilitator's key.

put_deploy_failed

Failed to submit the transaction to the Casper Network.

wait_deploy_failed

The transaction was submitted but confirmation timed out or returned an execution error.

Example

Successful settlement:

Failed settlement:

Last updated