.. and press ENTER to ask a question on web5, how to write code and more.

Skip to main content

Receiving Quotes

After sending an RFQ, the PFI will respond with an exact Quote for your customer. This message will be written to the exchange.

Polling for Quote​

If you did not provide a callback URI when sending a RFQ, your application will need to poll the exchange until the Quote message is written:

JavaScript
Kotlin
Swift

Quote Object​

Now that you've received a Quote, you can present it to your customer and give them the option to place an Order or cancel the exchange.

The Quote will be returned in JSON form:

{
"metadata": {
"exchangeId": "rfq_01hj07tb0rev8avhmqd8gggnkh",
"from": " /* PFI's DID */ ",
"to": " /* Customer's DID */ ",
"protocol": "1.0",
"kind": "quote",
"id": "quote_01hj07tb6be2htn8bbx8afcjw9",
"createdAt": "2023-12-19T05:12:16.331Z"
},
"data": {
"expiresAt": "2024-05-01T05:00:00.000Z",
"payin": {
"currencyCode": "BTC",
"amount": "0.01",
"fee": "0.0001",
"paymentInstruction": {
"link": "https://example.com/payinInstructions",
"instruction": "Instructions for customer to pay PFI"
}
},
"payout": {
"currencyCode": "KES",
"amount": "123456789",
"paymentInstruction": {
"link": "https://example.com/payoutInstructions",
"instruction": "Instructions for PFI to pay customer"
}
}
},
"signature": " /* PFI's cryptographic signature */ "
}

Cancel Exchange​

After receiving the exact Quote, your customer may decide not to place an order. In this case, you can send a Close message to the PFI which will end the exchange.

To terminate the exchange, create a Close message, sign it with the customer's Bearer DID, and send the message.

JavaScript
Kotlin
Swift

At this point, the exchange has been closed, and your customer is free to start a new exchange with this PFI or any other.

Connect with us on Discord

Submit feedback: Open a GitHub issue

Edit this page: GitHub Repo

Contribute: Contributing Guide