201Successful Response
Schema: SuccessEnvelope_MigrationBuildResponse_
successbooleanmessagestringcodestringdataMigrationBuildResponse
/api/v1/credit/programs/{program_id}/loans/import/from-partner-pullSandbox only: pulls are kept on a sandbox business (CREDIT_090 elsewhere), so this is the console's rehearsal of the cut-over; the live book is built from the same files by an operator script. Reads the pull's merchants and transactions tables and builds the launch import (Appendix E): one row per loan with a balance, keyed on the Brex transaction id; its paid amounts are what Tie's system assessed less what it reports outstanding, per loan or from the merchant's balance split over its loans oldest first (D-58); its interest good through pull_date and, above the program's ceiling, loaded at the ceiling (D-59). With since, the tail: the transactions that posted from that date, loaded as they posted (D-60). The file is staged on the program's loan import, and run is what to send with staging_id to POST /credit/programs/{id}/loans/import for the dry run and the apply. report is the exceptions report: rows refused and why, the lines and which are not open yet, interest reduced to the ceiling, loans repaid before cut-over (phase 2), and the control totals. open_lines also opens each merchant's line with its own terms, a merchant with no balance included, and sets its email, legal name and address; send it before the apply. 400 CREDIT_770 when since is after pull_date, CREDIT_771 when nothing would be imported, CREDIT_772 for a mapping field the builder does not read, CREDIT_773 for a cut-over pull with no merchants table.
Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.
program_idstringrequiredThe program to stage the file on.
Schema: MigrationFromPullRequest
pull_idstringrequiredThe pull (GET /credit/sandbox/partner-pulls).
pull_datestring · daterequiredThe day the pull is as at the close of. Every row's interest is good through it (accrued_through, D-59), and the import runs as at the day after.
sincestring · dateThe tail (D-60): only transactions that posted on or after this date, each loaded as it posted. Null for the cut-over import.
rolesobjectRole → table name, overriding the pull's: transactions, merchants.
mappingMigrationFieldMapping | stringThe partner's field names, laid over the defaults; auto works them out from the tables (a money field only on a header that is one of its names).
balance_basisstringWhere the outstanding figures are read (D-58): loan from each transaction, merchant from the merchant's balance (split over its loans oldest first), auto per loan for a merchant whose every loan carries a figure, else the merchant's.
One of: auto, loan, merchant
line_keystringWhich line id carries Tie's merchant id. external_line_id (the default) opens each line under it, idempotently.
One of: external_line_id, external_merchant_id
open_linesbooleanAlso open each merchant's line with its own terms, and set its email, legal name and address from the merchants table (as PATCH /credit/lines/{id} does). Off: nothing is written but the staged file, and run opens placeholder lines inside the dry run.
Schema: SuccessEnvelope_MigrationBuildResponse_
successbooleanmessagestringcodestringdataMigrationBuildResponseSchema: 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.