POST Quote a Transaction

POST /transfer/v1/transactions/quote

Development Guide

The 'Quote a Transaction' endpoint creates an array of transaction quotes for a given destination country. Each transaction quote will include the unique service option, send amount, receive amount, currencies, fees and fx. A unique transactionId resource will be created for each transaction quote.



1. Prepare headers & authentication:

Call the 'Quote a transaction' endpoint with a POST HTTP method, providing the OAuth access_token in the header and all other required header values.


Note: MoneyGram uses the OAuth 2.0 framework. The application must use their OAuth client credentials to generate an accessToken by calling the Get access token endpoint. The token is valid for **1 hour ** and must be passed as a header value in all subsequent API HTTP calls. Learn More


🚀

Launch Code Example:




2. Provide Request Body: "Quote by send amount" OR "Quote by receive amount":

The Quote API uses the oneOf Keyword to allow the application to either quote a transaction by send or receive amount:


  • Quote by send amount: The application must provide at a minimum the targetAudience, agentPartnerId, destinationCountryCode and the sendAmount.value fields in the request.
    OR

  • Quote by receive amount: The application must provide the at a minimum the targetAudience, agentPartnerId, destinationCountryCode , and the receiveAmount.value fields in the request.

Note: The Quote API uses ISO Standards for country and currency values. MoneyGram provide Reference Data APIs which can be queried to understand and list the supported values and associated metadata.


🚀

Launch Code Example:

.




3. Provide serviceOptionCode in the request body (optional):

The Quote API allows the application to specify one or all service options to be returned to the given destination country:


  • Quote all service options: If the serviceOptionCode is not provided in the request body, the quote endpoint will return _all _service options in an array of quoted transactions (i.e. the API will return all cash pickup, bank, wallet & card deposit options available to the destination country). Learn More
    OR

  • Quote a single service option: If the serviceOptionCode is provided in the request body, the quote endpoint will only return an array of quoted transactions for that specified code. (e.g. if "serviceOptionCode": "Bank_Deposit" is passed in the request, the endpoint will only quote the bank deposit options available to the destination country) Learn More

🚀

Launch Code Example:

.




4. Provide discounts to the request body (optional):

The Quote API also allows the application to apply promotional discounts and participate in the MoneyGram Plus Rewards program to accrue/redeem loyalty discounts.


  • If a promotionCodes is passed, a discount will be applied to the fee quote.

  • If a rewardsNumber is passed, a discount the will be applied to the quote. This is only for eligible transactions.

🚀

Launch Code Example:




5. Make a request and handle the response:

The application must call 'Quote a transaction' endpoint with a POST HTTP method. The endpoint will respond with a HTTP 200 OK status. The Quote API response will provide an array of quoted transactions, each with a unique transactionId resource. The consumer must choose one quote to continue with and the application must persist the associated transactionId to use when calling the subsequent Update API.


  • Success | Parse the Response | 200 OK HTTP Status
    For each transactionId resource generated, the endpoint will typically respond with the following fields serviceOptionCode, serviceOptionName, estimatedDelivery, sendAmount, sendCurrency, fees, taxes, additionalCharges, fxRate, discountsApplied, and the receiveAmount. In some cases send or receive side taxes are applied.

  • Failed | Handle the Error | 400 Bad Request HTTP Status
    When the 'Quote a transaction' endpoint responds with 400 HTTP Status, specific error code/s will be returned with an array of offending fields. The application will need to resolve these errors and resubmit the quote.

Note: The list of transactions returned on the Quote API is priced uniquely by the service options and receive currency. The Fee and FX rate is guaranteed for 30 minutes from the time of the quote. However, the FX rate may change if the transaction is not committed within 30 minutes of the quote.


🚀

Launch Code Example:

.






Request Fields

