# Get CC Collection (Generate Link)

This endpoint is designed to facilitate the generation of a secure payment link for a customer to complete a credit card transaction.

***

### <mark style="color:yellow;">Endpoint</mark> <a href="#property-endpoint" id="property-endpoint"></a>

<mark style="color:green;background-color:green;">**`POST`**</mark>

```url
https://token.suissu.com/service/api/paycard
```

#### <mark style="color:yellow;">**Header Parameters**</mark>

***

`Content-Type` <mark style="color:orange;">**string (Required)**</mark>

Indicates the format of the data that has to be sent or received.

> Example: `application/json`

***

`x-api-name` <mark style="color:orange;">**string (Required)**</mark>

This is for authentication purpose and can be obtained by logging into the Extranet itself.

> Example: `XXXXFIRSTAPP`

{% hint style="info" %}
<mark style="color:yellow;">`XXXX`</mark> can be replaced with the client name.
{% endhint %}

***

`x-api-key` <mark style="color:orange;">**string (Required)**</mark>

This is for authentication purpose and can be obtained by logging into the Extranet itself.

> Example: `kfpwsfnknknfwknfkwnknef9823rujfsormDFS3ijoncvowoeorfnv`

{% hint style="info" %}
This key will be unique for every client.
{% endhint %}

***

#### [<mark style="color:yellow;">**Attributes**</mark>](https://token.suissu.com/service/api/charge)

`partner_id` <mark style="color:orange;">**string (Required)**</mark>

Indicates the unique property ID assigned upon the creation of the property.

***

`amount` <mark style="color:orange;">**string (Required)**</mark>

Indicates the amount that has to be charged from the credit card.

***

`currency_code` <mark style="color:orange;">**string (Required)**</mark>

Indicates the currency accepted by the partner.

***

`order_id` <mark style="color:orange;">**string (Required)**</mark>

A unique order identifier, typically generated by your system to link this payment request to a specific order.

***

`customer_email` <mark style="color:orange;">**string**</mark>

The email address of the customer. This must be a valid email format and should not exceed 50 characters.

{% hint style="info" %}
Example - john@abc.com
{% endhint %}

***

`contact_number` <mark style="color:orange;">**string**</mark>

The customer’s contact number in international format.

{% hint style="info" %}
Example - +919876XXXXXX
{% endhint %}

***

`return_url` <mark style="color:orange;">**string**</mark>

The URL to which the user will be redirected after payment is completed. This is typically used to handle post-payment processing.

***

### <mark style="color:yellow;">**Sample Request**</mark>

```json
{
   "partner_id": "TOH",
   "amount": "30",
   "currency_code": "NZD",
   "order_id": "TEST1AABDFGDFG46a54dsdcRs46g5d4fsz6g54a1s",
   "customer_email": "testuser@domain.co.nz",
   "contact_number": "+64211234567",
   "return_url": "https://testdomain.net/returnURL_Endpoint.php?flag=tokenRequest"
}
```

***

### <mark style="color:yellow;">**Responses**</mark>

#### <mark style="color:green;">**Success Response**</mark>

`status` <mark style="color:orange;">**string**</mark>

Indicates the status of the request.

***

`ErrorMessages` <mark style="color:orange;">**string**</mark>

Indicates the error messages, if any.

***

`URL` <mark style="color:orange;">**string**</mark>

A link to the payment page where the customer can complete the payment process. This URL will be generated upon success and should be used to redirect the user to the payment interface.

{% code overflow="wrap" %}
```json
{
   "Status": "Success",
   "ErrorMessages": [],
   "URL": "https://token.suissu.com/service/pgcard/f4ab7ceb2663afcf50a598a0d8e9173c"
}
```
{% endcode %}

***

#### <mark style="color:red;">**Error Response**</mark>

`status` <mark style="color:orange;">**string**</mark>

Indicates the status of the request.

***

`ErrorMessages` <mark style="color:orange;">**string**</mark>

An array containing specific error messages that describe why the request failed. In this example, the error relates to the invalid or missing `customer_email`.

```json
{
   "Status": "Fail",
   "ErrorMessages": [
       "customer_email : Invalid or missing email or length greater than 50 characters"
   ]
}
```
