Fundings
Reference for the fundings resource. Requests follow the conventions in
Requests and Responses; fields you
receive and may write are filtered by your user's permissions, so responses can
contain a subset of the fields below.
Operations
| Operation | Request |
|---|---|
| List | GET /{profile}/user/v4/fundings |
| Fetch | GET /{profile}/user/v4/fundings/{id} |
| Create | POST /{profile}/user/v4/fundings |
| Update | PATCH /{profile}/user/v4/fundings/{id} |
| Delete | DELETE /{profile}/user/v4/fundings/{id} |
Required on create: link customer under data.relationships — a create that omits it is rejected with 422 naming the relationship.
How it works
A fundings record is a funding on a customer — a submission of that customer's account to a
funder, tracking the expected amount, funder, type, and progress/outcome. Gated by Customer
Funding at the customer's location.
You have full CRUD: create, read, edit (PATCH), and delete. The customer is linked on
create through the customer relationship. A funding's individual money movements are
funding_transactions, read with
GET /funding_transactions?funding_id={id}.
Creating a funding
curl -X POST "https://portal.securitytrax.com/acme/user/v4/fundings" \
-H "Authorization: Bearer stx_acme_..." \
-H "Content-Type: application/json" \
-d '{"data":{"attributes":{"funder_id":3,"funding_type_id":1,"amount_expected":"1200.00"},"relationships":{"customer":{"data":{"type":"customers","id":100}}}}}'
| Field | Required | Notes |
|---|---|---|
customer (relationship) |
Yes | The customer the funding is for. |
funder_id |
Yes | The funder (who funds the account). |
funding_type_id |
No | Defaults to the standard type. |
funding_progress_status_id, funding_outcome_id, funder_reason_id |
No | Progress/outcome tracking. |
amount_expected |
No | Numeric, up to ±99,999.99. |
date_expected |
No | When funding is expected. |
grade_info, note |
No | Free text (grade_info ≤ 255 chars). |
Editing / deleting
PATCH /fundings/{id} updates any of the fields above. DELETE /fundings/{id} soft-deletes the
funding (and it drops out of reads).
Reading fundings
GET /fundings?customer_id={customerId} lists a customer's fundings (filters: customer_id,
funder_id, funding_progress_status_id; sort: id, customer_id, funder_id, amount_expected,
date_expected, created_at; ?count_only=true for the total). A customer's fundings are also
reachable via GET /customers/{id}?include=funding; read a funding's transactions with
GET /funding_transactions?funding_id={id}.
Fields
Fields are grouped by the permission that gates them. A group you may not view
is absent from responses; a group you may not write is rejected with 422 when
sent in a write.
Funding
View: Customer Funding at the record's location. Create: Customer Funding at the record's location. Update: Customer Funding at the record's location.
| Field | Type | Writable | Validation |
|---|---|---|---|
customer_id |
integer | Create, update | min 0 |
funder_id |
integer (nullable) | Create, update | Required on create; min 1 |
funding_type_id |
integer (nullable) | Create, update | min 1 |
funding_progress_status_id |
string (nullable) | Create, update | Required on create; max length 100 |
funding_outcome_id |
string (nullable) | Create, update | max length 100 |
funder_reason_id |
integer (nullable) | Create, update | min 0 |
amount_expected |
string (nullable) | Create, update | max length 99999; min length -99999 |
note |
string (nullable) | Create, update | — |
grade_info |
string (nullable) | Create, update | max length 255 |
date_expected |
string (nullable) | Create, update | — |
created_at |
string (nullable) | Read-only | — |
created_by |
integer | Read-only | — |
updated_at |
string (nullable) | Read-only | — |
updated_by |
integer | Read-only | — |
Pagination
The list endpoint uses client-controlled offset pagination: ?page= (1-based) and
?per_page= (default 25, max 100). The response mirrors
meta.pagination (page, per_page, total, last_page) and sends an RFC5988
Link header; follow rel="next" to walk pages. See
Pagination.
Filters
The list endpoint accepts these query-param filters: customer_id, funder_id, funding_progress_status_id.
An unsupported filter parameter returns 422. See
Filtering collections
for matching semantics.
Sorting
GET .../fundings?sort= orders the list by: id, customer_id, funder_id, amount_expected, date_expected, created_at.
Prefix a field with - for descending; comma-separate for tie-breakers. An
unsupported field returns 422. See
Sorting collections.
Related
- Requests and Responses — envelope, errors, pagination, and rate limits.
- Authentication — tokens and the
Authorizationheader.