The PayMittoTransferRequest type defines the structure of transfer requests that the SDK sends to your verifyFundsAndCreateTransfer callback. This object contains all the information needed to verify funds and create a transfer on your backend.
PayMitto.types.ts
export type PayMittoTransferRequest = {
fields?: [PayMittoTransferRequestField] | undefined;
quoteBy: string;
quoteHistoryId: string;
recipientAccountId?: string | undefined;
recipientId: string;
sourceAccountId?: string | undefined;
}
export type PayMittoTransferRequestField = {
id: string;
type: string;
value: string;
}
Property Type Required Description fields PayMittoTransferRequestField[]No Additional custom fields for the transfer quoteBy stringYes The entity that provided the quote quoteHistoryId stringYes Unique identifier for the quote used in this transfer recipientAccountId stringNo The recipient's account identifier recipientId stringYes Unique identifier for the recipient sourceAccountId stringNo The source account identifier for the transfer
Property Type Required Description id stringYes Unique identifier for the field type stringYes The data type of the field value stringYes The value of the field
App.tsx
import type {
PayMittoTransferRequest,
PayMittoTransferResponse,
PayMittoError
} from 'react-native-paymitto-sdk';
const verifyFundsAndCreateTransfer = async (
request: PayMittoTransferRequest
): Promise<PayMittoTransferResponse | PayMittoError> => {
console.log('Transfer Request:', {
recipientId: request.recipientId,
quoteHistoryId: request.quoteHistoryId,
sourceAccountId: request.sourceAccountId,
});
// Forward the request to your backend
const response = await fetch('https://your-api.com/transfers', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
recipient_id: request.recipientId,
quote_history_id: request.quoteHistoryId,
source_account_id: request.sourceAccountId,
recipient_account_id: request.recipientAccountId,
fields: request.fields,
}),
});
if (!response.ok) {
return {
code: 'TRANSFER_FAILED',
message: 'Transfer could not be processed',
};
}
const data = await response.json();
return { transferId: data.id };
};
JSON
{
"recipientId": "RCP-123456",
"quoteBy": "convera",
"quoteHistoryId": "QH-2026-0204-ABC123",
"sourceAccountId": "SRC-789012",
"recipientAccountId": "RCPA-345678",
"fields": [
{
"id": "purpose_of_transfer",
"type": "string",
"value": "family_support"
}
]
}