Payments
Payments
Payment management operations.
Record payments against invoices and credit notes.
Supports partial payments, credit note applications to invoices, and automatic payment status updates.
Create a new payment
/paymentsRecord a payment against an invoice, credit note, or both.
At least one document reference is required.
For type credit_note, both invoice_id and credit_note_id are required (applying credit to invoice).
Document payment totals are automatically updated.
Credit note payments cannot exceed the credit note total.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
Body parameters
Payment date in YYYY-MM-DD format
Custom key-value data for your own use. Store any JSON object up to 50 properties. Values must be strings up to 250 characters. Useful for storing external IDs, tags, or integration data.
curl -X POST "https://eu.spaceinvoices.com/payments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"invoice_id": "inv_abc123def456",
"amount": 1200,
"type": "cash"
}'{
"id": "pmt_abc123def456",
"invoice_id": "inv_abc123def456",
"credit_note_id": null,
"advance_invoice_id": null,
"amount": 1200,
"type": "cash",
"date": "2024-01-15T00:00:00.000Z",
"reference": null,
"note": null,
"entity_id": "ent_xyz789",
"metadata": {},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:30:00.000Z"
}List all payments
/paymentsRetrieve a paginated list of payments with optional filtering and sorting. Supports cursor-based pagination for efficient navigation, flexible JSON querying with MongoDB-style operators, full-text search, and sorting by various payment properties.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
Query parameters
Number of results per request.
Default: 10
Cursor to fetch the next page of results. Use the value from pagination.next_cursor in the previous response.
Cursor to fetch the previous page of results. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
JSON query object for filtering results. Supports MongoDB-style operators.
Supported operators:
- equals or direct value - Exact match (default)
- gte - Greater than or equal
- lte - Less than or equal
- gt - Greater than
- lt - Less than
- in - Value in array
- notIn - Value not in array
- contains - String contains (case-insensitive)
- startsWith - String starts with
- endsWith - String ends with
- between - Value between two numbers/dates [min, max]
Allowed fields: id, invoice_id, amount, type, date, reference, note, metadata, created_at, updated_at
Examples:
- {"total": {"gte": 1000}} - Invoices over 1000
- {"customer.name": {"contains": "Acme"}} - Customer name contains "Acme"
- {"date": {"between": ["2025-01-01", "2025-12-31"]}} - Date range
Full-text search query to filter results across multiple fields.
Searches are case-insensitive and match partial strings.
Searches across all text fields including names, descriptions, addresses, and metadata values.
Comma-separated list of relations to include in the response. Allowed: Invoice, CreditNote, AdvanceInvoice
curl "https://eu.spaceinvoices.com/payments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"data": [
{
"id": "pmt_abc123def456",
"invoice_id": "inv_abc123def456",
"credit_note_id": null,
"advance_invoice_id": null,
"amount": 1200,
"type": "cash",
"date": "2024-01-15T00:00:00.000Z",
"reference": null,
"note": null,
"entity_id": "ent_xyz789",
"metadata": {},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:30:00.000Z"
},
{
"id": "pmt_def789ghi012",
"invoice_id": "inv_abc123def456",
"credit_note_id": null,
"advance_invoice_id": null,
"amount": 600,
"type": "bank_transfer",
"date": "2024-01-10T00:00:00.000Z",
"reference": "TXN-2024-0015",
"note": "First installment payment",
"entity_id": "ent_xyz789",
"metadata": {
"source": "web_app",
"processor": "stripe"
},
"created_at": "2024-01-10T14:20:00.000Z",
"updated_at": "2024-01-10T14:20:00.000Z"
}
],
"pagination": {
"total": 2,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}Get payment by ID
/payments/{id}Retrieve a single payment by its unique identifier. Returns the complete payment details including amount, type, date, and reference information.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
Path parameters
Unique resource identifier
Query parameters
Comma-separated list of relations to include in the response. Allowed: Invoice, CreditNote, AdvanceInvoice
curl "https://eu.spaceinvoices.com/payments/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"{
"id": "pmt_def789ghi012",
"invoice_id": "inv_abc123def456",
"credit_note_id": null,
"advance_invoice_id": null,
"amount": 600,
"type": "bank_transfer",
"date": "2024-01-10T00:00:00.000Z",
"reference": "TXN-2024-0015",
"note": "First installment payment",
"entity_id": "ent_xyz789",
"metadata": {
"source": "web_app",
"processor": "stripe"
},
"created_at": "2024-01-10T14:20:00.000Z",
"updated_at": "2024-01-10T14:20:00.000Z"
}Update a payment
/payments/{id}Update an existing payment.
Only the provided fields will be updated.
Document references cannot be changed.
If amount is changed, payment totals on all linked documents are automatically recalculated.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
Path parameters
Unique resource identifier
Body parameters
Payment date in YYYY-MM-DD format
Custom key-value data for your own use. Store any JSON object up to 50 properties. Values must be strings up to 250 characters. Useful for storing external IDs, tags, or integration data.
curl -X PATCH "https://eu.spaceinvoices.com/payments/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"amount": 800
}'{
"id": "pmt_def789ghi012",
"invoice_id": "inv_abc123def456",
"credit_note_id": null,
"advance_invoice_id": null,
"amount": 800,
"type": "bank_transfer",
"date": "2024-01-10T00:00:00.000Z",
"reference": "TXN-2024-0016-UPDATED",
"note": "Updated payment note",
"entity_id": "ent_xyz789",
"metadata": {},
"created_at": "2024-01-10T14:20:00.000Z",
"updated_at": "2024-01-15T09:00:00.000Z"
}Delete a payment
/payments/{id}Delete a payment by its unique identifier. Payment totals on all linked documents (invoice, credit note) are automatically recalculated after deletion.
Header parameters
Entity ID on which the request is made. Optional - defaults to the first created entity if not provided.
Path parameters
Unique resource identifier
curl -X DELETE "https://eu.spaceinvoices.com/payments/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"