> For the complete documentation index, see [llms.txt](https://docs.payengine.co/payengine-api-v2.5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payengine.co/payengine-api-v2.5/accounting/create-payment-link-1.md).

# Create Payment

## Post a payment to the accounting software

<mark style="color:green;">`POST`</mark> `https://<Platform-host>/api/merchant/:merchantId/accounting/payments`

Request

#### Request Body

| Name                                                      | Type      | Description                                                                                                                  |
| --------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>                      | string    | Unique ID assigned to the sales object (for reconciliation and trouble shooting)                                             |
| order\_number<mark style="color:red;">\*</mark>           | string    | The unique identifier assigned to the order sale. This will be used for linking the payment with the original account sales. |
| payment\_date<mark style="color:red;">\*</mark>           | timestamp | The date time representing the time of the payment (in GMT).                                                                 |
| payment\_methods<mark style="color:red;">\*</mark>        | array     | The collection of the payments object                                                                                        |
| payment\_methods.id<mark style="color:red;">\*</mark>     | string    | The unique identifier for the payment method                                                                                 |
| payment\_methods.name<mark style="color:red;">\*</mark>   | string    | The payment method name                                                                                                      |
| payment\_methods.description                              | string    | Additional notes/description for the payment method                                                                          |
| payment\_methods.amount<mark style="color:red;">\*</mark> | float     | The total Amount of the payment received.                                                                                    |
| customer                                                  | array     | The customer object representing the customer details                                                                        |
| customer.id                                               | string    | The unique identifier for the customer                                                                                       |
| customer.name                                             | array     | Customer Name                                                                                                                |
| customer.name.first\_name                                 | string    | First name of the customer                                                                                                   |
| customer.name.last\_name                                  | string    | Last name of the customer                                                                                                    |
| customer.name.business\_name                              | string    | Business name of the customer                                                                                                |
| customer.email\_address                                   | string    | Email address of the customer                                                                                                |
| customer.address                                          | array     | Address object                                                                                                               |
| customer.address.street\_address                          | string    | The street address                                                                                                           |
| customer.address.city                                     | string    | City                                                                                                                         |
| customer.address.state                                    | string    | state                                                                                                                        |
| customer.address.zip\_code                                | string    | Zip/Postal code of the address                                                                                               |
| customer.address.country                                  | string    | Country of the customer address                                                                                              |
| customer.phone\_number                                    | string    | Customer phone number                                                                                                        |
| gratuity                                                  | float     | Gratuity amount                                                                                                              |
| service\_charge                                           | float     | Service charges, if any                                                                                                      |

{% tabs %}
{% tab title="200 " %}
{% tabs %}
{% tab title="Field Definitions" %}

<table><thead><tr><th width="194">Field Name</th><th width="120">Type</th><th width="215">Description</th><th>Required?</th></tr></thead><tbody><tr><td>transaction_reference</td><td>string</td><td>Transaction reference</td><td>Required</td></tr><tr><td>order_number</td><td>string</td><td>Order number of the sales</td><td>Required</td></tr><tr><td>payment_number</td><td>string</td><td>Reference number of the payment</td><td>Required</td></tr><tr><td>status</td><td>string</td><td>Allowed values - processed | failed</td><td>required</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request Body" %}

```json
{
  "id": 3858152,
  "order_date": "2022-06-30T20:24:02",
  "payment_date": "2022-06-30T20:24:02",
  "payment_methods": [
    {
      "id": "23423432"
      "name": "Cash",
      "amount": "112.50"
    }
  ],
  "customer":{
    "name":{
        "first_name":" first Name",
        "last_name": " last name"
    }
  },
  "gratuity": 0
}
```

{% endtab %}

{% tab title="Sample Response Body " %}

```json
{
  "transaction_reference": "guid",
  "order_number": "3858152",
  "payment_number": "3858154",
  "status": "processed"
}
```

{% endtab %}
{% endtabs %}
