POST Create a Transaction with Auto Commit

POST /disbursement/v1/transactions

Overview

The Create a Transaction with Auto Commit API accepts all data required for transaction from a business partner's system. It validates the data for compliance purposes and automatically executes (auto-commits) the transaction without calling the quote, and update APIs. It responses with a transactionId resource and referenceNumber for the transaction.




Development Guide

  1. Prepare the headers & authentication

    The application must call the 'Create a transaction with Auto-Commit' endpoint with a POST HTTP method, providing the OAuth access_token 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 access_token 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


curl --request POST \
     --url https://sandboxapi.moneygram.com/disbursement/v1/transactions \
     --header 'X-MG-ClientRequestId: 4c79b06f-a2af-4859-82c8-28cbb0bf361b' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer ***************************' \
     --header 'content-type: application/json' \
     --data '

  1. Provide body payload: Transact by send amount" OR "Transact by receive amount"

    The the application must use the oneOf Keyword to transact by send or receive amount.

    • Option 1 - Transact by send amount: The application must provide at a minimum the following fields: targetAudience, agentPartnerId, destinationCountryCode , serviceOptionCode, sendAmount.value, sendAmount.currencyCode, receiveCurrencyCode, business sender and beneficiary information.

      OR

    • Option 2 - Transact by receive amount: The application must provide at a minimum the following fields: targetAudience, agentPartnerId, destinationCountryCode , serviceOptionCode, receiveAmount.value, receiveAmount.currencyCode, sendCurrencyCode, business sender and beneficiary information.

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


