# Add New Payment

`POST /api/payments`



- **Group:** Payments
- **Since:** v0.0.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/payments/post-payment/

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authtoken` | String | **required** | Authentication token, generated from admin area |

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `invoiceid` | String | **required** | Mandatory Invoice ID associated with the payment. |
| `amount` | String | **required** | Mandatory Payment amount. |
| `paymentmode` | String | **required** | Mandatory Payment mode (e.g., cash, credit card, etc.). |
| `paymentmethod` | String | optional | Optional Payment method details. |
| `note` | String | optional | Optional Additional payment note. |
| `transactionid` | String | optional | Optional Transaction ID. |
| `custom_fields` | String | optional | Optional Custom fields data. |

## Example request

```bash
curl -X POST "https://yoursite.com/api/payments" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "invoiceid": "...", "amount": "...", "paymentmode": "..." }'
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
{
  "paymentmode": true,
  "message": "Payment add successful."
}
```

## Error responses

### Error-Response:

```json
HTTP/1.1 404 Not Found
{
  "paymentmode": false,
  "message": "Payment add fail."
}
```

---

Perfex CRM REST API by Themesic Interactive. Full reference: /apiguide/
