This guide will take a closer look at the intent creation, how to create, the required fields you need to send at the request, and optional fields you may want to send, depending on your scenario. Visit the Payment Components page if you aren't familiar with the intent concept.
There are two endpoints to create intents. Depending on your integration with MoneyHash, you will choose one of the options presented below:
Both endpoints are very similar. They share the same fields to perform the requests. However, the response will
provide different information when using each option. For example, only the Create Intent endpoint provides the
embed_url on the response, which
use to embed the payment operation into an iframe or redirect the customer.
You need to use one of the abovementioned endpoints to create an intent. To make an API call to MoneyHash, you need to provide the
X-api-key to authenticate your request. If you aren't familiar with the MoneyHash authentication, visit the Authentication page.
There are some mandatory fields to create an intent that must be provided on the body request. The table below lists all the required fields and describes each one.
|The amount to charge.
|The currency of the amount is represented by a string of alphabetic code from ISO 4217 Currency codes.
|The type of the current intent. It can be one of
|A URL that the MoneyHash server will send POST requests to notify you of how the operation is progressing.
The optional fields are used to access different operations or to configure how the checkout will be presented to your customer. You can customize the appearance, hide information, or integrate customer information into the payment for further payment management and analysis, which are some configurations you can perform. For example, when creating an intent, you can set
payment_method to CARD and
form_only to true to allow customers to fill in their card information directly.
The table below presents all optional fields and their description.
|Key value pairs of any additional information you want to save with the payment.
|The name of a specific payment method you want to return for the user directly.
|This must be specified for card payments where the cardholder is not present (i.e., recurring or mail order/telephone order).
|Tokenize the card before payment if the card details were entered.
|The ID of a card token you wish to use to process the payment.
|Hides the payment amount overview side panel in the embed experience from the embed.
|Hides MoneyHash branding header from the returned embed.
|Returns the payment form only in the returned embed without any other payment choices, headers, and side panels. You need to provide the
payment_method or the
payment_provider in this case.
|Published flow-id that should be followed for this intent.
|Whether to use Direct API or Embed experience.
|Customer IP address, used with
|Flags the payment as a merchant-initiated transaction (MIT). It must be set to true for all MITs.
transaction id as UUID. Used to link the transaction to an existing series of transactions.
Some of the available options when using the optional fields are related to other MoneyHash functionalities, such as the case of
flow_id. If you need help using all available options, we recommend you check the Payment section after completing the integration, where we present all available payment processes you follow using MoneyHash.
Updated 3 months ago