# API setup

### Setting up Authentication with BasicAuth  <a href="#setting-up-authentication-with-basicauth__202f" id="setting-up-authentication-with-basicauth__202f"></a>

[BasicAuth](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer/basicauth.md) with Verifone requires a Username and Password. Both your Username (userID) and Password ([API key](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication.md)), can be collected from Verifone Central &#x20;

### Collecting your Verifone credentials (environment variables)   <a href="#collecting-your-verifone-credentials-__0028environment-variables__0029__202f__00a0" id="collecting-your-verifone-credentials-__0028environment-variables__0029__202f__00a0"></a>

* Select an [environment](/online-payments/api-integration-methods-auth-and-endpoints.md#sandbox-and-production-urls) (Sandbox or Production)&#x20;
* Make sure you set up the base of the URL (environment) to be configurable for when you are ready to proceed to production.&#x20;
* Collect your [Payment Provider Contract](/verifone-central-getting-started/verifone-central/administration-tools/payment-provider-contracts.md) ID &#x20;
  * The Payment Provider Contract (PPC) represents the merchants contract with their acquiring partner, including key details such as the Merchant ID.&#x20;
* Collect your [3D Secure Contract](/verifone-central-getting-started/verifone-central/administration-tools/3ds-contracts.md) ID  &#x20;
  * During the 3D Secure Authentication Process, this is used to contact the issuing and acquiring banks.&#x20;
* Collect your [secure card capture key](/online-payments/api-integration-methods-auth-and-endpoints/secure-card-capture-key.md#generate-a-secure-card-capture-key-via-verifone-central) and key alias &#x20;
  * Verifone uses PGP encryption for securely storing card details during transmission. Your public key uniquely encrypts the Card details for Verifone to decrypt later using a Private key (which only Verifone has).&#x20;
  * Your Key Alias is a reference to the public key. This is required in the payment step, as it identifies which public key was used at the time of encryption.&#x20;

### Testing flow - Test cards for 3D Secure  <a href="#testing-flow-__002d-test-cards-for-3d-secure__00a0" id="testing-flow-__002d-test-cards-for-3d-secure__00a0"></a>

Verifone provides test cards for all 3D Secure test cases [here](/online-payments/strong-customer-authentication-sca/3d-secure/3d-secure-test-cases.md).&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.verifone.com/online-payments/api-integration/server-to-server-payments-with-3d-secure-setup-guide/api-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
