# Create a quote (authenticated)

{% admonition type="info" %}
You must use a user access token to authenticate this call and supply the profile with which the quote should be associated. This ensures that quote can be used to create a transfer.
{% /admonition %}

If you are funding the transfer from a Multi Currency Balance, you must set the payIn as BALANCE to get the correct pricing in the quote. Not doing so will default to BANK_TRANSFER and the fees will be inconsistent between quote and transfer.

{% admonition type="info" %}
When SWIFT_OUR is set as payOut value, it enables payment protection for swift recipients for global currency transfers. By using this payOut method, you can guarantee your customers that the fee will be charged to the sender and can ensure that the recipient gets the complete target amount.
{% /admonition %}

#### Response

The following describes the fields of the quote response that may be useful when building your integration.

The payOut field is used to select the correct entry in the paymentOptions array in order to know which fees to display to your customer. Find the paymentOption that matches the payOut field shown at the top level of the quote resource and payIn based on the settlement model the bank is using. By default, this is BANK_TRANSFER, unless you are using a prefunded or bulk settlement model. The payOut field will change based on the type of recipient you add to the quote in the PATCH /quote call, for example to-USD swift_code or to-CAD interac have different fees.

For example sending USD to a country other than the United States is supported but with different fees to domestic USD transfers.
Please see the later section on Global Currencies to learn more about how to offer this useful feature.

For each paymentOption there is a price field. It gives a full breakdown of all the taxes, fees and discounts. It is preferable to refer to this structure to show breakdowns and totals, rather than the fee structure, found as well in each paymentOption element, that only gives a summary and is not able to surface important specifics such as taxes.

When showing the price of a transfer always show the 'price.total.value.amount' of a payment option.

#### Disabled Payment Options

Each payment option is either enabled or disabled based on the disabled value. Disabled payment options should be shown to the user in a disabled state in most cases. This ensures users are given the options that they are familiar with regardless of their availability, as well as with options that can be beneficial to their accounts.

The option.disabledReason contains both the code and message, with the message being the user-friendly text to surface to the user if necessary.

#### Transfer Nature for BRL
When creating or updating a quote, the transfer nature can be set. This is a requirement for transfers to or from BRL and impacts the fees we charge on the quote, specifically the IOF.

Note that IOF is determined based on the transfer nature, sender information, and recipient information. The default IOF will be included in a quote until all relevant information has been included.

{% admonition type="info" %}
Omitting transfer nature will not prevent the transfer from being created or even funded. However, when attempting to process the transfer, it will be blocked and the money will be refunded to the sender.
{% /admonition %}

#### Pricing Configuration
When creating or updating a quote, partners that have flexible partner pricing enabled are able to override the pricing configuration dynamically.

To learn more on how to use this feature, please see the Flexible Partner Pricing Guide

Endpoint: POST /v3/profiles/{profileId}/quotes
Security: UserToken

## Path parameters:

  - `profileId` (integer, required)
    Personal or business profile ID of the sender.
    Example: 101

## Request fields (application/json):

  - `sourceCurrency` (string, required)
    Source (sending) currency code.
    Example: "GBP"

  - `targetCurrency` (string, required)
    Target (receiving) currency code.
    Example: "USD"

  - `sourceAmount` (number,null)
    Amount in source currency. Either sourceAmount or targetAmount is required, never both.
    Example: 100

  - `targetAmount` (number,null)
    Amount in target currency.

  - `targetAccount` (integer)
    Optional. This is the ID of transfer recipient, found in response from POST v1/accounts (recipient creation). If provided can be used as an alternative to [updating the quote](/api-reference/quote/quoteupdate).
    Example: 12345

  - `payOut` (string,null)
    Optional. Preferred payout method. Default value is BANK_TRANSFER. Examples of other accepted values include BALANCE, SWIFT, SWIFT_OUR, ALIPAY, and INTERAC.

  - `preferredPayIn` (string,null)
    Optional. Preferred payin method. Use BANK_TRANSFER to return this method at the top of the response's results.

  - `paymentMetadata` (object)
    Optional. Used to pass additional metadata about the intended transfer.

  - `paymentMetadata.transferNature` (string)
    Optional. Used to pass transfer nature for calculating proper tax amounts (IOF) for transfers to and from BRL. Accepted values are shown dynamically in transfer requirements.
    Example: "MOVING_MONEY_BETWEEN_OWN_ACCOUNTS"

  - `pricingConfiguration` (object)
    Required when configured for your client ID. Includes a pricingConfiguration to be used for pricing calculations with the quote.

  - `pricingConfiguration.fee` (object)

  - `pricingConfiguration.fee.type` (string)
    Identifies the type of fee that will be configured. Options include only OVERRIDE.
    Example: "OVERRIDE"

  - `pricingConfiguration.fee.variable` (number)
    The selected variable percentage (in decimal format) that should be used in the pricingConfiguration.
    Example: 0.011

  - `pricingConfiguration.fee.fixed` (number)
    The selected fixed fee that should be used in the pricingConfiguration. Always considered in source currency.
    Example: 15.42

