Payment Integration
Last updated: Mar 10, 2026
Payment Integration
# Payment Integration
Process payments through the Microdil API.
## Overview
Our payment API supports multiple payment methods and provides secure transaction processing.
## Process Payment
**Endpoint**: `POST /v1/payments`
**Request**:
```json
{
"amount": 99.99,
"currency": "USD",
"method": "card",
"card": {
"number": "4111111111111111",
"exp_month": 12,
"exp_year": 2027,
"cvc": "123"
},
"description": "Order #12345",
"metadata": {
"order_id": "12345",
"customer_email": "customer@example.com"
}
}
```
**Response**: `200 OK`
```json
{
"id": "pay_abc123",
"status": "succeeded",
"amount": 99.99,
"currency": "USD",
"created_at": "2026-03-10T15:30:00Z"
}
```
## Payment Methods
Supported payment methods:
- `card` - Credit/debit cards
- `bank_transfer` - Bank transfers
- `digital_wallet` - Digital wallets (PayPal, Apple Pay, Google Pay)
- `cash` - Cash payments
## Payment Statuses
- `pending` - Payment initiated
- `processing` - Payment being processed
- `succeeded` - Payment successful
- `failed` - Payment failed
- `cancelled` - Payment cancelled
- `refunded` - Payment refunded
## Refunds
**Endpoint**: `POST /v1/payments/{payment_id}/refund`
**Request**:
```json
{
"amount": 50.00,
"reason": "Product returned"
}
```
## Webhooks
Subscribe to payment events:
- `payment.succeeded` - Payment successful
- `payment.failed` - Payment failed
- `payment.refunded` - Payment refunded
## Security
- All payment data is encrypted in transit (TLS 1.2+)
- PCI DSS compliant
- Card data never stored on our servers
- 3D Secure supported for additional security