# Create Transaction

### Overview

This endpoint allows you to initiate a payment transaction. Ensure your request includes all required parameters and valid authorization headers to process the payment successfully.

### HTTP Request

<pre class="language-bash"><code class="lang-bash"><a data-footnote-ref href="#user-content-fn-1">POST</a> https://malum.co/api/v2/payment/create
</code></pre>

### Headers

| Header | Value                        |
| ------ | ---------------------------- |
| MALUM  | `{BUSINESS_ID}:{SECRET_KEY}` |

### Request Body

Send data in JSON format. The following table outlines all parameters, noting which are required:

<table><thead><tr><th width="214">Parameter</th><th>Type</th><th width="143">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>amount</code></td><td>float</td><td>Yes</td><td>Amount to be collected.</td></tr><tr><td><code>currency</code></td><td>string</td><td>Yes</td><td>Currency code (e.g., EUR, USD, JPY, AUD, GBP, RUB).</td></tr><tr><td><code>customer_email</code></td><td>string</td><td>Yes</td><td>Email address of the customer.</td></tr><tr><td><code>cancel_url</code></td><td>string</td><td>Yes</td><td>URL to navigate to if the transaction is cancelled.</td></tr><tr><td><code>success_url</code></td><td>string</td><td>Yes</td><td>URL to redirect the customer to after successful payment.</td></tr><tr><td><code>webhook_url</code></td><td>string</td><td>Yes</td><td>URL to send webhook notifications to.</td></tr><tr><td><code>buyer_pays_fees</code></td><td>boolean</td><td>No</td><td>Whether the customer should pay the merchant fee.</td></tr><tr><td><code>metadata</code></td><td>string</td><td>No</td><td>Additional metadata about the transaction (max 255 chars).</td></tr><tr><td><code>product_title</code></td><td>string</td><td>No</td><td>Product title, max length 32 chars</td></tr><tr><td><code>product_description</code></td><td>string</td><td>No</td><td>Product description, max length 800 chars</td></tr><tr><td><code>product_link</code></td><td>string</td><td>No</td><td>"<a href="https://malum.co/">https://malum.co/</a>" link to product, max length 255 chars</td></tr><tr><td><code>product_image</code></td><td>string</td><td>No</td><td>"<a href="https://placehold.co/600x400">https://placehold.co/600x400</a>" link to an image of the product, max length 255 chars</td></tr><tr><td><code>product_markdown</code></td><td>string</td><td>No</td><td>Markdown product description supports bold, italic, links, images and youtube embeds, max length 2500 chars</td></tr><tr><td><code>merchant_pays_gw_fees</code></td><td>boolean or int</td><td>No</td><td>The value can be true or false | 1 or 0<br><br>If set the merchant pays the gateway fee and its own merchant fee instead of the customer</td></tr></tbody></table>

### Success Response

A successful request returns the following JSON structure:

```json
{
  "status": "success",
  "bpf": false,
  "transaction_id": "TRN_XXXXXXXXX",
  "link": "https://malum.co/checkout/TRN_XXXXXXXXX",
  "timestamp": 10000000
}
```

### Error Response

An unsuccessful request returns the following JSON structure, indicating the nature of the error:

```json
{
  "status": "failed",
  "error": "Amount is too high.",
  "timestamp": 10000000
}
```

### Additional Notes

* Ensure that all required parameters are included in your request.
* The `Authorization` header should be properly formatted with your business ID and secret key.

<br>

[^1]: POST Request
