# GetRatesAndCosts Method
Overview
This method allows Client Applications to calculate costs and exchange rates for international money transfers. Use this method to provide real-time quotes to your customers before creating an order.
Use Cases:
- Display transfer costs to customers
- Calculate exchange rates in real-time
- Compare costs across different payment methods
- Validate amounts before order creation
Performance: Typically responds in 200-500ms (rates are cached)
Request Fields
| Field Name | Type (Length) | Option | Description |
|---|---|---|---|
| AgentID | Integer (9) | R | Your agent ID |
| PartnerID | Integer (9) | R | Your partner ID |
| SenderCountry | Alpha (2) | R | ISO 3166-1 alpha-2 country code for origin (e.g., "US") |
| RecipientCountry | Alpha (2) | R | ISO 3166-1 alpha-2 country code for destination (e.g., "BR") |
| CurrencySent | Alpha (3) | R | ISO 4217 currency code (e.g., "USD") |
| CurrencyOfPayment | Alpha (3) | R | ISO 4217 currency code (e.g., "BRL") |
| TypeOfPaymentID | Integer | R | Payment method ID (31=TED/DOC, 42=PIX, 2=ACH, 3=FedWire) |
| NetAmountSent | Decimal (2) | C | Amount sent (2 decimals). Required if AmountReceived not provided |
| AmountReceived | Decimal (2) | C | Amount received (2 decimals). Required if NetAmountSent not provided |
Legend: R = Required, C = Conditional (at least one amount field must be provided)
Using GetRatesAndCosts for FX Only
You can use this API to get exchange rates only without creating an order:
- Provide all required parameters (AgentID, PartnerID, SenderCountry, RecipientCountry, CurrencySent, CurrencyOfPayment, TypeOfPaymentID)
- Provide a reference value (e.g., NetAmountSent = "1000.00")
- The response will contain:
- ExchangeRateSender (2-4 decimals)
- ExchangeRateAgent (2-4 decimals)
- Calculated AmountReceived
- All applicable costs and fees
Example for FX only:
<GetRatesAndCosts>
<AgentID>12345</AgentID>
<PartnerID>100</PartnerID>
<SenderCountry>US</SenderCountry>
<RecipientCountry>BR</RecipientCountry>
<CurrencySent>USD</CurrencySent>
<CurrencyOfPayment>BRL</CurrencyOfPayment>
<TypeOfPaymentID>42</TypeOfPaymentID>
<NetAmountSent>1000.00</NetAmountSent>
</GetRatesAndCosts>
Request Examples
Response Fields Explained
Fee Structure
| Field | Description | Example |
|---|---|---|
| NetAmountSent | Principal amount being sent | $1,000.00 |
| TotalFeeSender | Fee charged to sender | $15.00 |
| Total Collected | NetAmountSent + TotalFeeSender | $1,015.00 |
Exchange Rates
| Field | Description | Who Uses It |
|---|---|---|
| ExchangeRateSender | Rate shown to customer | Customer sees this |
| ExchangeRateAgent | Rate for partner settlement | Partner accounting |
Note: The difference between these rates represents the partner's margin.
Recipient Amount
| Field | Description | Example |
|---|---|---|
| AmountReceived | Amount in destination currency | R$ 5,250.00 |
| TotalRecipiententFee | Fee deducted from recipient (rare) | $0.00 |
| TotalPaidToRecipient | Final amount recipient receives | R$ 5,250.00 |
Error Response Example
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Invalid Currency of Payment</faultstring>
<detail>
<ErrorCode>2042</ErrorCode>
<ErrorMessage>Invalid Currency of Payment</ErrorMessage>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Business Rules
Amount Limits
Limits vary by corridor (country pair) and payment method:
| Corridor | Min Amount | Max Amount | Notes |
|---|---|---|---|
| US → BR | $10.00 | $10,000.00 | Per transaction |
Note: Limits may vary by partner. Contact support for your specific limits.
Exchange Rate Updates
- Rates are updated every 5 minutes
- Rates are cached for performance
- Rates are valid for 30 minutes after quote
- Rates may change between quote and order creation
Best Practice: Always call GetRatesAndCosts immediately before CreateNewOrder to ensure current rates.
Integration Best Practices
1. Cache Reference Data
Don't call GetRatesAndCosts for every page load. Instead:
1. Call GetActiveCountries once per day → Cache countries
3. Call GetCurrencyTypesOfPayment once per day → Cache payment methods
4. Call GetRatesAndCosts only when user enters amount
2. Handle Both Calculation Methods
Support both send amount and receive amount:
// User enters send amount
if (userEntersSendAmount) {
request.NetAmountSent = amount;
request.AmountReceived = null;
}
// User enters receive amount
if (userEntersReceiveAmount) {
request.NetAmountSent = null;
request.AmountReceived = amount;
}
4. Validate Before CreateNewOrder
Always validate the quote is still valid:
// 1. Get quote
const quote = await GetRatesAndCosts(params);
// 2. Show to customer and get confirmation
await showQuoteToCustomer(quote);
// 3. Get fresh quote before creating order
const freshQuote = await GetRatesAndCosts(params);
// 4. Verify rates haven't changed significantly
if (Math.abs(freshQuote.ExchangeRate - quote.ExchangeRate) > 0.02) {
// Rate changed, show new quote to customer
await showUpdatedQuote(freshQuote);
}
// 5. Create order with fresh rates
await CreateNewOrder(orderData);
5. Handle Errors Gracefully
try {
const quote = await GetRatesAndCosts(params);
displayQuote(quote);
} catch (error) {
if (error.code === "2054") {
showMessage(
"This payment method is not available for the selected currency. Please choose a different payment method."
);
} else if (error.code === "3072") {
showMessage("Service temporarily unavailable. Please contact support.");
} else {
showMessage("Unable to calculate rates. Please try again.");
}
}
Testing
Related Methods
Before calling GetRatesAndCosts, you may need:
- GetActiveCountries - Get list of supported countries
- GetCurrencyTypesOfPayment - Get payment methods for currency
After getting rates, proceed to:
- CreateNewOrder - Create the actual transfer order
Support
- remittance@inter.co
- marcos.lanzoni@inter.co