Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The smart contract that holds funds and enforces the conditions of the agreement between the Service Provider and the Signer.
In this section, you'll see all the attributes of the Escrow Entity.
engagementId
string
The unique identifier linking this escrow to a specific project or transaction.
contractId
string
The unique identifier of the contract.
issuer
string | Address Wallet
The address of the party that created the escrow contract.
signer
string | Address Wallet
The address authorized to approve the release of funds.
serviceProvider
string | Address Wallet
The address of the entity receiving the payment.
amount
number | u128
The amount pacted (price of product/service).
balance
number | u128
The amount currently in the contract.
cancelled
boolean
If the escrow is already cancelled
completed
boolean
If the escrow is already completed
description
string
A brief summary or metadata describing the scope of the service/product.
Base URL: https://api.trustlesswork.com
Here you'll find the basic flow in order to use Trustless Work API.
Before you start:
A public and private address must be generated with this stellar resource:
Then stellar funds must be given to this address by placing the public key in this stellar resource:
USDC on testnet faucet Stellar testnet:
To be able to interact with USDC from a stellar address you have to define the trustline. For this you can use this api endpoint:
Normal case where a escrow is created and the escrow are completed correctly:
The escrow contract must be deployed, which in turn initializes the escrow with its metadata.
Among the information returned you will get the id of the contract you have just deployed, which you will need to enter to be able to use the other endpoints.
NOTE: This 50 percent that is being transferred goes directly to the balance of the deployed contract, not to the service provider. The escrow must then be funded so that the service provider can be assured of 50 percent of the escrow value.
To do this, the following endpoint must be executed:
The following endpoint must be executed in order to complete the escrow after mutual agreement:
With this step the other 50 percent of the escrow value will be transferred to the balance of the deployed contract.
After the escrow is completed, the service provider may claim the proceeds of the escrow through this endpoint:
Case in which the contract is deployed and the escrow is initialized and funded but the service provider decides to cancel the escrow:
The escrow contract must be deployed, which in turn initializes the escrow with its metadata.
Among the information returned you will get the id of the contract you have just deployed, which you will need to enter to be able to use the other endpoints.
NOTE: This 50 percent that is being transferred goes directly to the balance of the deployed contract, not to the service provider.
The escrow must then be funded so that the service provider can be assured of 50 percent of the escrow value.
Due to an external cause the service provider decided to cancel the escrow.
The escrow owner (signer) will be able to refund to his account the 50 percent that he financed for the escrow due to the above mentioned situation.
IMPORTANT NOTE: All endpoints related to escrow management return the transaction unsigned. This is done by means of a string returned in XDR (External Data Representation) format, which is a format that stellar uses to encode transactions. This string is what you should use to sign the transaction with the wallet of your choice. After being signed it will return the transaction signed in the same way by means of a string in XDR format.
This string is the one that must be sent to the next endpoint for the transaction to be sent to the Stellar network:
The only endpoints that do not require the previous step since they are signed and sent to the network directly when executed, are the following (mentioning them by the name they have in the documentation):
Invoke Deployer Contract
Get Escrow by Engagement ID
Set Trustline
Allows users to deposit funds into an existing escrow contract, securing them until the agreed conditions are met.
Allows flexible USDC amounts to be transferred to the escrow contract.
URL: /escrow/fund-escrow
contractId: ID (address) that identifies the escrow contract
signer: Address of the user signing the contract transaction
amount: Amount to transfer to the escrow contract
Previous Version:
POST
escrow/fund-escrow
Headers
Content-Type
application/json
Body
string
The unique identifier linking this escrow to a specific project or transaction.
string
The unique identifier of the contract.
string | Address
The address authorized to approve the release of funds.
Example of Request Body:
Possible Responses
Only Signer
Already Funded
Fully Funded
Insufficient Founds
Not Found
Not Enough Allowance
What this Endpoint returns?
This endpoint returns the transaction unsigned so that the transaction can be signed by means of a customer wallet.
Responsible for modifying the "flag" property of a specific milestone in the escrow to approve that milestone.
URL: /escrow/change-milestone-flag
contractId: ID (address) that identifies the escrow contract
milestoneIndex: Position that identifies the milestone within the group of milestones in the escrow
newFlag: New value for the "flag" property within the escrow milestone
client: Address of the client who will approve the milestone
Handles the resolution of disputes within an escrow by transferring the amounts entered so far in the escrow to the client and service provider according to what the dispute resolver deems appropriate.
URL: /escrow/resolving-disputes
contractId: ID (address) that identifies the escrow contract
disputeResolver: Address of the user defined to resolve disputes in an escrow
clientFunds: Amount to transfer to the client for dispute resolution
serviceProviderFunds: Amount to transfer to the service provider for dispute resolution
Responsible for modifying the "status" property of a specific milestone in the escrow
URL: /escrow/change-milestone-status
contractId: ID (address) that identifies the escrow contract
milestoneIndex: Position that identifies the milestone within the group of milestones in the escrow
newStatus: New value for the "status" property within the escrow milestone
serviceProvider: Address of the service provider who will modify the contract's "status" property
Funds are deposited into the escrow contract, either manually by a party or automatically via an API call.
Deploys the escrow contract and defines its properties.
URL: /deployer/invoke-deployer-contract
signer: Entity that signs the transaction that deploys and initializes the escrow engagementId: Unique identifier for the escrow
title: Name of the escrow
description: Text describing the function of the escrow
client: Address of the entity requiring the service
serviceProvider: Address of the entity providing the service
platformAddress: Address of the platform that owns the escrow
amount: Amount to be transferred upon completion of escrow milestones
platformFee: Commission that the platform will receive when the escrow is completed
milestones: Objectives to be completed to define the escrow as completed releaseSigner: Address of the entity in charge of releasing escrow funds
disputeResolver: Address in charge of resolving disputes within the escrow
Prievious Version:
POST
escrow/initialize-escrow
Headers
Content-Type
application/json
Body
string
The unique identifier linking this escrow to a specific project or transaction.
string
A brief summary or metadata describing the scope of the service/product.
string | Address
The address of the party that created the escrow contract.
string | Address
The address of the entity receiving the payment.
string
The amount pacted (price of product/service).
string | Address
The address authorized to approve the release of funds.
Example of Request Body:
Possible Responses
Prices
The escrow has been successful completed.
Distributes escrow earnings after the escrow is marked as complete.
URL: /escrow/distribute-escrow-earnings
contractId: ID (address) that identifies the escrow contract
releaseSigner: Address of the user defined to release the funds
This was previously called complete escrow:
POST
escrow/complete-escrow
Headers
Content-Type
application/json
Body
string
The unique identifier linking this escrow to a specific project or transaction.
string | Address
The address authorized to approve the release of funds.
string
The unique identifier of the contract.
Example of Request Body:
Possible Responses
Only Signer
Not Funded
Already Completed
Not Found
Insufficient Founds
What this Endpoint returns?
This endpoint returns the transaction unsigned so that the transaction can be signed by means of a customer wallet.
How to get started in Trustless Work API
You'll have 50 as a request rate limit per client in the API every 60 seconds.
The Trustless Work REST API is designed to offer decentralized escrow solutions by leveraging the power of smart contracts on the Stellar blockchain through Soroban. This API enables platforms and businesses to integrate secure, fast, and transparent escrow services, eliminating the need to rely on centralized intermediaries.
The Trustless Work API is a key component for any platform that requires secure conditional payments. It allows the creation, management, and automation of escrow contracts, providing security for both payers and payees. This API can be used across various industries including e-commerce, SaaS, real estate, freelance marketplaces, and more.
Create and manage escrow contracts: Users can set up payment agreements with specific conditions that must be met before funds are released.
Real-time status updates: The API provides real-time access to escrow statuses, allowing users to verify the state of funds at any time.
Process automation: Through the use of smart contracts, actions such as fund releases, milestone verification, or dispute resolution can be automated.
This API is critical for offering businesses an efficient and secure way to manage payments without relying on third-party services. Trustless Work’s decentralized nature eliminates the risks associated with centralized intermediaries, such as delays or failures. Additionally, being blockchain-based guarantees full transparency and a significant reduction in operational costs.
Transparency: Every transaction is recorded on the blockchain, making it auditable and ensuring that all parties can track the flow of funds.
Low Costs: Built on Stellar, the API benefits from minimal transaction fees compared to traditional solutions or even other blockchain platforms.
Speed: Stellar's fast transaction finality ensures that payments are processed almost in real-time.
Cross-chain compatibility: With USDC and Circle’s cross-chain transfer protocol, the API can operate across multiple blockchains, offering flexibility to businesses.
Freelance marketplaces: Freelance platforms can use the API to manage milestone-based payments, enhancing trust and reducing disputes between clients and freelancers.
High-value e-commerce: In peer-to-peer transactions, escrow ensures that payment is only released once the product has been received and verified.
SaaS providers: Platforms managing recurring payments can leverage the API to release payments upon successful service delivery.
International real estate: Trustless Work helps secure funds in cross-border real estate transactions by releasing them only when all legal and contractual obligations are met.
Legal services: Law firms can manage complex multi-party agreements or settlements without needing manual escrow services.
In summary, the Trustless Work REST API provides a robust, transparent, and cost-effective solution for managing escrowed funds, catering to a wide range of industries and promoting security and trust in digital transactions.
Set the required trustline.
POST
helper/set-trustline
Headers
Content-Type
application/json
Params
string
The key of the secret source.
Example of Request Body:
Possible Responses
Confirm the transaction.
POST
helper/send-transaction
Headers
Content-Type
application/json
Body
string
The sign's hash. This come from the wallet.
Example of Request Body:
Possible Responses