# Trying to access wix payment from my external WebApp running on Azure

**URL:** <https://forum.wixstudio.com/t/trying-to-access-wix-payment-from-my-external-webapp-running-on-azure/65768>\
**Category:** Ask the community\
**Tags:** wix-payment, wix-studio, wix, question, code\
**Created:** [December 17, 2024, 6:07pm UTC](https://forum.wixstudio.com/t/trying-to-access-wix-payment-from-my-external-webapp-running-on-azure/65768 "2024-12-17T18:07:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mazi\_Tobias](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@Mazi\_Tobias](https://forum.wixstudio.com/u/Mazi_Tobias)\
**Post date:** [December 17, 2024, 6:07pm UTC](https://forum.wixstudio.com/t/trying-to-access-wix-payment-from-my-external-webapp-running-on-azure/65768/1 "2024-12-17T18:07:27Z")

</div>

**Question:**  
I am trying to access Wix Payments so that my external WebApp (hosted on Azure), linked in Velo, so that I can pay when I click on my buy button, it will connect to WIX payment and allow me to add CC info, name, etc that is required to make purchase.

Any assistance would be hugely appreciated

I created an API Token and tried the following:

import fetch from ‘node-fetch’;

const WIX\_API\_TOKEN = ‘[MY TOKEN HERE’;  
const WIX\_PAYMENTS\_URL = ‘[https://www.wixapis.com/payments/v3/transactions](https://www.wixapis.com/payments/v3/transactions)’;

// Function to create a transaction  
async function createPaymentTransaction() {  
try {  
const response = await fetch(WIX\_PAYMENTS\_URL, {  
method: ‘POST’,  
headers: {  
‘Authorization’: `Bearer ${WIX_API_TOKEN}`,  
‘Content-Type’: ‘application/json’,  
},  
body: JSON.stringify({  
amount: 10.00, // Payment amount  
currency: ‘USD’, // Currency  
description: ‘Test Payment’,  
buyerInfo: {  
email: ‘test@example.com’,  
name: ‘John Doe’  
}  
}),  
});

```
    if (!response.ok) {
        throw new Error(`Error: ${response.statusText}`);
    }

    const result = await response.json();
    console.log('Payment Transaction Result:', result);
} catch (error) {
    console.error('Error creating payment transaction:', error);
}

```

}

// Call the function  
createPaymentTransaction();
