Create a Customer with a Payment
On this page, you find a guide on creating a new customer entity while starting a new payment process.
When a new customer is created along with the payment process, everything related to the transaction that is happening will already be connected to this new customer entity that was just created. You will also receive webhooks related to every step from customer.created
event to intent.processed
.
Creating a new customer
To start, you will create an intent using the Create Intent endpoint:
To create a customer when creating the intent, you need to provide additional information to the endpoint request. The required information is displayed in the table below:
Property | Type | Description |
---|---|---|
amount | Number | The amount to charge in the payment process. |
amount_currency | String | The currency of the amount is represented by a string of alphabetic codes from ISO 4217 Currency codes. |
operation | String | The type of the current intent. It can be one of purchase , authorize , or capture . |
webhook_url | String | A URL that the MoneyHash server will send a POST request to you when needed. |
create_customer | Boolean | Set this flag as true to inform MoneyHash that a customer needs to be created. |
customer_details | Object | The object with the details of the customer. |
customer_details.first_name | String | The customer's first name. |
customer_details.last_name | String | The customer's last name. |
customer_details.email | String | The customer's email address. |
customer_details.phone_number | String | The customer's phone number. |
customer_details.description | String | A description of the respective customer (optional). |
{
"amount": 50,
"amount_currency": "usd",
"operation": "purchase",
"create_customer": true,
"customer_details": {
"first_name": "test",
"last_name": "customer",
"email": "[email protected]",
"phone_number": "+201234567891",
"description": "test description"
},
"webhook_url": "https://webhook.site/b8954509-f628-4805-a4b4-58a0fb2be958"
}
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.
Updated 10 months ago