# GET /add_card_url/{{customer_id}} — Get Add Card URL

> Product: **Pabbly Subscription Billing** (v1)
> Base URL: `https://payments.pabbly.com/api/v1`
> Auth: Basic via `Authorization` header
> Canonical: `/subscription-billing/card/get-add-card-url`

This API is fired with GET request. You will need to add the link and fire it with basic auth. In response you will get all the details like title name, target URL and so on.

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| customer_id | string | Yes |  |

**Query parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Subscription_id | string | No |  |

**Response (200)** — Get Add Card URL:

```json
{
    "status": "success",
    "message": "Add card url",
    "data": "http://localhost:5000/add-card/5dccce50c58d3185c3b001c2f487f943:a719b078cec91d5757e4ee6f43e119f02c6f889c24f42e83c382f851b77b884948e11e306a3b88c86336ee6d9ebd176bc296ce6130e59d1a3213ef052527c495ccf5960880a30d787ecc16b8846c463e6cae8d4dcd870634bd1fd08cb3cab91b0da00b5c4159efe76f7743c7aab4e46c3e3076a1e72a62fe87c979556d6ffe5a"
}
```

**Code examples:**

_cURL_

```curl
curl https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}} \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}')
request = Net::HTTP::Get.new(uri)
request.basic_auth '{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, '{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}');

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

String credentials = Base64.getEncoder().encodeToString("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}".getBytes());

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}"))
    .header("Authorization", "Basic " + credentials)
    .GET();

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const credentials = Buffer.from('{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}').toString('base64');

const response = await fetch('https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}', {
  method: 'GET',
  headers: {
    'Authorization': `Basic ${credentials}`,
  },
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}", nil)
    req.SetBasicAuth("{{YOUR_API_KEY}}", "{{YOUR_SECRET_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}"));

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://payments.pabbly.com/api/v1/add_card_url/{{customer_id}}?Subscription_id={{Subscription_id}}");
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {credentials}");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

