201Run in the request: the per-line results, the totals against the control totals, and the report id.
Schema: SuccessEnvelope_ProgramLoanImportResponse_
successbooleanmessagestringcodestringdataProgramLoanImportResponse
/api/v1/credit/programs/{program_id}/loans/importFans the staged rows out to each line's loan import (1,000 rows per call) under one savepoint. With dry_run (the default), or any control total that does not match across the whole file, nothing is written, not one line; otherwise every line is written together. create_missing_lines opens a line for each key the program lacks, with line_defaults, through the ordinary line opening (so the program's limit envelope applies); a refusal rejects that line's rows. mode says where it runs: in the request (201 with the per-line results, the totals against the control totals, and the report id), or as a background job (202 with the batch, status running; poll GET /credit/import-batches/{id} for its progress and, when it finishes, the same result). auto, the default, runs up to 1,000 rows in the request. One run at a time per program. Operator action: an API token receives 403.
Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.
program_idstringrequiredSchema: ProgramLoanImportRequest
staging_idstringrequiredThe batch from the parse step.
dry_runbooleanRun every line and report, then write nothing. On by default.
as_ofstring · dateLoan status is assessed as at this date. Today.
expected_countintegerRows the source file holds. A different count writes nothing.
expected_principal_centsintegerOriginal principal summed over the file.
expected_outstanding_centsintegerOutstanding summed over the file: principal, fee and accrued interest, less what was paid or credited; written-off loans count as zero.
create_missing_linesbooleanOpen a line for each key the program does not have yet.
line_defaultsImportLineDefaultsTerms for the lines create_missing_lines opens.
modestringsync runs the file in the request and answers with the result. async queues it as a background job and answers 202 with the batch (status: running); poll GET /credit/import-batches/{id}. auto (the default) runs files of up to 1,000 rows in the request and larger ones as a job. sync is refused over 2,000 rows.
One of: sync, async, auto
allow_cross_line_duplicatesbooleanA row whose original transaction id is already on a different line of the program is rejected (most likely a loan imported before under another merchant key), on a dry run as on an apply. Set true to load such rows anyway; each is listed in warnings.
dry_run_tokenstringOn an apply: the dry_run_token of the dry run you checked. The apply then runs only with exactly that dry run's inputs (as_of, the expected totals, create_missing_lines, line_defaults) under the mapping it ran with, and it must be the batch's last dry run; otherwise 400 CREDIT_690 and nothing runs. Optional.
Schema: SuccessEnvelope_ProgramLoanImportResponse_
successbooleanmessagestringcodestringdataProgramLoanImportResponsestatus running.Schema: SuccessEnvelope_ImportBatchResponse_
successbooleanmessagestringcodestringdataImportBatchResponseSchema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.
Schema: ErrorResponse
errorstringrequiredError category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.
messagestringrequiredHuman-readable explanation, safe to show to end users.
codestringrequiredStable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).
request_idstringCorrelation id for support requests. Echoes the x-request-id request header when one was supplied.
errorsobjectField-level validation messages keyed by field name. Present on 400/422 validation failures only.