Saltar al contenido principal

Creando Retiro

POST /api/v2/savings/withdrawal
{
  "source": {
    "savingsAccountId": "savings-id"
  },
  "destination": {
    "savingsAccountId": "savings-id",
    "externalAccountId": "bank-o-wallet-id"
  },
  "amount": 1000,
  "comment": "Retiro a banco"
}

Ejemplo

const withdraw = async (savingsAccountId, destinationAccountId, amount) => {
  const response = await fetch(
    'https://teste-94u93qnn.uc.gateway.dev/api/v2/savings/withdrawal',
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        source: {
          savingsAccountId: savingsAccountId
        },
        destination: {
          savingsAccountId: savingsAccountId,
          externalAccountId: destinationAccountId
        },
        amount: amount,
        comment: 'Retiro del usuario'
      })
    }
  );
  
  return await response.json();
};

Tiempos de Procesamiento

  • A Banco (ACH): 1-3 días hábiles
  • A Banco (Wire): Mismo día
  • A Cripto: 5-30 minutos

Próximos Pasos

Historial de Transacciones

Ve la documentación de la API de ahorros