Add wallet


    
    const handleGenerateKeys = async () => {
      try {
        // Send a POST request to the API endpoint to generate keys
        const resp = await fetchJson(`/api/dbo/settings/keys?t=key`, {
          method: "POST",
          headers: {
            token: token, // Token for authorization
            "Content-Type": "application/json", // Request content type
          },
        });

        // Log the response from the API
        console.log(resp);

        // If the response status code is '00', 
        update input values with generated keys
        if (resp.statusCode === "00") {
          setInputValue(resp.data.sk_live); // Update input with secret key
          setInputValue1(resp.data.pk_live); // Update input with public key
        } else {
          // Handle other response status codes if needed
        }
      } catch (error) {
        // Log any errors that occur during the process
        console.log(error);
      }
    }

Request details

  • Endpoint: `http://api.switch.tulupay.com/customer/add-wallet`
  • Method: `Post`
  • Headers:
  • Content-Type: `application/json`
  • Authorization: `token`
  • Response details

    A successful response will contain a JSON object with detailed wallet information. Here's a simplified example:

    
        
        const handleGenerateKeys = async () => {
          try {
            // Send a POST request to the API 
            endpoint to generate keys
            const resp = await fetchJson(`/api/dbo/settings/keys?t=key`, {
              method: "POST",
              headers: {
                token: token, // Token for authorization
                "Content-Type": "application/json", // Request content type
              },
            });
    
            // Log the response from the API
            console.log(resp);
    
            // If the response status code is '00',
             update input values with generated keys
            if (resp.statusCode === "00") {
              setInputValue(resp.data.sk_live); // Update input with secret key
              setInputValue1(resp.data.pk_live); // Update input with public key
            } else {
              // Handle other response status codes if needed
            }
          } catch (error) {
            // Log any errors that occur during the process
            console.log(error);
          }
        }

    Contact Us for Developer Support

    Contact our dedicated developer support team for assistance, guidance, or any questions you have regarding Tuluswitch API integration. We're here to ensure your development experience is smooth and successful.

    Read Our Developer Blog for Insights

    Master the Tuluswitch API with our Developer Blog! Get expert insights, advanced tips, and industry trends beyond the documentation. Stay connected with the developer community to build exceptional payment platforms. Visit the blog now and unlock your full potential!