> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paysight.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Card Submission API Quickstart

> Learn how to integrate with the Paysight Card Submission API for processing payments and customer information

This guide covers the core card submission endpoint that allows you to process payments by submitting card and customer information for a specific product.

<Note>
  Please also consult the API Reference for detailed information on the [Card Submission API](https://docs.paysight.io/api-reference/card/submit-card-and-customer-info-for-a-product).
</Note>

## Prerequisites

Before starting the integration, ensure you have:

<CardGroup cols={2}>
  <Card title="Paysight Account" icon="building">
    Active merchant account with Paysight
  </Card>

  <Card title="Client ID" icon="id-card" href="https://app.paysight.io/settings/account">
    Find this in your Account Section
  </Card>

  <Card title="API Credentials" icon="key" href="https://app.paysight.io/settings/account">
    API key available in your Account Section
  </Card>

  <Card title="Product ID" icon="box" href="https://app.paysight.io/management/products">
    Available from your Product Management section.
  </Card>

  <Card title="Development Environment" icon="code">
    Set up for testing
  </Card>
</CardGroup>

<img src="https://mintcdn.com/paysight/f-RP10oIY58so-H0/images/APIToken.png?fit=max&auto=format&n=f-RP10oIY58so-H0&q=85&s=3a2239e7859151ce69d2e152264dbf1f" alt="" width="1491" height="995" data-path="images/APIToken.png" />

<Warning>
  Always use the test environment `(test.paysight.io)` during development and testing phases.
</Warning>

## API Endpoint Overview

The card submission API processes payment transactions by accepting card details and customer information.

### Base URL

* **Test Environment**: `https://test.paysight.io`

### Endpoint

* **Method**: `POST`
* **Path**: `/api/{productId}`

## Step-by-Step Integration

### Step 1: Authentication Setup

The API uses [API key](https://app.paysight.io/settings/account) authentication passed in the Authorization header.

```bash theme={null}
'Authorization':  'your-api-key-here',
'ClientId': 'your-client-id',
'UserEmail': 'your-paysight-account-email',
'Content-Type':  'application/json'
```

### Step 2: Prepare Request Payload

The API expects a comprehensive payload with card, customer, and transaction details.

#### Minimum Required Request Body (JSON)

```json theme={null}
{
  "paysightSession": null, // required if partnerSession is null
  "partnerSession": "abcdefg12345", // required if paysightSession is null
  "card": {
    "name": "John Smith",
    "pan": "4111111111111111",
    "expiryMonth": 12,
    "expiryYear": 2029,
    "cvv": "333"
  },
  "email": "johnsmith@gmail.com",
  "amount": 1.00
}
```

#### Session Management

| Parameter           | Type   | Description                                                                                                                      |
| :------------------ | :----- | :------------------------------------------------------------------------------------------------------------------------------- |
| **paysightSession** | string | Unique identifier of the session/user visit (generated by Paysight).                                                             |
| **partnerSession**  | string | Partner/client assigned unique identifier of the session/user visit. Persist this value between calls for the same user session. |

#### Using session fields to match transaction webhooks

Use these two fields as your correlation keys across API calls and webhook events:

* Send your own click/visit/session identifier in `partnerSession` when calling Card Submit.
* Card Submit responses return both `partnerSession` and `paysightSession`.
* Transaction webhooks include both fields, so you can join webhook events back to your original traffic/session data.
* If you use the Widget SDK, `sessionId` is forwarded to Card Submit as `partnerSession`.

### Step 3: Make a Request to API

### Base URL

* **Test Environment**: `https://test.paysight.io`

### Endpoint

* **Method**: `POST`
* **Path**: `/api/{productId}`

### Step 4: Handle the Response

The API returns a comprehensive response with transaction details:

```json theme={null}
{
  "paysightSession": "<string>",
  "partnerSession": "<string>",
  "subscribeSuccess": true,
  "chargeSuccess": true,
  "info": "<string>",
  "error": "<string>",
  "email": "<string>",
  "message": "<string>",
  "orderId": 123,
  "descriptor": "<string>",
  "mid": "<string>",
  "threeDSecureId": "<string>",
  "transactionId": "<string>",
  "amount": 1.00
}
```

<Info>
  If chargeSuccess is false but subscribeSuccess is true, this indicates a successful opt-in.
</Info>

### Step 5: Process Response

Use the response from the API to handle as required per your solution. For example:

* Redirect customer to thank you page if `chargeSuccess: true`
* Send the data to your internal system for additional processing and logic

### Step 6: Go Live Checklist

<Steps>
  <Step title="Test Production Integration">
    Test the integration using a production ProductId with the production endpoint (prod.paysight.io)
  </Step>

  <Step title="Verify Setup">
    Verify the integration with your Paysight account manager to ensure everything is set up correctly
  </Step>

  <Step title="Await Approval">
    <Danger>Wait for a GO LIVE message from your account manager before proceeding with live traffic</Danger>
  </Step>
</Steps>

## Next Steps

<CardGroup cols={3}>
  <Card title="Payment API Reference" icon="book" href="https://docs.paysight.io/api-reference/card/submit-card-and-customer-info-for-a-product">
    Explore the complete API documentation
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/api-reference/introduction">
    Learn about error handling and troubleshooting
  </Card>

  <Card title="Testing Guide" icon="vial" href="/api-reference/introduction">
    Best practices for testing your integration
  </Card>
</CardGroup>
