Obtain a widget token for initialization
POST/partner/widget/start
Description
- It returns a widgetToken property that allows initializing the banca.me widget, and a validUntil property that represents the timestamp when the widget token will expire (milliseconds since epoch).
- The widgetToken is valid for 50 minutes and cannot be reused after expiration.
- If you send preApproveId in the request, the transaction will have a duration until the date represented by the validUntil property. You can check the lead state with the endpoint Retrieves loan details by external transaction ID
- If you DO NOT send preApproveId in the request, the widget will be rendered asking for an idNumber input.
- Right after the user submits the idNumber, the widgetToken will be refreshed and the transaction will reset its duration. You can then check the lead state with the endpoint Retrieves loan details by external transaction ID
- If the user abandons the transaction without submitting their idNumber, the validUntil property is useful to finish your open transactions since the previous mentioned endpoint will return a 404 status, because not lead will be created.
Required fields
- Without preApproveId:
amount,externalTrxId,entityIdandemailare required. - With preApproveId:
emailis optional (the email of the evaluation is used).amount,externalTrxIdandentityIdare required, unless a loan request was already created for the pre-approval with Create a loan request; in that case the amount of the loan request is used.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 412
- 413
- 422
- 503
Successful response
Bad Request. Possible causes:
- A loan already exists for
externalTrxId. - The merchant has no BNPL product configured.
entityIdis not the merchant of the pre-approval.- The pre-approval belongs to another partner.
emailis not a valid email.- The API token is not the current API token of the partner.
Unauthorized - Invalid or missing access token
Forbidden. Possible causes:
- The partner is not active.
- The partner does not have the placement access module.
- The merchant is not active.
- The merchant RUT is blacklisted.
Not Found. Possible causes:
- No merchant exists for
entityIdandnewEntityParamswas not sent or is incomplete. - The evaluation of the pre-approval was not found.
- The partner of the API token does not exist.
Precondition Failed. Possible causes:
amount,externalTrxIdorentityIdis missing and nopreApproveIdwas sent.- A
preApproveIdwithout a loan request was sent andamount,externalTrxIdorentityIdis missing. - The customer has an active loan that prevents a new one.
Payload Too Large - The pre-approval already has a signed loan request
Unprocessable Entity. The error code is returned in message:
ERR_MISSING_PHONE_OR_EMAIL:emailis missing and nopreApproveIdwas sent.ERR_PREAPPROVE_EXPIRED: the pre-approval is more than 14 days old.ERR_EXTERNAL_TRX_ID_MISMATCH:externalTrxIdis different from the externalTrxId of the evaluation of the pre-approval.ERR_INVALID_UUID_ID:preApproveIdis not 36 characters long.
Service Unavailable - The pre-approval could not be retrieved (for example, preApproveId does not exist)