FieldTypeRequired/OptionalDescription
targetAudienceStringRequiredAPI purpose: MONEY_TRANSFER, BILL_PAY, CRYPTO
agentPartnerIdString Max length: 5RequiredUnique code to identify the MoneyGram Partner
posidStringOptionalPoint of sale identifier of the client performing the API Call
operatorIdStringRequiredOperator name or ID of the user performing the transaction. Name or ID must be populated from the agent/partner system and cannot be edited by the user.
userLanguageString Max Length: 6OptionalLanguage used by the user/operator
destinationCountryCodeString Length: 3RequiredISO alpha-3 country code identifying the destination country NOTE: For a full list of destination countries see the Reference Data API Module: countries endpoint
serviceOptionCodeString Max length: 21OptionalUnique category code to identify the transaction method. NOTE: For a full list of accepted service option codes per destination country see the Reference Data API Module: service-options endpoint
serviceOptionRoutingCodeString Max length: 21OptionalUnique code to identify the individual transaction method. This field may only appear in quote if destination country requires sender to provide more detail on the routing information. NOTE: For a full list of accepted service option routing codes per destination country see the Reference Data API Module: service-options endpoint
sendAmount.valueString Min length: 0 Max length: 14 Max decimal Value: 3Required (Quote by Send)Quote by Send Amount value OR Quote by Receive Amount value
sendAmount.currencyCodeString Length: 3Required (Quote by Send)Send/Receive Currency ISO alpha-3 code NOTE: For a full list of transaction currency codes see the API Reference Data Module: currencies endpoint
receiveAmount.valueString Min length: 0 Max length: 14 Max decimal Value: 3Required (Quote by Receive)Quote by Send Amount value OR Quote by Receive Amount value
receiveAmount.currencyCodeString Length: 3Required (Quote by Receive)Send/Receive Currency ISO alpha-3 code NOTE: For a full list of transaction currency codes see the API Reference Data Module: currencies endpoint
originationCountryStringOptionalISO alpha-3 code of the origination country. This field is usually required for those partners having cross-country capabilities or partners having a different registration country vs. transaction country. For most partners this field is derived from the consumer IP address.
amountIncludesFeeBooleanOptionalIndicates if the 'Send Amount' in the request body is inclusive of the transaction fee. Default value: false.
thirdPartyIdString Max length: 16OptionalUnique code used to identify an intermediary partner.
promotionCodeString Max length: 16OptionalDiscount code associated with a specific business promotion. NOTE: To receive the list of promotion codes contact your MoneyGram Relationship Manager
promotionCodeChannelString Max length: 16OptionalChannel associated with the promotion code. NOTE: To receive the list of promotion code channels contact your MoneyGram Relationship Manager
rewardsNumberString Max length: 16OptionalConsumer's loyalty program account number NOTE: For a full list of countries supporting Rewards see the Reference Data API Module: countries endpoint
customOrderingData.keyString Max length: 36OptionalDynamic field key
customOrderingData.valueString Max length: 256OptionalDynamic field value
purposeOfTransactionString Max length: 20OptionalIdentifies the Purpose of Transaction. This field is required for certain destination countries. NOTE: For a list of destination countries requiring the purposeOfTransaction field see the Reference Data API Module: countries endpoint
sourceOfFundsString Max length: 20OptionalIdentifies the Source of Funds. This field is required for certain destination countries. NOTE: For a list of destination countries requiring the sourceOfFunds field see the Reference Data API Module: countries endpoint
extendedDataDynamicOptionalDynamic field key/values



Response Fields

