PUT Commit a Transaction
PUT /payout/v1/transactions/{transactionId}/commit
Development Guide
The 'Commit a Transaction API' executes the transactionId
and completes the payout of funds.
1. Prepare headers, authentication & parameters:
The application must call the 'Commit a Transaction'endpoint with a PUT HTTP method, providing the OAuth access_token
, the transactionId
as a path parameter and all other required headers.
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- The
transactionId
should have been returned on the previous Retrieve a Tansaction endpoint response.
Launch Code Example:
👉Payout - Commit a Transaction - HeadersOpen Recipe
2. Provide payoutId
in the request body:
payoutId
in the request body:To Update a Transaction, it is required to pass the refundId
which was returned on the previous Retrieve a Transaction API response and all other required fields.
Launch Code Example:
👉Payout - Commit a Transaction - payoutIdOpen Recipe
3. Make a request and handle the response:
The application must call the 'Update a transaction' endpoint with a PUT HTTP method and be able to handle the following response scenarios:
- Success | Parse the Response | 200 OK HTTP Status
When the 'Commit a transaction' endpoint responds with a 200 HTTP Status the application will have finalized and executed the Payout and the response will return thereferenceNumber
. The funds are marked for "settlement" on the MoneyGram ledger.
- Failed | Handle the Error | 400 Bad Request HTTP Status
When the 'Commit a Transaction' endpoint responds with 400 HTTP Status, specific error codes will be returned with an array of offending fields. The application will need to resolve these errors and resubmit the transaction for validation.
Note:
- In some scenario's, enhanced due diligence is need 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
- In some cases, send or receive side taxes may be applied. Learn More
- Only when the
"readyForCommit": true
, is returned can the application proceed to "Commit a Transaction" API and execute the payout of funds.
Launch Code Example:
👉Payout - Commit a Transaction - 200 OKOpen Recipe.
👉Payout - Commit a Transaction - 400 Bad RequestOpen Recipe
4. You're Done! Payout the transaction and provide a receipt:
The application is recommended to display the referenceNumber
clearly on the UI or a notification to customer. A receipt most be printed and handed to the customer.
Business Rules to Code:
Idempotent: If the application does not receive a response from the Commit a Transaction API within 10-40 seconds, the application must send the request again. This must be retried up to 3 times. If the retry attempt fails, check the
transactionStatus
using the Status API to confirm if transaction was successful.Error Code 935: If error code 935 internal system error is returned on commit, it must be handled the same way as if the commit response is not received (see item 2).
Handling Errors: Other errors can be returned on commit a transaction stopping the transaction. The application must handle scenarios where the transaction fails (an error code is returned) on commit. Learn More
Receipts: Refer to Receipts module for detailed information and requirements for receipts. Learn More
Reference Number Recycling policy: MoneyGram will recycle the reference numbers after the transactions have been closed/received for 4 to 6 months. If you are storing reference numbers in your database, you should also store the transaction date. The combination of the reference number and transaction date will be the unique key for a transaction.
API Structure
Header parameters
Name | Type | Required /Optional | Description |
---|---|---|---|
X-MG-ClientRequestId | String | Optional | Client 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-SessionId | String | Required | A GUID MoneyGram generates for correlating multiple calls within a transaction session. Note: The X-MG-SessionId is not required if the payoutId is passed in the request body. |
X-MG-ConsumerIPAddress | String | Optional | IP address of the system initiating the session. |
Query parameters
Field | Type | Required/ Optional | Description |
---|---|---|---|
targetAudience | String | Optional | Tailors 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 |
userLanguage | String | Required | Language used by the user/operator. |
agentPartnerId | String | Required | Unique agent or partner identifier. |
posId | String | Optional | Point of sale identifier of the client performing the API Call |
operatorId | String | Optional | Operator 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. |
Path parameters
Field | Type | Required/ Optional | Description |
---|---|---|---|
transactionId | String Max length: 36 | Required | Unique identifier for the transaction resource |
Request body
Field | Type | Required/ Optional | Description |
---|---|---|---|
partnerTransactionId | String | Optional | Partner’s unique session identifier |
payoutId | String | Required | Unique identifier for the transaction session Note: The payoutId is not required if the X-MG-SessionId is passed as a header parameter. |
additionalDetails | Dynamic | Optional | Dynamic field key/values |
Response fields
Field | Type | Required/ Optional | Description |
---|---|---|---|
referenceNumber | String Max length: 8 | Required | MoneyGram's reference number for the transaction |
Updated 15 days ago