# Credit Contracts Credit contracts contain the details of the financing agreement between the customer and Inbank. Once the contract is activated, the partner is to supply goods/services to the customer. ## Contract Printout - [GET /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/printouts](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/getprintouts.md): GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/printouts The details of the contract are included in the printout which can be retrieved using the GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/printouts endpoint. The response includes the link to the contract printout file. ## Contract Signing - [POST /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/signings](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/postsignings.md): POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/signings After the customer accepts the credit offer and has reviewed the contract, they can proceed to contract signing which is done via the POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/signings endpoint. There are the following signing methods available: - redirect - the method is used for contract signing by redirecting the client to a separate environment. The response to this request returns the URL to which the client should be redirected. The signing environment can be built into your site as an iFrame or just opened in a new browser tab. This signing method is available for the Inbank Hire Purchase payment product. - digital - the method is used in cases when the partner has a separate signing solution. The request with the digital signing method is used as a confirmation that signing has been successful. This signing method is available for the Inbank Hire Purchase payment product. - paper - the method is used if you are collecting paper contracts signed by the customer. This signing method is available for Split into parts and Inbank Hire Purchase payment products. - sms - with this method the signing is done using an SMS code. After you send the request, the customer will receive an SMS with the code from Inbank. After that, the code is sent over to Inbank for confirmation via the PATCH /contracts/:contract_uuid/signings request. This signing method is available for the Split into Parts payment products. - send_to_signing_sms and send_to_signing_email methods send a link to the Inbank environment where customers can sign the contract. The link is sent to the mobile number / email address which was indicated in the credit application. This signing method is available for the Inbank Hire Purchase payment product. ## Down Payment Link Retrieval - [POST /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/payment_link](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/postpaymentlink.md): POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/payment_link The down payment transfer is done via a redirect to the payment system. The link to the payment system can be retrieved via POST /payment_link. The link to which the customer is to be redirected is in the response to the request, redirect_url parameter. After the transfer is done, the customer is redirected back to the URL the partner indicates in the body of the request. As the next step, the customer is to be redirected to the payment system (redirect_url from the response) to complete the down payment transfer. The return URL sent in the body of the request should end with a status variable, for example - "return_url": "https://inbank.ee/session/:uuid/downpayment?status={status}". When redirecting the customer back, the payment system will fill that variable with one of the following values: - SUCCESS - the down payment has been made and the contract will be activated. If the flow includes partner approval, the partner can now approve the contract and the contract will then be activated. - FAILED - the down payment was not successful. The page the customer is redirected to can prompt to attempt the down payment once more. Note that initiating a new payment via POST /payment_link is needed for each attempt to make a down payment. - UNKNOWN - the status of the down payment is unconfirmed at the moment. In this case the down payment can yet succeed or fail. The page the customer is redirected to can inform that the down payment is yet to be verified. In case of the UNKNOWN status, the partner system needs to check at reasonable intervals if the down payment has been confirmed. This can be done using the GET /contracts/:contract_uuid API request. The response to this API request will contain the process_status parameter: - Until the down payment is confirmed, the process_status will remain in waiting_for_downpayment. Note that if the contract remains in the process_status of waiting_for_downpayment after the redirect with status UNKNOWN for more than 24 hours, we recommend contacting either Inbank or the customer. - Once the down payment has been confirmed, the process_status will change to activated, or waiting_for_partner_confirmation if the flow includes partner approval. ## Contract Merchant Approval - [POST /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/merchant_approval](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/postmerchantapproval.md): POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/merchant_approval If the flow includes merchant approval, the merchant checks if the status of the contract is signed using the GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid request. When the contract is in the signed status, the merchant needs to approve or cancel the contract. As processing customer signing might take some time, the endpoint may need to be polled once every second for a maximum of 15 seconds. To approve the contract, the e-shop needs to know the credit contract UUID, which is in the response to the POST/:application_uuid/accept request. The request does not require any parameters to be passed in its body. Note that you can also approve contracts in the Partner Portal. ## Contract Cancellation - [POST /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/cancel](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/cancelcontract.md): POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/cancel If the flow includes merchant approval, the merchant checks if the status of the contract is signed using the GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid request. When the contract is in the signed status, the merchant needs to approve or cancel the contract. As processing customer signing might take some time, the endpoint may need to be polled once every second for a maximum of 15 seconds. To cancel the contract, the e-shop needs to know the credit contract UUID, which is in the response to the POST/:application_uuid/accept request. The request does not require any parameters to be passed in its body. Note that you can also cancel contracts in the Partner Portal. ## Contract Status - [GET /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/getcontractuuid.md): GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid Once the credit contract UUID has been retrieved and the contract has been signed, the partner can check the status of the credit contract using the GET /partner/v2/shops/:shop_uuid/contracts/:contract_uuid request. The response will include the status parameter. If the status is activated, the purchase has been successfully financed by Inbank and the purchase items can be forwarded to the customer. If the flow includes merchant approval, the merchant checks if the status of the contract is signed. When the contract is in the signed status, the merchant needs to approve or cancel the contract. If the merchant approved the contract, they need to check if the contract status has been changed to activated, which indicates that the purchase was successfully financed by Inbank. For the flow which is to include down payment transfer, the contract status needs to be checked twice as well: - Firstly, after contract signing, the partner checks that the status of the contract is signed to see if the signing process has been completed. - Secondly, after the POST /payment_link API call, the partner checks the status of the contract to make sure the down payment transfer has been successful. If the status is activated, the purchase has been successfully financed by Inbank and the purchase items can be forwarded to the customer. As customer signing processing might take some time, the endpoint may need to be polled for a certain amount of time: - In case of digital, sms or paper signing methods, the endpoint needs to be polled once every second for a maximum of 15 seconds. - In case of the redirect, send_to_signing_sms and send_to_signing_email signing methods, there is no certain time when the customer will perform the signing. In this case, the endpoint needs to be polled at a reasonable interval for 7 days. This is also applicable if the flow includes the income proof verification process. For detailed information on the income proof flow, please contact your Inbank representative. ## Contract Withdrawal - [POST /partner/v2/shops/{shop_uuid}/contracts/{contract_uuid}/merchant_withdrawal](https://docs.inbank.eu/api/full-api-flow-archived/credit-contracts/postmerchantwithdrawal.md): POST /partner/v2/shops/:shop_uuid/contracts/:contract_uuid/merchant_withdrawal Using this endpoint, information on Inbank Hire Purchase and Split into parts purchase returns can be submitted to Inbank. This API call notifies Inbank that the merchant is willing to make withdrawal of the indicated contract. The exact terms of withdrawal need to be agreed with Inbank. Note, that the current endpoint is suitable for full withdrawal only. If you would like to make a partial return, please refer to the Partial Returns Guide.