diff --git a/hosted/json-schemas/quote.schema.json b/hosted/json-schemas/quote.schema.json index 8fbd416d..1198c438 100644 --- a/hosted/json-schemas/quote.schema.json +++ b/hosted/json-schemas/quote.schema.json @@ -10,19 +10,23 @@ "type": "string", "description": "ISO 4217 currency code string" }, - "amount": { + "subtotal": { "$ref": "definitions.json#/definitions/decimalString", - "description": "The amount of currency expressed in the smallest respective unit" + "description": "The amount of currency paid for the exchange, excluding fees" }, "fee": { "$ref": "definitions.json#/definitions/decimalString", - "description": "The amount paid in fees" + "description": "The amount of currency paid in fees" + }, + "total": { + "$ref": "definitions.json#/definitions/decimalString", + "description": "The total amount of currency to be paid in or paid out. It is always a sum of subtotal and fee" }, "paymentInstruction": { "$ref": "#/definitions/PaymentInstruction" } }, - "required": ["currencyCode", "amount"] + "required": ["currencyCode", "subtotal", "total"] }, "PaymentInstruction": { "type": "object", diff --git a/specs/protocol/README.md b/specs/protocol/README.md index c649d094..3b662aa2 100644 --- a/specs/protocol/README.md +++ b/specs/protocol/README.md @@ -554,8 +554,9 @@ A `Close` can be sent by Alice _or_ the PFI at any point during the exchange, bu | field | data type | required | description | | -------------------- | ------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------- | | `currencyCode` | string | Y | ISO 4217 currency code string | -| `amount` | [`DecimalString`](#decimalstring) | Y | The amount of currency paid to the PFI or by the PFI excluding fees | -| `fee` | [`DecimalString`](#decimalstring) | N | The amount paid in fees | +| `subtotal` | [`DecimalString`](#decimalstring) | Y | The amount of currency paid for the exchange, **excluding** fees | +| `fee` | [`DecimalString`](#decimalstring) | N | The amount of currency paid in fees | +| `total` | [`DecimalString`](#decimalstring) | Y | The total amount of currency to be paid in or paid out. It is always a sum of `subtotal` and `fee` | | `paymentInstruction` | [`PaymentInstruction`](#paymentinstruction) | N | Object that describes how to pay the PFI, and how to get paid by the PFI (e.g. BTC address, payment link) | #### `PaymentInstruction` @@ -580,10 +581,21 @@ A `Close` can be sent by Alice _or_ the PFI at any point during the exchange, bu "expiresAt": "2023-09-13T23:11:17.315Z", "payoutUnitsPerPayinUnit": "16.654345", "payin": { - "link": "http://cash.app/pfi?currency=usd&amount=50" + "currencyCode": "USD", + "subtotal": "200.00", + "fee": "0.20", + "total": "200.20", + "paymentInstruction": { + "link": "https://example-pfi.com/payin?currency=usd&amount=200.20" + } }, "payout": { - "instruction": "BTC will be paid to the provided BTC address", + "currencyCode": "BTC", + "subtotal": "0.000016", + "total": "0.000016", + "paymentInstruction": { + "instruction": "BTC will be paid to the provided BTC address" + } } }, "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa29yZUMxVVJNUUVWS204d3h6aFZGbnRMenZQWFlidEg4Q0VGTktVY1NrTFdUI3o2TWtvcmVDMVVSTVFFVkttOHd4emhWRm50THp2UFhZYnRIOENFRk5LVWNTa0xXVCJ9..R_BBKJoWifPFh10GJ1ij2gCCxND1CdzKbiOgPCIha__0GvRy0rHYCi18-TY7jNARaQ94RHXHYIsCRm2MuOPACw"