# getDepositUrl

給定一個使用者識別碼 (user-identifier)，這個函式 (function) 會透過 AkashicChain 在所有網路建立錢包供使用者存入，並回調一個 URL 來顯示它們

## <mark style="color:blue;">範例</mark>

取得 `user123` 的存款 URL

{% tabs %}
{% tab title="TypeScript" %}

```typescript
const depositUrl = await akashicPay.getDepositUrl(
  'user123', // identifier
  'orderId', // optional referenceId
  [Currency.USDT], // optional currencies to be displayed
  [NetworkSymbol.Tron], // optional network allowed
  "https://example.com" // optional redirectUrl
);

// with requestedAmount, requestedCurrency and markupPercentage
const { address, identifier } = await akashicPay.getDepositUrlWithRequestedValue(
  'user123', // identifier
  'orderId', // referenceId
  Currency.USD, // requested currency
  "1000", // requested amount
  [Currency.USDT], // optional currencies to be displayed
  [NetworkSymbol.Tron], // optional network allowed
  1, // optional mark up percentage on exchange rate
  "https://example.com" // optional redirectUrl
);
```

{% endtab %}

{% tab title="PHP" %}

```php
$depositUrl = $akashicPay->getDepositUrl(
  'user123', // identifier
  'order1', // optional referenceId
  array(CurrencySymbol::USDT), // optional currencies to be displayed
  array(NetworkSymbol::Tron), // optional network allowed
  "https://example.com" // optional redirectUrl
);

// with requestedAmount, requestedCurrency and markupPercentage
$depositAddress = $akashicPay->getDepositUrlWithRequestedValue(
  'user123', // identifier
  'orderId', // referenceId
  Currency::USD, // requested currency
  "1000", // requested amount
  array(CurrencySymbol::USDT), // optional currencies to be displayed
  array(NetworkSymbol::Tron), // optional network allowed
  1, // optional mark up percentage on exchange rate
  "https://example.com" // optional redirectUrl
);
```

{% endtab %}

{% tab title="Java" %}

```java
APDepositUrlResult depositAddress = akashicPay.getDepositUrl(
  'user123', // identifier
  'order1', // optional referenceId
  Arrays.asList(APCurrencySymbol.USDT, APCurrencySymbol.ETH), // optional currencies to be displayed
  Arrays.asList(APNetworkSymbol.ETH), // optional network allowed
  "https://example.com" // optional redirectUrl
);

// with requestedAmount, requestedCurrency and markupPercentage
APDepositUrlWithRequestedValueRequest request =APDepositUrlWithRequestedValueRequest.builder()
  .identifier("identifier") // identifier
  .referenceId("refId") // referenceId
  .requestedCurrency(APCurrencySymbol.USD) // requested currency
  .requestedAmount(100.0) // requested amount
  .receiveCurrencies(Arrays.asList(APCurrencySymbol.USDT, APCurrencySymbol.ETH)) // optional currencies to be displayed
  .networkSymbols(Arrays.asList(APNetworkSymbol.ETH)) // optional network allowed
  .markupPercentage(10.0) // optional mark up percentage on exchange rate
  .redirectUrl("redirectUrl") // optional redirectUrl
  .build();
APDepositUrlResult result = sdk.getDepositUrlWithRequestedValue(request);
```

{% endtab %}

{% tab title="C#" %}

```csharp
var depositUrl = await akashicPay.GetDepositUrlAsync(
  "user123", // identifier
  "order1", // optional referenceId
  [ApCurrencySymbol.Eth, ApCurrencySymbol.Usdt], // optional currencies to be displayed
  [TronShastaNetworkSymbol.Value], // optional network allowed
  "https://example.com" // optional redirectUrl
);

// with requestedAmount, requestedCurrency and markupPercentage
var request = new ApDepositUrlWithRequestedValueRequest.Builder()
  .SetIdentifier("identifier") // identifier
  .SetReferenceId("refId") // referenceId
  .SetRequestedCurrency(ApCurrencySymbol.HKD) // requested currency
  .SetRequestedAmount(100.0) // requested amount
  .SetReceiveCurrencies([ApCurrencySymbol.Eth, ApCurrencySymbol.Usdt]) // optional currencies to be displayed
  .SetNetworkSymbols([TronShastaNetworkSymbol.Value]) // optional network allowed
  .SetMarkupPercentage(10.0) // optional mark up percentage on exchange rate
  .SetRedirectUrl("redirectUrl") // optional redirectUrl
  .Build();

var result = await sdk.GetDepositUrlWithRequestedValueAsync(request);
```

{% endtab %}

{% tab title="Go" %}

```go
depositUrl, err := ap.GetDepositUrl(
  "user123", // identifier
  "order1", // optional referenceId 
  []akashicpay.CryptoCurrency{akashicpay.CryptoUSDT}, // optional currencies to be displayed 
  []akashicpay.Network{akashicpay.Tron}, // optional network allowed
  "https://example.com" // optional redirectUrl
)

// with requestedAmount, requestedCurrency and markupPercentage
depositUrl, err := ap.GetDepositUrlWithRequestedValue(
  "user123", // identifier
  "order1", // optional referenceId 
  []akashicpay.CryptoCurrency{akashicpay.CryptoUSDT}, // optional currencies to be displayed 
  []akashicpay.Network{akashicpay.Tron}, // optional network allowed
  "https://example.com", // optional redirectUrl
  akashicpay.CurrencyUSD, // requested currency
  "1000", // requested amount
  0 // optional mark up percentage on exchange rate
)
```

{% endtab %}
{% endtabs %}

## <mark style="color:blue;">URL 檢視範例</mark>

<figure><img src="https://812529792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSTlygtL7GMdsE7h1Lavf%2Fuploads%2Fmn4gxzfrOcCE2SrI9E84%2Fimage.png?alt=media&#x26;token=af512954-1e39-43ce-9fef-28167008e848" alt=""><figcaption></figcaption></figure>
