# DIGIT Exchange

## Overview

The DIGIT Exchange Service is a robust data interchange platform designed to facilitate the seamless and secure exchange of digital information between two endpoints. Built with a fixed schema for headers and dynamic messaging capabilities, this service ensures reliable communication while prioritizing data integrity and confidentiality.

### Dependencies

DIGIT-exchange can implement any service if it has the same request structure as the program.

* [Program Service](https://docs.digit.org/public-finance/technology/architecture/low-level-design/program-service)

## API Specifications

**Base Path:** /digit-exchange/

### API Contract Link

API spec [YAML is here.](https://raw.githubusercontent.com/egovernments/DIGIT-Specs/refs/heads/ifix-v2.2/Common%20Services/digit-exchange.yaml) Click below to view it in Swagger Editor.

{% embed url="<https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/egovernments/DIGIT-Specs/refs/heads/ifix-v2.2/Common+Services/digit-exchange.yaml>" %}

### APIs

{% openapi src="<https://raw.githubusercontent.com/egovernments/DIGIT-Specs/ifix-v2.2/Common%20Services/digit-exchange.yaml>" path="/exchange/EXCHANGE\_TYPE" method="post" %}
<https://raw.githubusercontent.com/egovernments/DIGIT-Specs/ifix-v2.2/Common%20Services/digit-exchange.yaml>
{% endopenapi %}

## Exchange Flow

<figure><img src="https://content.gitbook.com/content/87Hm8H5AqaC0eGkOXZPE/blobs/WDZkdoXFjlqNuA7QB6qB/ifix-digit-exchange.drawio%20(3).png" alt=""><figcaption></figcaption></figure>

## Data Model&#x20;

### DB Schema Diagram

<div align="left"><figure><img src="https://content.gitbook.com/content/87Hm8H5AqaC0eGkOXZPE/blobs/u92Rpc2gKyc7i6W2YvJ4/digit-exchange.png" alt=""><figcaption></figcaption></figure></div>

### Web Sequence Diagrams

#### Sequence of exchange between two environments

<figure><img src="https://content.gitbook.com/content/87Hm8H5AqaC0eGkOXZPE/blobs/tPPqc8ZcvFHlDxjcMKIG/image.png" alt=""><figcaption></figcaption></figure>

#### Exchange Service example of an exchange

<figure><img src="https://3242432517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F87Hm8H5AqaC0eGkOXZPE%2Fuploads%2FMl6ymtXZ2OS4w9HHDn6H%2Fimage.png?alt=media&#x26;token=a8adaec9-2fe3-47e4-984c-0c59c03a0f21" alt=""><figcaption></figcaption></figure>
