Customers
In MoneyHash, a "Customer" is a part of a merchant's payment network. They have the ability to make payments and store payment methods. Each customer has their own information associated with them, which is used to process payments for different payment methods.
There are great benefits of using and taking advantage of the customer's module offered by MoneyHash:
- Easily associate a transaction with their respective customer.
- Save customer billing details in their own entity to send them automatically to the payment provider. Improving the customer's experience.
- Faster checkouts with customer's saved tokenized cards.
- Quickly access all transactions executed by each customer.
Customer registration
You can register a new customer entity in MoneyHash by making an API call to the Create Customer endpoint:
You need to send the customer's information in the payload:
- For a regular customer entity:
Property | Type | Description |
---|---|---|
type | String | The type of customer entity. |
first_name | String | The customer's first name. |
last_name | String | The customer's last name. |
email | String | The customer's email address. |
phone_number | String | The customer's phone number. |
description | String | A description of the respective customer (optional). |
{
"first_name": "test",
"last_name": "customer",
"email": "[email protected]",
"phone_number": "+201234567891",
"description": "test description"
}
- For a company customer entity:
Property | Type | Description |
---|---|---|
type | String | The type of customer entity. E.g.: "COMPANY" . |
company_name | String | The company's name. |
contact_person_name | String | The name of a contact person from the company. |
tax_id | Number | The tax identification number. |
tax_rate | Number | The tax rate value. |
email | String | The company's email address. |
phone_number | String | The company's phone number. |
description | String | A description of the respective customer (optional). |
{
"type": "COMPANY",
"company_name": "test company name",
"contact_person_name": "test contact person name",
"tax_id": 0,
"tax_rate": 0,
"email": "[email protected]",
"phone_number": "+201234567891",
"description": "test description"
}
This process will create a new entity in the MoneyHash system. Each customer will have their own unique identifier (id
). This id
can be used for multiple things in MoneyHash, for example, tokenizing the customer's cards, creating a payment related to the respective customer, and using the customer's wallet to store their balance in different currencies.
Custom fields
When creating a new customer, you can store any metadata you wish to make part of the customer's entity in MoneyHash. To do this, you will need to add a custom_fields
property to the payload. This property needs to be an object
with key-value pairs defined by you. The values must be either string
, int
, float
or boolean
.
Filter customers by custom fields
As you define the custom fields, MoneyHash offers a way to find your customers by filtering based on your selected custom fields. To execute this filter, you need to make an API call to the following endpoint, adding the custom_fields
as a query parameter:
The way to construct the query parameter is custom_fields__<custom_field_key>=<custom_field_value>
. Where you need to replace <custom_field_key>
with the desired key, and <custom_field_value>
with the respective value to filter. The example above makes the query parameter like custom_fields__gender=male
.
Customer relation with transactions
Using the customer's module and creating customers, you can relate each payment inside MoneyHash to an individual customer. The benefits of this are centralizing the data of each customer in their entity, being able to, while the customer goes through a payment, have the ability to save their payment method to their entity, as well as being able to use their Wallets inside MoneyHash's system.
To take advantage of this, you need to relate each new intent you create to the customer by adding the customer identification to the payload. Ways to perform this can be found on a few pages, such as Pay with a card token and Pay with a customer wallet.
Payment methods
Customers' entities can store payment methods, such as card information, by tokenizing and saving their cards for a frictionless payment experience and enabling recurring payments without additional information. Each customer can have multiple saved cards connected to them, and each card token represents one individual physical card.
The tokenized cards will be stored in different vaults based on each provider's integration. There are three possible situations here, those being:
- Moneyhash’s vault: The card token will be saved only on MoneyHash's vault.
- Provider’s vault: The card token will be saved only on the provider's vault.
- Both vaults: The card token will be saved on both aforementioned vaults.
There are two different ways you can tokenize your customer's cards:
- Tokenize cards with payments: When a customer makes a payment, you can choose whether to tokenize their card information. The payments section on the Tokenize Cards page presents how to do this.
- Stand-alone Tokenization: You can create a process with the sole purpose of tokenizing and saving the customer's card in the system. You can learn how below.
Stand-alone tokenization
This is an option to tokenize and save a customer's card information without needing to start a payment process with the intent. To perform this, you need to start at the Create a Card Token endpoint:
You need to add to the payload the respective customer's the following properties:
customer
: The unique identifier of the customer.webhook_url
: A URL that the MoneyHash server will send a POST request to you when needed.
{
"customer": "0fbc1fcd-0206-46d1-8e3c-28491c17b3ce",
"webhook_url": "https://webhook.site/4d487d3a-2644-4e48-b985-46ccd7350a29"
}
This request will return with a JSON containing a embed_url
that can be used with the Embedded integration. MoneyHash executes the card information collecting process with the URL provided for PCI Compliance reasons.
With the webhook_url
furnished, you will receive the Webhooks events related to the progress of the tokenization to prepare your application to handle each situation.
Delete a card token
You might need to delete a customer's saved card from the vaults. To execute this, you need to request the following endpoint:
Replacing the parameters above with the data relating to the respective customer and card:
customer
: The unique identifier of the customer that owns the card.to_delete_customer_card_token
: The unique identifier of thesaved_card
that needs to be deleted.
Updated 12 months ago