## Response 200 fields (application/json):

  - `id` (string)
    ID of this quote (GUID format).
    Example: "11144c35-9fe8-4c32-b7fd-d05c2a7734bf"

  - `sourceCurrency` (string)
    Source (sending) currency code.
    Example: "GBP"

  - `targetCurrency` (string)
    Target (receive) currency code.
    Example: "USD"

  - `sourceAmount` (number)
    Amount in source currency to send.
    Example: 100

  - `targetAmount` (number)
    Amount in target currency to be received by the recipient.
    Example: 129.24

  - `payOut` (string)
    Mechanism we use to deliver the transfer. Not usually of interest to the user.
    Example: "BANK_TRANSFER"

  - `preferredPayIn` (string)
    Preferred pay-in method.
    Example: "BANK_TRANSFER"

  - `rate` (number)
    Exchange rate value used for the conversion.
    Example: 1.30445

  - `createdTime` (string)
    Quote created timestamp.
    Example: "2019-04-05T13:18:58Z"

  - `user` (integer)
    User ID who created the quote.
    Example: 55

  - `profile` (integer)
    Personal or business profile ID.
    Example: 101

  - `rateType` (string)
    Whether the rate is fixed or floating.
    Enum: "FIXED", "FLOATING"

  - `rateExpirationTime` (string)
    Time the locked rate will expire.
    Example: "2019-04-08T13:18:57Z"

  - `guaranteedTargetAmountAllowed` (boolean)
    Whether guaranteed target amount is allowed.
    Example: true

  - `targetAmountAllowed` (boolean)
    Whether target amount is allowed.
    Example: true

  - `guaranteedTargetAmount` (boolean)
    Whether the target amount is guaranteed.

  - `providedAmountType` (string)
    Whether the quote was created as source or target.
    Enum: "SOURCE", "TARGET"

  - `pricingConfiguration` (object)
    Allows for pricing configurations to be overridden by partners on a transfer level.

  - `pricingConfiguration.fee` (object)

  - `pricingConfiguration.fee.type` (string)
    Identifies the type of fee that will be configured. Options include only OVERRIDE.
    Example: "OVERRIDE"

  - `pricingConfiguration.fee.variable` (number)
    The selected variable percentage (in decimal format) that should be used in the pricingConfiguration.
    Example: 0.011

  - `pricingConfiguration.fee.fixed` (number)
    The selected fixed fee (in source currency) that should be used in the pricingConfiguration.
    Example: 15.42

  - `paymentOptions` (array)
    List of the methods a user can pay for the transfer.

  - `paymentOptions.disabled` (boolean)
    Whether this option is enabled or not for this quote.

  - `paymentOptions.estimatedDelivery` (string)
    The estimated delivery time for this combination of payIn and payOut methods, assuming payIn is performed now.
    Example: "2019-04-08T12:30:00Z"

  - `paymentOptions.formattedEstimatedDelivery` (string)
    A string to display to users for the estimated delivery date.
    Example: "by Apr 8"

  - `paymentOptions.estimatedDeliveryDelays` (array)
    Array of objects for delivery delays to display to users.

  - `paymentOptions.estimatedDeliveryDelays.reason` (string)
    Reason of the delivery delay.
    Example: "sample reason"

  - `paymentOptions.fee` (object)
    Object containing fee information.

  - `paymentOptions.fee.transferwise` (number)
    The fee to be paid by the sender based on the current state of the quote.
    Example: 3.04

  - `paymentOptions.fee.payIn` (number)
    The fee for this payment option, based on the product type of the payment option.

  - `paymentOptions.fee.discount` (number)
    Any discounts that have been applied to this quote for the user.
    Example: 2.27

  - `paymentOptions.fee.partner` (number)
    If you have agreed a custom price, it will be displayed here.

  - `paymentOptions.fee.total` (number)
    The total fees to be paid - use this figure when displaying fees on your app.
    Example: 0.77

  - `paymentOptions.price` (object)
    Object containing the price information.

  - `paymentOptions.price.priceSetId` (integer)
    ID of the price structure.
    Example: 238

  - `paymentOptions.price.total` (object)
    The total fees to be paid - use this figure when displaying fees on your app.

  - `paymentOptions.price.total.type` (string)
    Type of the pricing element.
    Example: "TOTAL"

  - `paymentOptions.price.total.label` (string)
    Short text describing the price structure.
    Example: "Total fees"

  - `paymentOptions.price.total.value` (object)
    Object containing value elements.

  - `paymentOptions.price.total.value.amount` (number)
    Amount to be paid.
    Example: 0.77

  - `paymentOptions.price.total.value.currency` (string)
    Currency of the amount to be paid.
    Example: "GBP"

  - `paymentOptions.price.total.value.label` (string)
    Text version of the price.
    Example: "0.77 GBP"

  - `paymentOptions.price.total.explanation` (object)
    Object element giving more details about the price.

  - `paymentOptions.price.items` (array)
    Object containing the details of the different elements of the total price.

  - `paymentOptions.price.items.id` (string)
    ID of this item.

  - `paymentOptions.price.items.type` (string)
    Type of the pricing item. It could be DISCOUNT for example.
    Example: "FEE"

  - `paymentOptions.price.items.label` (string)
    Short text describing the pricing element.
    Example: "fee"

  - `paymentOptions.price.items.value` (object)
    Object containing value elements.

  - `paymentOptions.price.items.value.amount` (number)
    Amount associated to this pricing element. Can be negative for discounts.

  - `paymentOptions.price.items.value.currency` (string)
    Currency of the pricing element.
    Example: "GBP"

  - `paymentOptions.price.items.value.label` (string)
    Text field containing the price and its currency.
    Example: "0 GBP"

  - `paymentOptions.price.items.explanation` (object)
    Additional information on a price breakdown item.

  - `paymentOptions.price.items.explanation.plainText` (string)
    Text element giving more details about the item.

  - `paymentOptions.price.items.explanation.markdown` (string)
    Formatted textual information.

  - `paymentOptions.price.deferredFee` (object)
    Deferred fee information from a pricingConfiguration override.

  - `paymentOptions.price.deferredFee.amount` (number)
    The amount of fees that has been deferred by a pricingConfiguration override.
    Example: 14.79

  - `paymentOptions.price.deferredFee.currency` (string)
    The currency of the deferred fee amount.
    Example: "BRL"

  - `paymentOptions.price.calculatedOn` (object)

  - `paymentOptions.price.calculatedOn.unroundedAmountToConvert` (object)
    The amount, unrounded, that fees were calculated on and built up from.

  - `paymentOptions.price.calculatedOn.unroundedAmountToConvert.amount` (number)
    Example: 179.97342

  - `paymentOptions.price.calculatedOn.unroundedAmountToConvert.currency` (string)
    Example: "BRL"

  - `paymentOptions.sourceAmount` (number)
    sourceAmount when using this payment option.
    Example: 100

  - `paymentOptions.targetAmount` (number)
    targetAmount when using this payment option.
    Example: 129.24

  - `paymentOptions.sourceCurrency` (string)
    Source currency for this payment option.
    Example: "GBP"

  - `paymentOptions.targetCurrency` (string)
    Target currency for this payment option.
    Example: "USD"

  - `paymentOptions.payIn` (string)
    Type of pay in method for this payment option.
    Example: "BANK_TRANSFER"

  - `paymentOptions.payOut` (string)
    Type of pay out method for this payment option.
    Example: "BANK_TRANSFER"

  - `paymentOptions.allowedProfileTypes` (array)
    Array of the allowed types of profile to use this payment option.
    Enum: "PERSONAL", "BUSINESS"

  - `paymentOptions.payInProduct` (string)
    Pay-in product type.
    Example: "CHEAP"

  - `paymentOptions.feePercentage` (number)
    Fee percentage for this payment option.
    Example: 0.0092

  - `paymentOptions.disabledReason` (object)
    Object present if a payment option is disabled.

  - `paymentOptions.disabledReason.code` (string)
    Code to denote the reason a payment method is unavailable.

  - `paymentOptions.disabledReason.message` (string)
    User friendly message to display when a method is unavailable.

  - `status` (string)
    Current status of this quote.
    Enum: "PENDING", "ACCEPTED", "FUNDED", "EXPIRED"

  - `expirationTime` (string)
    The time the quote expires.
    Example: "2019-04-05T13:48:58Z"

  - `notices` (array)
    Array of messages to display to the user. May be empty ([]) if there are no messages.

  - `notices.text` (string)
    The message to display.
    Example: "You can have a maximum of 3 open transfers with a guaranteed rate. After that, they'll be transferred using the live rate. Complete or cancel your other transfers to regain the use of guaranteed rate."

  - `notices.link` (string,null)
    URL that provides more information to the message. May be null if there's no URL.

  - `notices.type` (string)
    Type of message. If it is BLOCKED, don't allow the quote to be used to create the transfer.
    Enum: "WARNING", "INFO", "BLOCKED"


