General API Information
Open API 3.0 Spec
All MoneyGram APIs are REST endpoints and are defined the standardized Swagger Specification. All MoneyGram OpenAPI Specifications are defined in YAML and can be imported to Swagger Editor.
Environments
MoneyGram API platform provides two distinct environments – Sandbox and Production. Both environments have distinct OAuth 2.0 credentials. To start development Sandbox credentails will be provided to you by MoneyGram. Production credentials will be provided after application certification has been completed.
- Sandbox Environment - https://sandboxapi.moneygram.com
MoneyGram provides a sandbox environment for developers to build and test the applications. This is a pre-production environment set up to allow development and QA teams to develop and test the integration with MoneyGram. A certification effort is done with MoneyGram before agents can access Production environment. In this environment, there is no real money movement and it does not impact customers.
- Production Environment - https://api.moneygram.com
MoneyGram provides this as a Live environment for developers. Developers don't test here, but for agents to start pilot/beta testing before full/complete rollout for real-time transactions. In this environment, real money transfers are live and they impact customers, agents and settlement.
Good to know:
Secure Client Credentials: The Client secret is a very sensitive piece of data as it could be used to impersonate your company on the MoneyGram APIs. It should be handled and stored with the utmost security.
URI Patterns
MoneyGram APIs use industry-best practices around URI (Universal Resource Identifier). Each REST API resource can be accessed by using a unique URI.
https://api.moneygram.com/<product-type>/<version>/<resource>/{resourceId}/<command>
|________________________|______________|_________|__________|____________|________|
base module version resource resourceId command
https://sandboxapi.moneygram.com/transfer/v1/transactions/{transactionID}/quote
|_______________________________|___________|____________|_______________|____|
base module resource resourceID command
https://api.moneygram.com/transfer/v1/transactions/{transactionID}/quote
|________________________|___________|____________|_______________|_____|
base module resource resourceID command
Guidelines
Base:
- Sandbox: https://sandbox.moneygram.com
- MoneyGram APIs are secured by hypertext transfer protocol secure (HTTPS)
- MoneyGram servers uses
HTTPS Port 443
Modules:
- A
<product-type>
is used to identify the module
examples: Transfer, Status, Refund, Amend, Payout, Disbursement
Versioning:
- MoneyGram will version the module for the entire product and not at the resource level.
Resources:
- Nouns are used to represent resources
- A resource may contain sub-collection resources
- A resource can be a singleton or a collection
- Plural names are used to denote the collection resource
Command Pattern:
- Use command pattern to explicitly indicate actions required during transaction flows.
Authentication & Authorization
MoneyGram uses an OAuth 2.0 framework. The application must use their OAuth client credentials to generate an access token and pass it as a header value in subsequent HTTP calls.
HTTP Methods
MoneyGram APIs support the following HTTP Methods:
HTTP Method | Definition |
---|---|
GET | Retrieve a resource |
POST | Create a resource |
PUT | Update an entire resource |
PATCH | Modify specific properties of a resource |
DELETE | Delete a resource |
API Parameters
MoneyGram APIs support the following parameters:
Path parameters
PUT https://sandboxapi.moneygram.com/transfer/v1/transactions/{transactionID}
Query parameters
GET https://sandboxapi.moneygram.com/status/v1/transactions/?referenceNumber={referenceNumber}
Header parameters
X-MG-ClientRequestId:{Value}
ISO Codes Supported
- When entering country values, the three-letter code (alpha-3) must be used. ISO 3166 Country Codes
- When entering currency values, the three-letter code (alpha-3) must be used. ISO 4217 Currency Codes
Good to know:
MoneyGram has provided a Reference Data API module that can be queried to provide a list of supported ISO standards and associated meta-data for the APIs. Below is a list of endpoints that will provide ISO values for country and currency fields:
Http Status
HTTP Method | Http Status | Description |
---|---|---|
POST, PUT, PATCH, | 200 - OK | The server successfully processed the request. The response will contain an entity describing or containing the result of the action. |
GET | 200 - OK | The server successfully processed the request. The response will contain an entity corresponding to the requested resource |
GET | 204 - No Content | The server successfully processed the request. The server successfully processed the request, and is not returning any content. |
POST, PUT, PATCH, GET | 400 - Bad Request | The server cannot or will not process the request due to an apparent client error. The response payload will include “ErrorDetails” object to indicate the issue with the request payload. This may indicate a system error, business error or malformed request syntax. |
POST, PUT, PATCH, GET | 500 - Internal Server Error | The server cannot process the request. |
Languages
Our APIs support the following languages. Enter the desired language code in the userLanguage
field for errors and other language-specific information to be translated.
Good to know:
Default language: If translation is not available English will be returned.
Language Code | Language |
---|---|
ar-SA | Arabic (Saudi Arabia) |
bg-BG | Bulgarian |
zh-CH | Chinese |
cs-CZ | Czech |
nl-NL | Dutch |
en-GB | English (United Kingdom) |
en-US | English (United States) |
fi-FI | Finnish |
fr-FR | French |
de-DE | German |
el-GR | Greek, modern |
hu-HU | Hungarian |
it-IT | Italian |
no-NO | Norwegian |
pl-PL | Polish |
pt-BR | Portuguese (Brazil) |
ro-RO | Romanian |
ru-RU | Russian |
sk-SK | Slovak |
es-MX | Spanish (Mexico) |
sv-SE | Swedish |
th-TH | Thai |
tr-TR | Turkish |
Development and Testing Do's and Don'ts
DO
- Your production credentials and URL will differ from those in the test environment.
- After certification signoff, your production credentials (secret and key) will be provided.
- Where applicable, review and follow the “Business rules to code” section for each API on the MoneyGram Developer Portal. These are additional rules/logic that must be built into the application.
- The maximum field lengths the system allows could be shorter than the documentation defines. For a send transaction, follow the maximum field length returned by the “Retrieve required and optional fields” endpoint in the Reference Data API.
- The fee and FX are only estimated at the time of the quote. The FX rate is guaranteed for 30 minutes from the time of the quote until the transaction is committed. However, the FX rate may change if the transaction is not committed within 30 minutes. Any exchange rate and fee provided to the customer from the quote should have a disclaimer that it’s subject to change.
- When in the pre-certification stage, please follow all instructions for each test case. If you cannot perform a specific task in a test case, please comment on why.
- When quoting by receive amount in the Transfers Quote API Endpoint, it is normal that the receive amount returned in the Response is slightly different from the one input in the Quote Request. This is due to the exchange rate, and the calculation does not allow for an exact match.
Don't
- An agent ID will be assigned to each partner. Do not hardcode the agent ID or security token.
- Don’t use the same agent ID to send and receive the same transaction.
- Don’t hardcode any of the customer data.
- Don’t use the same customer and transaction data in your testing. Our standard screening will identify the customer as high-risk and place the transaction on hold or reject it. After several transactions, change the consumer data (name, address, phone, birth date, photo ID number, etc.).
- Don’t schedule your go-live window on a Friday, weekend, or holiday. Go-live should be Monday through Wednesday.
Updated about 1 month ago