Pay with a Customer Wallet

On this page, you will find a guide on how to allow your customer to use their wallet amount to execute payments, how to top up their wallet, and how to directly use their balance as the payment method.

Wallet operations

For every option we will present, you need to start at the creation of the intent using the Create Intent endpoint:

POST
/api/v1.1/payments/intent/

Showing the customer's wallet

Your customer may use the amount they have in their wallet when it is larger than the total payment amount. To be able to present your customers with their wallet, you need to add to the payload the respective customer's unique identifier:

PropertyTypeDescription
amountNumberThe amount to charge in the payment process.
amount_currencyStringThe currency of the amount is represented by a string of alphabetic codes from ISO 4217 Currency codes.
operationStringThe type of the current intent. It can be one of purchase, authorize, or capture.
webhook_urlStringA URL that the MoneyHash server will send a POST request to you when needed.
customerStringThe unique identifier of the customer.
{
  "amount": 50,
  "amount_currency": "usd",
  "customer": "c6c42108-293f-44c9-92fc-5d6ef2003b33",
  "operation": "purchase",
  "webhook_url": "https://webhook.site/b8954509-f628-4805-a4b4-58a0fb2be958"
}

For the example above, if the customer has a wallet amount larger than 50 USD, the wallet option will be presented as a payment method option.

Using a wallet directly

To directly choose the customer's wallet to execute the payment during the creation of the intent, you need to add the following fields to the payload:

PropertyTypeDescription
amountNumberThe amount to charge in the payment process.
amount_currencyStringThe currency of the amount is represented by a string of alphabetic codes from ISO 4217 Currency codes.
operationStringThe type of the current intent. It can be one of purchase, authorize, or capture.
webhook_urlStringA URL that the MoneyHash server will send a POST request to you when needed.
customerStringThe unique identifier of the customer.
use_walletBooleanAdding this flag as true will execute the payment with the customer's wallet amount without presenting the payment method selection to the customer.
{
  "amount": 50,
  "amount_currency": "usd",
  "use_wallet": true,
  "customer": "11dedf5a-92ea-4cca-8a48-a711a49f26dd",
  "webhook_url": "https://webhook.site/b8954509-f628-4805-a4b4-58a0fb2be958"
}

Top up a customer's wallet

MoneyHash allows your customer to top up the amount available in their wallet. To do this, you need to create an intent and add the following fields:

PropertyTypeDescription
amountNumberThe amount to charge in the payment process.
amount_currencyStringThe currency of the amount is represented by a string of alphabetic codes from ISO 4217 Currency codes.
operationStringThe type of the current intent. It can be one of purchase, authorize, or capture.
webhook_urlStringA URL that the MoneyHash server will send a POST request to you when needed.
customerStringThe unique identifier of the customer.
top_up_walletBooleanA flag that indicates the intention to top up the wallet amount with the respective intent.
{
  "amount": 50,
  "amount_currency": "usd",
  "top_up_wallet": true,
  "customer": "11dedf5a-92ea-4cca-8a48-a711a49f26dd",
  "webhook_url": "https://webhook.site/b8954509-f628-4805-a4b4-58a0fb2be958"
}

The intent created here allows your customer to execute a payment as any other, not to buy something but to store the amount paid in their wallet in MoneyHash's system.

From here, you are able to proceed with any integration except the HPP one.

Keep track of the webhook endpoint you sent within the request to see the progress of the payment process.