# How it works
source: https://developer.mastercard.com/cross-border-services/documentation/api-ref/rfi-apis/how-it-works/index.md

## Documents attached to RFI request {#documents-attached-to-rfi-request}

When an OI receives the **first notification** for a request (request status = OPEN), the OI must evaluate the request to identify the details required for processing the payments. The notification will list the payment Transaction Reference(s) for, and the additional information needed to process the payment(s) such as the sender's date of birth.  


The RFI Team can attach one or more documents when creating an RFI request. If there is something for the OI to download, then the notification will consist of a unique identifier referred as documentId, for each document which is attached to the request. The OI will then trigger the **Download Document API** for each documentId to retrieve the base64 encoded string for the document. Only one document base64 encoded string can be retrieved at a time.  


The below sequence diagram shows a RFI request created by MC Cross Border RFI team being assigned to an Originating Institution(OI).  

**Note:** The Originating Institution (OI) would have triggered the payment(s) referred in the RFI request ahead of time. This flow is not shown in the below diagram. For this example, let's assume MC RFI team has added a document to the RFI request before the RFI is assigned to OI.

Diagram rfi_developers_notification_sequence

## Upload a document {#upload-a-document}

When an OI wishes to upload one or more documents when submitting additional information, the OI must first upload each document individually using **Upload Document API** . The RFI System will return a system generated unique identifier (documentId) in response to **Upload Document** . To link a document to a RFI request, the OI will use the documentId value when responding. Refer to the **Update Request API** specification for fields where documentId can be used. If the payload size exceeds 1MB, the OI will receive an error and be required to reduce the payload size. Refer to Error descriptions link for more details.  


The below sequence diagram displays flow for an OI to upload document to RFI system and using the unique identifier provided by system in RFI response.

Diagram rfi_developers_upload_sequence

## Submit response {#submit-response}

A. Once the OI is ready to provide the requested information to the RFI Team, the OI will use the **Update Request API** to provide the relevant information. The response will be evaluated by the RFI Team and the OI will be notified of the outcome via a **webhook notification** .  


If there is a need to attach a file as part of a RFI response, the OI must first upload the document through **Upload Document API** and then use the system generated documentID returned as part of **Upload Document** response in appropriate field for **Update Request API** . Once a documentId is assigned to a RFI request it cannot be used for another RFI request.  


An OI can respond to a request only when the request is assigned to the OI; and the request Status is neither Closed nor Cancelled.  


The customer should respond to all information requested by the RFI Team. If additional information needs to be provided, this can be added in comments. Then the details further explaining the additional document(s), should be added in other documents. Refer to specifications for details.  


Example- If the Sender's Full Name and Date of Birth is required and Sender name was recently changed due to marriage, the OI may use Full Name and date of Birth fields to provide current personal details and use Comments to add a note explaining the recent name change. Also, OI can add a copy of legal document for the Name change under documents (even if a document was not requested).  


The below sequence diagram shows the flow once a response is provided by OI. The response details are evaluated by RFI team and shared with Receiving Provider.

Diagram rfi_developers_update_sequence

B. The RFI Team can review the updates and may require additional information to the original details provided. If this occurs, the request will be re-assigned to the OI. OI will be notified via a **webhook notification** . The OI can retrigger **Update Request API** to provide the updated information.  


The below sequence diagram shows the flow where MC RFI team requests for additional information on the response provided by OI.

Diagram rfi_developers_ammendment_sequence
