Skip to content
GitHub

Create a Quote

POST
/quotes

A quote is a sub-resource of a wallet address. It represents a quote for a payment from the wallet address.

Authorizations

Parameters

Header Parameters

Signature-Input
required

The Signature-Input field is a Dictionary structured field containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member’s key is the label that uniquely identifies the message signature within the context of the HTTP message. The member’s value is the serialization of the covered components Inner List plus all signature metadata parameters identified by the label. The following components MUST be included: - “@method” - “@target-uri” - “authorization”. When the message contains a request body, the covered components MUST also include the following: - “content-digest” The keyid parameter of the signature MUST be set to the kid value of the JWK. See ietf-httpbis-message-signatures for more details.

The Signature-Input field is a Dictionary structured field containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member's key is the label that uniquely identifies the message signature within the context of the HTTP message. The member's value is the serialization of the covered components Inner List plus all signature metadata parameters identified by the label. The following components MUST be included: - "@method" - "@target-uri" - "authorization". When the message contains a request body, the covered components MUST also include the following: - "content-digest" The keyid parameter of the signature MUST be set to the kid value of the JWK. See [ietf-httpbis-message-signatures](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-4.1) for more details.

Signature
required

The signature generated based on the Signature-Input, using the signing algorithm specified in the “alg” field of the JWK.

The signature generated based on the Signature-Input, using the signing algorithm specified in the "alg" field of the JWK.

Request Body required

A subset of the quotes schema is accepted as input to create a new quote.

The quote must be created with a (debitAmount xor receiveAmount) unless the receiver is an Incoming Payment which has an incomingAmount.

One of:

Create quote for an receiver that is an Incoming Payment with an incomingAmount

object
walletAddress
required

URL of a wallet address hosted by a Rafiki instance.

string format: uri
receiver
required

The URL of the incoming payment that is being paid.

string format: uri
/^(https|http)://(.+)/incoming-payments/(.+)$/
method
required
string
Allowed values: ilp
Examples
{
"walletAddress": "https://ilp.rafiki.money/alice",
"receiver": "https://ilp.rafiki.money/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7",
"method": "ilp"
}

Responses

201

Quote Created

A quote resource represents the quoted amount details with which an Outgoing Payment may be created.

object
id
required

The URL identifying the quote.

string format: uri
walletAddress
required

The URL of the wallet address from which this quote’s payment would be sent.

string format: uri
receiver
required

The URL of the incoming payment that the quote is created for.

string format: uri
/^(https|http)://(.+)/incoming-payments/(.+)$/
receiveAmount
required

The total amount that should be received by the receiver when the corresponding outgoing payment has been paid.

object
value
required

The value is an unsigned 64-bit integer amount, represented as a string.

string format: uint64
assetCode
required

The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code.

string
assetScale
required

The scale of amounts denoted in the corresponding asset code.

integer
<= 255
debitAmount
required

The total amount that should be deducted from the sender’s account when the corresponding outgoing payment has been paid.

object
value
required

The value is an unsigned 64-bit integer amount, represented as a string.

string format: uint64
assetCode
required

The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code.

string
assetScale
required

The scale of amounts denoted in the corresponding asset code.

integer
<= 255
method
required
string
Allowed values: ilp
expiresAt

The date and time when the calculated debitAmount is no longer valid.

string
createdAt
required

The date and time when the quote was created.

string format: date-time
Examples
{
"id": "https://ilp.rafiki.money/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf",
"walletAddress": "https://ilp.rafiki.money/alice/",
"receiver": "https://ilp.rafiki.money/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e",
"debitAmount": {
"value": "2500",
"assetCode": "USD",
"assetScale": 2
},
"receiveAmount": {
"value": "2198",
"assetCode": "EUR",
"assetScale": 2
},
"method": "ilp",
"createdAt": "2022-03-12T23:20:50.52Z",
"expiresAt": "2022-04-12T23:20:50.52Z"
}

400

No amount was provided and no amount could be inferred from the receiver.

401

Authorization required

Headers

WWW-Authenticate
string

The address of the authorization server for grant requests in the format `GNAP as_uri=<URI>`

403

Forbidden