FieldTypeRequired/OptionalDescription
transactions.transactionIdString Max length: 36RequiredUnique identifier for the transaction resource
transactions.serviceOptionCodeString Max length: 21RequiredUnique category code to identify the transaction method NOTE: For a full list of accepted service option codes per destination country see the Reference Data API Module: service-options endpoint
transactions.serviceOptionNameString Max length: 50RequiredConsumer facing name to identify the transaction method
transactions.serviceOptionRoutingCodeString Max length: 21OptionalUnique code to identify the individual transaction method NOTE: For a full list of accepted service option routing codes per destination country see the Reference Data API Module: service-options endpoint
transactions.serviceOptionRoutingNameString Max length: 50OptionalUnique name to identify the individual transaction method
transaction.estimatedDeliveryStringRequiredEstimated delivery time of the transaction
transactions.sendAmount.amountString Min length: 0 Max length: 14 Max decimal Value: 3RequiredTransaction amount value and currency type excluding fees and exchange rate. NOTE: For Crypto partners this is the fiat currency for the BUY/Sell or Ramp-on/Ramp-off For a full list of transaction currency codes see the API Reference Data Module: currencies endpoint
transactions.sendAmount.feesString Min length: 0 Max length: 14 Max Decimal Value: 3RequiredFee Amount and Fee Currency applied to transaction (Fee Currency uses ISO alpha-3 code)
transactions.sendAmount.taxesString Min length: 0 Max length: 14 Max Decimal Value: 3OptionalTax Amount and Tax Currency applied to the Transaction by the the origin country (Tax Currency uses ISO alpha-3 code)
transactions.sendAmount.additionalCharges.typeCodeStringOptionalCode to indicate if the fee is to be collected by MoneyGram or the partner
transactions.sendAmount.additionalCharges.labelStringOptionalConsumer facing name to identify the charge type
transactions.sendAmount.additionalCharges.valueStringOptionalAdditional fee's amount
transactions.sendAmount.additionalCharges.currencyCodeStringOptionalAdditional fee's Currency (ISO alpha-3 code)
transactions.sendAmount.discountsApplied.totalDiscountString Min length: 0 Max length: 14 Max Decimal Value: 3OptionalTransaction discount amount applied and currency type excluding fees and exchange rate. Transaction Currency (ISO alpha-3 code)
transactions.sendAmount.discountsApplied.promotionDetailsString Min length: 0 Max length: 14 Max Decimal Value: 3OptionalDiscount code associated with a specific business promotion
transactions.sendAmount.totalString Min length: 0 Max length: 14 Max Decimal Value: 3RequiredTransaction Total Amount and Transaction Total Currency including fees, taxes and discount. (Transaction Total Amount uses ISO alpha-3 code)
transactions.receiveAmount.amountString Min length: 0 Max length: 14 Max Decimal Value: 3RequiredTransaction Received Amount and Transaction Receive currency (Transaction Total Amount uses ISO alpha-3 code)
transactions.receiveAmount.feesString Min length: 0 Max length: 14 Max Decimal Value: 3OptionalReceived Fee and Receive Currency applied to the transaction by the destination country (Transaction Total Amount uses ISO alpha-3 code)
transactions.receiveAmount.taxesString Min length: 0 Max length: 14 Max Decimal Value: 3OptionalTax Amount and Tax Currency applied to the Transaction by the the
transactions.receiveAmount.additionalCharges.typeCodeStringOptionalCode to indicate if the fee is to be collected by MoneyGram or the partner
transactions.receiveAmount.additionalCharges.labelStringOptionalConsumer facing name to identify the charge type
transactions.receiveAmount.additionalCharges.valueStringOptionalAdditional fee's amount
transactions.receiveAmount.additionalCharges.currencyCodeStringOptionalAdditional fee's Currency (ISO alpha-3 code)
transactions.receiveAmount.totalString Min length: 0 Max length: 14 Max Decimal Value: 3RequiredReceive Amount Total and Receive Transaction Currency to be picked-up/deposited in destination country including fees, taxes and discount (Transaction Total Amount uses ISO alpha-3 code)
transactions.receiveAmount.fxRateNumber Max Decimal Value: 6RequiredFX Rate applied to transaction
transactions.receiveAmount.fxRateEstimatedBooleanOptionalIndicates whether the Fx is "estimated" and amount, taxes and total cannot be guaranteed. The word "estimated" must appear before receiveAmount.amount, receiveAmount.fees, receiveAmount.taxes and receiveAmount.total only when true.