{
  "targetAudience": "AGENT_FACING",
  "agentPartnerId": "30151518",
  "userLanguage": "EN-US",
  "destinationCountryCode": "USA",
  "destinationCountrySubdivisionCode": "US-TX",
  "serviceOptionCode": "BANK_DEPOSIT",
  "serviceOptionRoutingCode": "74261037",
  "autoCommit": true,
  "sendAmount": {
    "value": 100,
    "currencyCode": "USD"
 },
"receiveCurrencyCode": "USD"
{
  "targetAudience": "AGENT_FACING",
  "agentPartnerId": "30151518",
  "userLanguage": "EN-US",
  "destinationCountryCode": "USA",
  "destinationCountrySubdivisionCode": "US-TX",
  "serviceOptionCode": "BANK_DEPOSIT",
  "serviceOptionRoutingCode": "74261037",
  "autoCommit": true,
  "receiveAmount": {
    "value": 100,
    "currencyCode": "USD"
 },
 "sendCurrencyCode": "USD"

  1. Provide discounts to the request body (optional)

    The Create API with Auto-Commit also allows the application to apply promotional discounts to accrue/redeem discounts. If a promotionCodes is passed a discount will be applied to the transaction.

{
  "promotionCodes": [
    "USD1ABCD"
  ],
 }

  1. Provide the Sender REQUIRED fields to the request body

    The the application must use the oneOf Keyword to provide the sender information. The application can use three oneOf options to provide sender information:

    • Option 1 - businessProfileId: For partner using MoneyGram profile, the applications can provide MoneyGram businessProfileId. To use this option, the application must first call the Create Business Profile API to create a business profile at MoneyGram and generate a businessProfileId. The businessProfileId is a unique identifier of the business and will last the life time of the account.

      OR

    • Option 2 - partnerBusinessProfileId: For partners using their own profile, the application can pass their unique profile identifier in the partnerBusinessProfileId . The application must first call the Create Business Profile API to create a business profile at MoneyGram and pass their unique partnerBusinessProfileId. MoneyGram will associate the partner's identifier with our business profile creation.

      OR

    • Option 3 - business: For partners using a account-free model, the application can pass all business sender fields in the business object.

"sender": {
   "businessProfileId": "123456789"
 }
"sender": {
   "partnerBusinessProfileId": "123456789"
 }
"sender": {
    "business": {
      "address": {
        "line1": "200 Main St",
        "city": "Dallas",
        "countrySubdivisionCode": "US-TX",
        "countryCode": "USA",
        "postalCode": "75001"
      },
      "contactDetails": {
        "phone": {
          "number": "5551231234",
          "countryDialCode": "1"
        },
        "email": "[email protected]"
      },
      "partnerBusinessProfileId": "654123987",
      "businessName": "Company A",
      "legalEntityName": "Company A LLC",
      "businessType": "CLOTHING",
      "businessRegistrationNumber": "987654321",
      "businessIssueDate": "2010-10-10",
      "businessCountryOfRegistration": "USA"
    }
  }

  1. Provide the Beneficiary REQUIRED fields to the request body

    The the application must use the oneOf Keyword to provide the beneficiary . The application can use two oneOf options to provide beneficiary information, depending on whether the application is performing a B2B or B2C transaction:

    • Option 1 - business: For partner performing a Business-to-Business (B2B) transaction, the application can provide business details as the beneficiary.


      OR

    • Option 2 - consumer: For partner performing a Business-to-Consumer (B2C) transaction, the application can provide consumer details as the beneficiary.

"beneficiary": {
  "business": {
		  "partnerBusinessProfileId": "654123987"
      "businessName": "ACME Hotels",
      "legalEntityName": "ACME Hotels",
      "businessType": "ACCOMMODATION_HOTELS",
      "businessRegistrationNumber": "564897231",
      "businessCountryOfRegistration": "USA",
      "address": {
          "line1": "123 Main St",
          "city": "Dallas",
          "countrySubdivisionCode": "US-TX",
          "countryCode": "USA"
      },
      "contactDetails": {
          "email": "[email protected]",
          "phone": {
              "number": "5551231234",
              "countryDialCode": "1"
          }
      }
  }
"beneficiary": {
  "consumer": {
    "name": {
      "firstName": "Sally ",
      "lastName": "Smith"
    },
    "mobilePhone": {
      "number": "5551231234",
      "countryDialCode": "1"
    },
    "personalDetails": {
      "dateOfBirth": "1980-01-01",
      "birthCountryCode": "USA"
    },
    "email": "[email protected]"
  }
}

  1. Provide the Transactional REQUIRED fields to the request body:

    The application must provide transactional REQUIRED fields.

"transactionInformation": {
    "purposeOfTransactionCode": "BUSINESS_EXPENSE",
    "sourceOfFundsCode": "SALARY_EMPLOY",
    "proofOfFundsCode": "PAYROLL_SLIP",
    "intendedUseOfMGIServicesCode": "BUSINESS_RELATED",
    "relationshipToBeneficiary": "BUSINESS_PARTNER"
  }

  1. Provide the Target Account REQUIRED fields to the request body (optional)

    If the funds are to be deposited into the beneficiary's bank account, wallet, or card, the targetAccount details must be provided.

    NOTE: To understand the required targetAccount fields for service option see the Reference Data: account-deposit-fields API.


"targetAccount": {
    "accountType": "22",
    "accountNumber": "987654321",
    "accountNumberVerification": "987654321",
    "bankCode": "123456789"
    }

  1. Provide "autoCommit": true to the request body:

For batch transaction the application must provide the "autoCommit": true . This indciation the application wishes to execute the transaction to MoneyGram with out viewing the quote. This is model is to be used when processing batch transactions.

"autoCommit": true

  1. Make a request and handle the response

    The application must call the 'Create a transaction with auto-commit' endpoint with a PUT HTTP method and provide all the required fields for the transaction. Prepare the Request The application must build to handle the following response scenarios:

    • Auto-Commit successful | 200 OK HTTP Status
      When the Create a transaction with auto-commit endpoint responds with a 200 HTTP Status the response will return typically including: referenceNumber, transactionId, serviceOptionName, serviceOptionRoutingName, sendAmount, sendCurrency, fees, fxRate, discountsApplied and the receiveAmount. In some cases, send or receive side taxes are applied.


      OR

    • Auto-Commit failed | 400 Bad Request HTTP Status
      When the Create a transaction with auto-commit endpoint responds with 400 HTTP Status, specific error code/s will be returned with an array of offending fields. The partner will need to resolve these errors and resubmit the transaction.

      NOTE: In some scenario's, enhanced due diligence is needed to be undertaken on the consumer. A specific error code will be returned and an array of offending fields. The fields/values need to be provided and resubmitted on the Update API for further checks


{
    "transactionId": "**********-**-****-****-************",
    "businessProfileId": "********",
    "serviceOptionName": "Bank Deposit - All Banks",
    "serviceOptionRoutingName": "All Banks",
    "referenceNumber": "********",
    "expectedPayoutDate": "2024-06-06",
    "sendAmount": {
        "amount": {
            "value": 100.00,
            "currencyCode": "USD"
        },
        "fees": {
            "value": 4.00,
            "currencyCode": "USD"
        },
        "taxes": {
            "value": 0,
            "currencyCode": "USD"
        },
        "additionalCharges": {
            "typeCode": "",
            "label": "",
            "value": 0,
            "currencyCode": "USD"
        },
        "discountsApplied": {
            "totalDiscount": {
                "value": 1.00,
                "currencyCode": "USD"
            },
            "promotionDetails": [
            {
              "code": "USD1ABCD",
              "discount": {
                "value": 1.00,
                "currencyCode": "USD"
              },
            }
           ]
        },
        "total": {
            "value": 103.00,
            "currencyCode": "USD"
        }
    },
    "receiveAmount": {
        "amount": {
            "value": 100.00,
            "currencyCode": "USD"
        },
        "fees": {
            "value": 0,
            "currencyCode": "USD"
        },
        "taxes": {
            "value": 0,
            "currencyCode": "USD"
        },
        "additionalCharges": {
            "typeCode": "",
            "label": "",
            "value": 0,
            "currencyCode": "USD"
        },
        "total": {
            "value": 100.00,
            "currencyCode": "USD"
        },
        "fxRate": 1,
        "fxRateEstimated": true
    }
}
{
    "errors": [
        {
          "category": "IP-40000",
          "code": "100",
          "message": "One or more missing fields.",
          "offendingFields": [
              {
                  "field": "destinationCountryCode"
              }
          ]
      }
  ]
}



Business Rules to Code

📘

  1. Enumerated fields: For all Enumerated Fields the transaction information must use only the valid enumerations returned from the enumerations API response. Learn More
  2. Bank, mobile wallet & card deposit service-options: The transaction information must include all the required fields for the selected bank, mobile wallet, or card deposit service option. The required fields all available service options can be found in the Reference Data account deposit-fields API.



Code Examples

const axios = require('axios');
const { v4: uuidv4 } = require('uuid');

const updateTransaction = async () => {

    // Step 1: Read configuration values with upmost security
    const token = "your_access_token_from_oauth_response"
    // For production - api.moneygram.com & For test - sandboxapi.moneygram.com    
    const host = "sandboxapi.moneygram.com";
    const transactionId = "current_transaction_id";
    const url = 'https://' + host + '/disbursement/v1/transactions';

    // Step 2: Create the PUT request headers & body
    const headers = {
        'Content-Type': 'application/json',
        'X-MG-ClientRequestId': uuidv4(), // New UUID for each request tracing
        'Authorization': 'Bearer ' + token,
    };
    const request = {
        agentPartnerId: "your_partner_id",
        targetAudience: "AGENT_FACING",
        userLanguage: "en-US",
        destinationCountryCode: "USA",
        destinationCountrySubdivisionCode: "US-MN",
        serviceOptionCode: "WILL_CALL",
        autoCommit: true,
        sendAmount: {
          value: 500,  
          currencyCode: "USD"    
        },
        receiveCurrencyCode: "USD",
        sender: {
          business: {
            businessName: "ACME",
            legalEntityName: "ACME",
            businessRegistrationNumber: "ACME2024",
            businessCountryOfRegistration: "USA",
            address: {
              line1: "100 Main St",
              city: "Springfield",
              countryCode: "USA"
            }
       }
    },
        beneficiary: {
   				 consumer: {
      				name: {
        	  	firstName: "Sally",
        			lastName: "Smith"
     			 },
     				address: {
        			line1: "200 Main St",
        			city: "Springfield",
        			countryCode: "USA"
      			}
    	}
  }

    try {
        // Step 3: Send the request and obtain the response
        axios.put(url, request, { headers })
            .then(function (response) {
                // Step 4: Parse the success response and process further
                // Verify readyForCommit is true, if yes, transaction is ready to commit
                console.log(JSON.stringify(response.data, null, 2))
            })
            .catch(function (error) {
                // Step 5: Parse the error response and handle the errors
                if (error.response) {
                    console.log('Response status:', error.response.status);
                    console.log('Response body:', error.response.data);
                } else {
                    // TODO: handle generic errors
                    console.error('Error:', error.message);
                }
            });
    } catch (error) {
        // TODO: handle exception
        console.error('Error:', error.message);
    }
};

updateTransaction();
import requests
import uuid
import json

def update_transaction():

    # Step 1: Read configuration values with upmost security
    token = "your_access_token_from_oauth_response"
    # For production - api.moneygram.com & For test - sandboxapi.moneygram.com    
    host = "sandboxapi.moneygram.com";
    transactionId = "current_transaction_id";
    url = 'https://' + host + '/disbursement/v1/transactions';

    # Step 2: Create the PUT request headers & body
    headers = {
        'Content-Type': 'application/json',
        'X-MG-ClientRequestId': str(uuid.uuid4()), # New UUID for each request tracing
        'Authorization': 'Bearer ' + token,
    }
    request = {
      'agentPartnerId': 'your_partner_id',
      'targetAudience': 'AGENT_FACING',
      'userLanguage': 'en-US',
      'destinationCountryCode': 'USA',
      'destinationCountrySubdivisionCode': 'US-MN',
      'serviceOptionCode': 'WILL_CALL',
      'autoCommit': true,
      'sendAmount': {
          'currencyCode': 'USD',
          'value': 500
      },
      'receiveCurrencyCode': 'USD',
      'sender': {
          'business': {
              'businessName': "ACME",
              'legalEntityName': "ACME",
              'businessRegistrationNumber': "ACME2024",
              'businessCountryOfRegistration': "USA",
                   'address': {
                      'line1': "100 Main St",
                      'city': "Springfield",
                      'countryCode': "USA"
              }
         }
    },
      'beneficiary': {
         'consumer': {
          'name': {
            'firstName': "Sally",
            'lastName': "Smith"
          },
           'address': {
            'line1': "200 Main St",
            'city': "Springfield",
            'countryCode': "USA"
          }
      }
    }

    try:
        # Step 3: Send the request and obtain the response
        response = requests.put(url, json=request, headers=headers)

        # Step 4: Parse the success response and process further
        if response.status_code == 200:
            parsed_response = json.dumps(json.loads(response.text), indent=2)
            print(parsed_response)
        else:
            # Step 5: Parse the error response and handle the errors
            print("Request failed with status code:", response.status_code)
            print(json.dumps(json.loads(response.text), indent=2))

    except requests.exceptions.RequestException as e:
        # Print any error that occurred during the request
        # TODO: handle exception
        print("An error occurred:", e)

update_transaction()
package disbursement;

import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonWriter;
import java.io.StringWriter;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.UUID;

public class UpdateTransaction {

    public static void main(String[] args) {
        // Step 1: Read configuration values with upmost security
        String token = "your_access_token_from_oauth_response";

        // For production - api.moneygram.com & For test - sandboxapi.moneygram.com
        String host = "sandboxapi.moneygram.com";
        String transactionId = "current_transaction_id";
        String tokenEndpoint = "https://" + host + "/disbursement/v1/transactions" 

        // Step 2: Create the PUT request headers & body
        // Create a JSON object
        JsonObjectBuilder sendAmountBuilder = Json.createObjectBuilder()
            .add("value", 500)
            .add("currencyCode", "USD");
        JsonObjectBuilder senderBuilder = Json.createObjectBuilder()
            .add("sender", "business")
            .add("businessName", "ACME")
            .add("legalEntityName", "ACME")
            .add("businessRegistrationNumber", "ACME2024")
            .add("businessCountryOfRegistration", "USA");
        JsonObjectBuilder beneficiaryBuilder = Json.createObjectBuilder()
            .add("beneficiary", "consumer")
            .add("name", Json.createObjectBuilder().add("firstName", "firstName").add("lastName", "lastName"))
            .add("address",Json.createObjectBuilder().add("line1", "line1").add("city", "city").add("countryCode", "countryCode"));
        JsonObjectBuilder requestBuilder = Json.createObjectBuilder()
            .add("agentPartnerId", "your_partner_id")
            .add("targetAudience", "AGENT_FACING")
            .add("userLanguage", "en-US")
            .add("destinationCountryCode", "USA")
            .add("destinationCountrySubdivisionCode", "US-MN")
            .add("serviceOptionCode", "WILL_CALL")
            .add("autoCommit", true)
            .add("sendAmount", sendAmountBuilder)
            .add("receiveCurrencyCode", "USD")
            .add("sender", senderInitiator)
            .add("beneficiary", beneficiaryBuilder);

        JsonObject jsonObject = requestBuilder.build();
        // Create a StringWriter to write the JSON string
        StringWriter stringWriter = new StringWriter();
        try (JsonWriter jsonWriter = Json.createWriter(stringWriter)) {
            jsonWriter.writeObject(jsonObject);
        }
        // Get the JSON string from the StringWriter
        String jsonString = stringWriter.toString();

        HttpClient httpClient = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(tokenEndpoint))
                .PUT(HttpRequest.BodyPublishers.ofString(jsonString))
                .setHeader("Authorization", "Bearer " + token)
                .setHeader("X-MG-ClientRequestId", String.valueOf(UUID.randomUUID()))
                .build();

        try {
            // Step 3: Send the request and obtain the response
            HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());

            // Retrieve the status code and body from the response
            int statusCode = response.statusCode();

            // Step 4: Parse the success response and process further
            if (statusCode == 200) {
                String responseBody = response.body();
                System.out.println(responseBody);
            } else {
                // Step 5: Parse the error response and handle the errors
                String responseBody = response.body();
                System.out.println(responseBody);
            }
        } catch (Exception e) {
            e.printStackTrace();
            // TODO: handle exception
        }
    }
}



API Request & Response Examples

curl --request PUT \
     --url https://sandboxapi.moneygram.com/disbursement/v1/transactions \
     --header 'X-MG-ClientRequestId: 4c79b06f-a2af-4859-82c8-28cbb0bf361b' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer ***************************' \
     --header 'content-type: application/json' \
     --data '
{
    "targetAudience": "AGENT_FACING",
    "agentPartnerId": "30151518",
    "userLanguage": "EN-US",
    "destinationCountryCode": "userLanguage",
    "destinationCountrySubdivisionCode": "US-TX",
    "serviceOptionCode": "BANK_DEPOSIT",
    "serviceOptionRoutingCode": "74261037",
    "autoCommit": true,
    "sendAmount": {
        "value": 100,
        "currencyCode": "USD"
    },
    "receiveCurrencyCode": "USD",
    "sender": {
        "businessProfileId": "123654789"
    },
    "beneficiary": {
        "business": {
            "businessName": "ACME Hotels",
            "legalEntityName": "ACME Hotels",
            "businessType": "ACCOMMODATION_HOTELS",
            "businessRegistrationNumber": "564897231",
            "businessCountryOfRegistration": "USA",
            "address": {
                "line1": "123 Main St",
                "city": "Dallas",
                "countrySubdivisionCode": "US-TX",
                "countryCode": "USA"
            },
            "contactDetails": {
                "email": "[email protected]",
                "phone": {
                    "number": "5551231234",
                    "countryDialCode": "1"
                }
            }
        }
    },
    "targetAccount": {
        "accountType": "22",
        "accountNumber": "987654321",
        "accountNumberVerification": "987654321",
        "bankCode": "123456789"
    }
}
{
    "transactionId": "**********-**-****-****-************",
    "businessProfileId": "********",
    "serviceOptionName": "Bank Deposit - All Banks",
    "serviceOptionRoutingName": "All Banks",
    "referenceNumber": "********",
    "expectedPayoutDate": "2024-06-06",
    "sendAmount": {
        "amount": {
            "value": 100,
            "currencyCode": "USD"
        },
        "fees": {
            "value": 4.00,
            "currencyCode": "USD"
        },
        "taxes": {
            "value": 0,
            "currencyCode": "string"
        },
        "additionalCharges": {
            "typeCode": "",
            "label": "",
            "value": 0,
            "currencyCode": "string"
        },
        "discountsApplied": {
            "totalDiscount": {
                "value": 0,
                "currencyCode": "string"
            },
            "promotionDetails": []
        },
        "total": {
            "value": 104,
            "currencyCode": "USD"
        }
    },
    "receiveAmount": {
        "amount": {
            "value": 100,
            "currencyCode": "USD"
        },
        "fees": {
            "value": 0,
            "currencyCode": "USD"
        },
        "taxes": {
            "value": 0,
            "currencyCode": "USD"
        },
        "additionalCharges": {
            "typeCode": "",
            "label": "",
            "value": 0,
            "currencyCode": "USD"
        },
        "total": {
            "value": 100,
            "currencyCode": "USD"
        },
        "fxRate": 1,
        "fxRateEstimated": true
    }
}



Support APIs

To make your development easier, MoneyGram has provided a Reference Data APIs Module that can be queried to provide a list of supported fields, values and associated meta-data to use in your integration.

NameHTTP MethodEndpointsDescription
Retrieve Account Deposit FieldsGET/reference-data/v1/account-depositRetrieves required fields for account deposit delivery option
Retrieve CountriesGET/reference-data/v1/CountryRetrieves supported values and metadata for countries
Retrieve Countries ISO3GET/reference-data/v1 /countries/{iso3Code}Retrieves supported values and metadata for countries by ISO 3 Code
Retrieve CurrenciesGET/reference-data/v1/currenciesRetrieves supported values and metadata for currencies
Retrieve EnumerationsGET/reference-data/v1/enumerationsRetrieves enumerated values for fields
Retrieve Identification DocumentsGET/reference-data/v1/identification-DocumentsRetrieves required fields for identification documents
Retrieve Service OptionsGET/reference-data/v1/payout-optionsRetrieves supported values and metadata for Service Options



API Structure


Header Parameters

NameTypeRequired
/Optional
Description
X-MG-ClientRequestIdStringRequiredClient Request ID that can be passed by the client application. Client request ID must be unique within a single session for unique requests. This attribute can be used for ensuring idempotent request processing for some APIs. MoneyGram recommends using a UUID for the value of this field.
X-MG-ConsumerIPAddressStringOptionalIP Address of the system initiating the session



Request Body Parameters


Body ParameterDescription
transactBySendAmountRequestAutoCommitTransact by send amount
transactByReceiveAmountRequestAutoCommitTransact by receive amount



Request Body Fields

Partner Information, Service Option, Destination, Amounts

FieldTypeRequired
/Optional
Description
targetAudienceStringRequiredTailors MoneyGram’s error messages and field metadata to an in-store, digital or crypto customer. (Enumerated value)

NOTE: For a full list of accepted target audience values. See the TARGET_AUDIENCE enumeration from the Reference Data Enumerations endpoint
agentPartnerIdString
Max length: 8
RequiredUnique identifier for the agent or partner
userLanguageString
Max length: 6
OptionalLanguage used by the user/operator
destinationCountryCodeString
Max Length: 3
RequiredTransaction Destination Country (ISO alpha-3 code)

NOTE: For a full list of accepted destination Countries and supported destinationCountrySubdivisionCode see Reference Data API Module: Retrieve Countries ISO3 endpoint
destinationCountrySubdivisionCodeString
Max length: 6
OptionalDestination state/province is conditionally required when transacting to certain destination countries. (ISO alpha-3 code)

NOTE: For a full list of accepted destination countries and supported destination country subdivision codes see Reference Data API Module: Retrieve Countries ISO3 endpoint
serviceOptionCodeString
Max length: 21
requiredUnique 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: 21
RequiredUnique identifier of the individual banking, wallet, or card provider for the service option.

NOTE: For a full list of accepted service option codes per destination country see the Reference Data API Module: service-options endpoint
autoCommitBooleanRequiredFlag to indicate the transaction will be committed automatically after the creation
sendAmount.valueString
Min length: 0
Max length: 14
Max Decimal Value: 3
RequiredTransaction amount and currency 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
sendAmount.currencyCodeString
Max length: 3
RequiredTransaction send currency code for a transactBySendAmountRequest
receiveCurrencyCodeString
Max length: 3
RequiredReceive Currency is needed when transacting to a destination country that supports more than one currency for a transactBySendAmountRequest (ISO alpha-3 code)
receiveAmount.valueString
Min length: 0
Max length: 14
Max Decimal Value: 3
RequiredTransaction receive amount excluding fees and exchange rate for a transactByReceiveAmountRequest Transaction Currency (ISO alpha-3 code)
receiveAmount.currencyCodeString
Max length: 3
RequiredTransaction receive currency code for a transactByReceiveAmountRequest (ISO alpha-3 code)
sendCurrencyCodeString
Max length: 3
OptionalReceive currency is needed when transacting to a destination country that supports more than one currency for a transactByReceiveAmount Request (ISO alpha-3 code)
promotionCodesString
Max length: 20
OptionalUnique code to apply a promotional discount

Sender oneOf Options:

The sender target="_blank""> "oneOf" options allow the application to collect the business sender information for a transaction using one of three options businessProfileId, partnerBusinessProfileId, or business


Option 1: sender.businessProfileId

FieldTypeRequired
/Optional
Description
sender.businessProfileIdStringOptionalA unique MoneyGram identifier for the business.

Option 2: sender.partnerBusinessProfileId

FieldTypeRequired
/Optional
Description
sender.partnerBusinessProfileIdStringOptionalThe partners business profileId that will be passed from the partner and mapped to the MoneyGram business profile Id.

Option 3: sender.business

FieldTypeRequired
/Optional
Description
sender.business.partnerBusinessProfileIdStringOptionalPartners business profileId this will be passed from the partner and mapped to the MoneyGram profileId.
sender.business.businessNameString
Min Length: 1
Max Length: 100
RequiredName of the business
sender.business.legalEntityNameString
Min Length: 1
Max Length: 100
RequiredThe legal name of the business
sender.business.businessTypeStringOptionalType of business
(Enumerated Values)
sender.business.businessRegistrationNumberStringRequiredBusiness registration number
sender.business.businessIssueDateStringOptionalDate of business formation
sender.business.businessCountryOfRegistrationString
Nin Length: 1
max Length: 20
RequiredBusiness's country of registration
sender.business.address.line1String
Min length: 1
Max Length: 30
RequiredResidence address line 2
sender.business.address.line2String
Min length: 1
Max length: 30
OptionalResidence address line 2 (if applicable)
sender.business.address.line2String
Min length: 1
Max length: 30
OptionalResidence address line 2 (if applicable)
sender.business.address.cityString
Min length: 1
Max length: 20
RequiredBusiness City
sender.business.address.countryCodeString
Length: 3
RequiredCountry of residence (ISO Alpha-3 Code)
sender.business.address.countrySubdivisionCodeString
Length: 6
OptionalState/province of business
sender.business.address.postalCodeString
Min length: 2
Max length: 6
OptionalPostal code/ZIP of business
sender.business.contactDetails.emailString
Min length: 1
Max length: 255
OptionalEmail address
sender.business.contactDetails.phone.numberString
Min length: 5
Max length: 14
OptionalBusiness phone number
sender.business.contactDetails.phone.countryDialCodeString
Min length: 1
Max length: 3
OptionalCountry calling code

NOTE: For country calling code see Reference Data API Module /countries endpoint phoneDialCodes

Beneficiary oneOf Options:

The beneficiary "oneOf" options allow the application to collect the beneficiary information for a transaction using one of two different options business, or consumer.


Option 1: beneficiary.business

FieldTypeRequired
/Optional
Description
beneficiary.business.partnerBusinessProfileIdStringOptionalPartners business profileId this will be passed from the partner and mapped to the MoneyGram profileId.
beneficiary.business.businessNameString
Min Length: 1
Max Length: 100
RequiredName of the business
beneficiary.business.legalEntityNameString
Min Length: 1
Max Length: 100
OptionalThe legal name of the business
beneficiary.business.businessTypeStringOptionalType of business
(Enumerated Values)
beneficiary.business.businessRegistrationNumberStringRequiredBusiness registration number
beneficiary.business.businessIssueDateStringOptionalDate of business formation
beneficiary.business.businessCountryOfRegistrationStringRequiredBusiness's country of registration
beneficiary.business.address.line1String
Min length: 5
Max length: 30
RequiredResidence address line 1
beneficiary.business.address.line2String
Min length: 1
Max length: 80
OptionalResidence address line 2 (if applicable)
beneficiary.business.address.line3String
Min length: 1
Max length: 80
OptionalResidence address line 3 (if applicable)
beneficiary.business.address.cityString
Min length: 1
Max length: 20
RequiredCity of residence
beneficiary.business.address.countrySubdivisionCodeString
Length: 6
OptionalState/province of residence

NOTE: For a full list of accepted countries and supported destination country subdivision codes see Reference Data API Module: Retrieve Countries ISO3 endpoint
beneficiary.business.address.countryCodeString
Length: 3
RequiredCountry of residence (ISO Alpha-3 Code)

NOTE: For a full list of accepted countries and supported destination country subdivision codes see Reference Data API Module: Retrieve Countries ISO3 endpoint
beneficiary.business.address.postalCodeString
Min length: 2
Max length: 6
OptionalPostal/Zip code of residence
beneficiary.business.contactDetails.emailString
Min length: 1
Max length: 255
OptionalEmail address
beneficiary.business.contactDetails.mobilePhone.numberString
Min length: 5
Max length: 14
OptionalPhone number
beneficiary.business.contactDetails.mobilePhone.countryDialCodeString
Min length: 1
Max length: 5
OptionalCountry calling code (ISO alpha-3 code)

Option 2: beneficiary.consumer

FieldTypeRequired
/Optional
Description
beneficiary.consumer.name.firstNameString
Min length: 1
Max length: 20
RequiredFirst Name
beneficiary.consumer.name.middleNameString
Min length: 1
Max length: 20
OptionalMiddle Name (if applicable)
beneficiary.consumer.name.lastNameString
Min length: 1
Max length: 30
RequiredLast Name
beneficiary.consumer.name.secondLastNameString
Min length: 1
Max length: 30
OptionalSecond Last Name
beneficiary.consumer.address.line1String
Min length: 0
Max length: 30
OptionalResidence address line 1
beneficiary.consumer.address.line2String
Min length: 0
Max length: 30
OptionalResidence address line 2 (if applicable)
beneficiary.consumer.address.line3String
Min length: 0
Max length: 30
OptionalResidence address line 3 (if applicable)
beneficiary.consumer.address.cityString
Min length: 0
Max length: 20
RequiredCity of residence
beneficiary.consumer.address.countrySubdivisionCodeString
Max Length: 6
OptionalState/province of residence.

NOTE: For a full list of accepted countries and supported destination country subdivision codes see Reference Data API Module: Retrieve Countries ISO3 endpoint
beneficiary.consumer.address.countryCodeString
Max length: 3
RequiredCountry of residence.

NOTE: For a full list of accepted countries and supported destination country subdivision codes see Reference Data API Module: Retrieve Countries ISO3 endpoint
beneficiary.consumer.address.postalCodeString
Min length: 2
Max length: 6
OptionalPostal code/ZIP of residence
beneficiary.consumer.contactDetails.mobilePhone.numberString
Min length: 5
Max length: 14
OptionalPhone number
beneficiary.consumer.contactDetails.mobilePhone.countryDialCodeString
Min length: 1
Max length: 5
OptionalCountry calling code (ISO alpha-3 code)

Transactional Information

FieldTypeRequired
/Optional
Description
transactionInformation.purposeOfTransactionCodeString
Min Length: 0
Max Length: 30
OptionalExplanation or reason for transferring funds (Enumerated Values)

NOTE: For a full list of accepted purpose of transaction values. See the PURPSE_OF_TRNSCTION enumeration from the Reference Data Enumerations endpoint
transactionInformation.sourceOfFundsCodeString
Min Length: 0
Max Length: 30
OptionalDeclaration of where the transaction funds were sourced.

NOTE: For a full list of accepted source of funds values. See the SOURCE_OF_FUNDS enumeration from the Reference Data Enumerations endpoint
transactionInformation.proofOfFundsCodeString
Min Length: 0
Max Length: 30
OptionalProof of where the transaction funds were sourced (Enumerated Values)

NOTE: For a full list of accepted source of funds values. See the PROOF_OF_FUNDS enumeration from the Reference Data Enumerations endpoint
transactionInformation.intendedUseOfMGIServicesCodeString
Min Length: 0
Max Length: 30
OptionalExplanation for using MoneyGram service (Enumerated Values)

NOTE: For a full list of accepted use of MGI services values. See the TYPICAL_USE_OF_MGI enumeration from the Reference Data Enumerations endpoint
transactionInformation.relationshipToBeneficiaryString
Min Length: 0
Max Length: 30
OptionalDeclaration of customer’s relationship to the sender (Enumerated Values)

NOTE: For a full list of relationships values. See the RELATIONSHP_TO_SNDR enumeration from the Reference Data Enumerations endpoint

Account Deposit

FieldTypeRequired
/Optional
Description
targetAccount.accountTypeStringOptionalBank account type
targetAccount.accountNumberStringOptionalA unique string of numbers, letters, or other characters which identify a specific bank account
targetAccount.accountNumberVerificationStringOptionalA unique string of numbers, letters, or other characters which identify a specific bank account
targetAccount.bankIdentifierStringOptionalBank Identifier Code (BIC) an 8 to 11-character code that is used to identify a specific bank when you make an international transaction
targetAccount.bankIdentifierWithLookupStringOptionalFor collecting the Indian Financial System Code (IFSC) or routing number for Bangladesh, with a lookup feature for these countries
targetAccount.bankNameStringOptionalBank's name
targetAccount.bankNameTextStringOptionalManually entered bank name if not provided in the bank name list
targetAccount.bankBranchNameStringOptionalManually entered bank branch name
targetAccount.bankCodeStringOptionalBank's routing number
targetAccount.bankBranchCodeStringOptionalManually entered receiver bank branch code
targetAccount.benefIdNumberStringOptionalReceiver identification number
targetAccount.accountExpirationMonthStringOptionalExpiration month of the account
targetAccount.accountExpirationMonthStringOptionalExpiration year of the account
targetAccount.receiverPurposeOfTransactionEmigrationFlagStringOptionalFlag to indicate if the purpose of transaction is for emigration
targetAccount.sendPurposeOfTransactionPartnerFieldStringOptionalExplanation or reason of the transferring funds (Enumerated Values)
targetAccount.receiverAccountIssueStatePartnerFieldStringOptionalState/province of the receiver (Enumerated Values)
targetAccount.additionalDetailsDynamic OptionalDynamic field key/values for the target account
additionalDetailsDynamicOptionalDynamic field key/values for the transaction

Additional Details

FieldTypeRequired
/Optional
Description
additionalDetailsDynamicOptionalDynamic field key/values for the transaction



Response Fields

FieldTypeRequired
/Optional
Description
transactionIdString
Max length: 36
OptionalUnique identifier for the transaction resource
businessProfileIdStringRequiredBusiness's unique MoneyGram identifier
serviceOptionNameString
Max length: 40
RequiredConsumer facing name to identify the transaction method
serviceOptionRoutingNameStringRequiredUnique name to identify the individual transaction method
referenceNumberStringRequiredMoneyGram's reference number for the transaction
expectedPayoutDateStringRequiredExpected payout date (Example value - YYYY-MM-DD
sendAmount.amountString
Max length: 14
RequiredTransaction amount and currency excluding fees and exchange rate. Transaction Currency (ISO alpha-3 code)

For Crypto partners this is the fiat currency for the BUY/Sell or Ramp-on/Ramp-off
sendAmount.feesString
Min length: 0
Max length: 14
RequiredFee Amount and Fee Currency applied to transaction (Fee currencyCode uses ISO alpha-3 code)
sendAmount.taxesString
Min length: 0
Max length: 14
OptionalTax Amount and Tax Currency applied to the Transaction by the the origin country (Tax currencyCode uses ISO alpha-3 code)
sendAmount.additionalCharges.typeCodeStringOptionalCode to indicate if the fee is to be collected by MoneyGram or the partner
sendAmount.additionalCharges.labelStringOptionalConsumer facing name to identify the charge type
sendAmount.additionalCharges.valueStringOptionalAdditional fee's amount
sendAmount.additionalCharges.currencyCodeStringOptionalAdditional fee's Currency (ISO alpha-3 code)
sendAmount.discountsApplied.totalDiscount.valueString
Min length: 0
Max length: 14
OptionalTransaction discount amount applied and currency type excluding fees and exchange rate. Transaction discount currencyCode (ISO alpha-3 code)
sendAmount.discountsApplied.totalDiscount.currencyCodeStringOptionalValue's Currency code (ISO alpha-3 code)
sendAmount.discountsApplied.promotionDetails.codeString
Min length: 0
Max length: 14
OptionalAdditional Details about the applied promotion to the transaction. currencyCode (ISO alpha-3 code)
sendAmount.discountsApplied.promotionDetails.discount.amountStringOptionalThe transaction's total discount applied.
sendAmount.discountsApplied.promotionDetails.discount.currencyCodeStringOptionalValue's Currency code (ISO alpha-3 code)
sendAmount.discountsApplied.promotionDetails.errorCodeStringOptionalError code defined by MoneyGram
sendAmount.discountsApplied.promotionDetails.errorMessageStringOptionalError message associated with the error code
sendAmount.totalString
Max length: 14
RequiredTransaction Total Amount and Transaction Total Currency including fees, taxes and discount. (Total currencyCode uses ISO alpha-3 code)
receiveAmount.amountString
Max length: 14
RequiredTransaction Received Amount and Transaction Receive currency. (Receive amount currencyCode uses ISO alpha-3 code)
receiveAmount.feesString
Min length: 0
Max length: 14
OptionalReceived Fee and Receive Currency applied to the transaction by the destination country. (Receve fee currencyCode uses ISO alpha-3 code)
receiveAmount.additionalCharges.typeCodeStringOptionalCode to indicate if the fee is to be collected by MoneyGram or the partner
receiveAmount.additionalCharges.labelStringOptionalConsumer facing name to identify the charge type
receiveAmount.additionalCharges.valueStringOptionalAdditional fee's amount
receiveAmount.additionalCharges.currencyCodeStringOptionalAdditional fee's Currency (ISO alpha-3 code)
receiveAmount.taxesString
Min length: 0
Max length: 14
OptionalTax Amount and Tax Currency applied to the Transaction by the the origin country. (Receive taxes currencyCode uses ISO alpha-3 code)
receiveAmount.totalString
Max length: 14
RequiredReceive Amount Total and Receive Transaction Currency to be picked-up/deposited in destination country including fees, taxes and discount (Receive total currencyCode uses ISO alpha-3 code)
receiveAmount.fxRateNumber
String
Min length: 0
Max length: 14
RequiredFx Rate applied to transaction
receiveAmount.fxRateEstimatedBooleanOptionalIndicates whether the Fx is “estimated” and amount, taxes and total cannot be guaranteed. The word “estimated” must appear before receiveAmount.amount, receiveAmount.taxes and receiveAmount.total only when true.