Payments
The Payment object represents a payment record in your Custom Trades CRM account.
Endpoints
The Payment object
Attributes
uuidstringUnique identifier for the payment
payment_numberstring |nullPayment number
invoice_uuidUUIDInvoice UUID (required)
customer_uuidUUIDCustomer UUID
payment_typestringType: 'credit_card', 'ach', 'check', 'cash', 'other'
payment_methodstring |nullPayment method (e.g., 'visa', 'mastercard', 'bank_transfer')
amountnumberPayment amount (required)
processing_feenumberProcessing fee
net_amountnumberNet amount (amount - processing_fee)
payment_datestringPayment date (YYYY-MM-DD format)
transaction_idstring |nullTransaction ID
reference_numberstring |nullReference number (e.g., check number)
authorization_codestring |nullAuthorization code (for credit cards)
payment_detailsJSONB |nullAdditional payment details
notesstring |nullNotes
statusstringStatus: 'Pending', 'Completed', 'Failed', 'Refunded'
processed_atstring |nullProcessing timestamp
created_by_user_idUUIDUser ID who created the payment
created_atstringISO timestamp of creation
updated_atstringISO timestamp of last update
deleted_atstring |nullISO timestamp of soft deletion (null if not deleted)
THE PAYMENT OBJECT
{ "uuid": "123e4567-e89b-12d3-a456-426614174000", "payment_number": "PAY-001", "amount": 500, "payment_type": "credit_card", "status": "Completed", "payment_date": "2025-01-15", "invoice": { "uuid": "...", "invoice_number": "INV-001" }}List payments
Returns a paginated list of payments for your company.
Parameters
include_deleted(boolean, default: false)requiredInclude soft-deleted payments
invoice_uuid(UUID)Filter by invoice
customer_uuid(UUID)Filter by customer
payment_type(string)Filter by payment type
status(string)Filter by status
page(number, default: 1)requiredPage number
limit(number, default: 50, max: 100)requiredItems per page
curl -G \ https://customtradescrm.com/api/v1/payments?invoice_uuid=123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer ctc_live_..."Response
{ "success": true, "data": { "payments": [ { "uuid": "123e4567-e89b-12d3-a456-426614174000", "payment_number": "PAY-001", "amount": 500, "payment_type": "credit_card", "status": "Completed", "payment_date": "2025-01-15", "invoice": { "uuid": "...", "invoice_number": "INV-001" } } ], "pagination": { "page": 1, "limit": 50, "total": 1, "total_pages": 1 } }}Get a payment
Returns a specific payment by UUID with related invoice and customer information.
curl -G \ https://customtradescrm.com/api/v1/payments/123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer ctc_live_..."Create a payment
Creates a new payment record. **Request Body:**
Parameters
invoice_uuid(string)requiredInvoice UUID (must belong to your company)
payment_type(string)requiredPayment type ('credit_card', 'ach', 'check', 'cash', 'other')
amount(string)requiredPayment amount (must be > 0)
payment_date(string)requiredPayment date (YYYY-MM-DD format)
payment_method(string)Payment method (e.g., 'visa', 'mastercard', 'bank_transfer')
processing_fee(string)Processing fee (default: 0)
transaction_id(string)Transaction ID
reference_number(string)Reference number (e.g., check number)
authorization_code(string)Authorization code (for credit cards)
payment_details(string)JSONB object with additional details
notes(string)Notes
curl -G \ Response
{ "invoice_uuid": "123e4567-e89b-12d3-a456-426614174000", "payment_type": "credit_card", "payment_method": "visa", "amount": 500, "processing_fee": 15, "payment_date": "2025-01-15", "transaction_id": "txn_1234567890", "authorization_code": "AUTH123"}Update a payment
Updates a payment. All fields are optional (partial update). **Request Body:**
curl -G \ Response
{ "status": "Completed", "processed_at": "2025-01-15T10:00:00Z"}Delete a payment
Soft deletes a payment (sets `deleted_at` timestamp).
Error codes
| HTTP status code | Description |
|---|---|
| 200 | Success |
| 400 | Validation error |
| 401 | Unauthorized (invalid API key) |
| 403 | Forbidden (add-on required, IP restriction, or usage limit exceeded) |
| 404 | Payment not found |
| 500 | Server error |
curl -X DELETE \ https://customtradescrm.com/api/v1/payments/123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer ctc_live_..."