> For the complete documentation index, see [llms.txt](https://docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verifone.com/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer.md).

# Authentication methods: Basic & Bearer

Choose the authentication scheme required by the API you are calling. Use this page to decide between Basic authentication and Bearer authentication before you build your request headers.

## Which method should you use?

* Use [BasicAuth](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer/basicauth.md) when the API expects credentials in a Basic authorization header.
* Use [BearerAuth (JWT)](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer/bearerauth-jwt.md) when the API expects a bearer token.

{% hint style="info" %}
Do not choose the authentication method by preference. Choose the method required by the endpoint or integration flow.
{% endhint %}

### Before you continue

* Confirm which API you are integrating with.
* Confirm whether the API expects a static credential or a token-based flow.
* Make sure you already have the required keys, credentials, or token generation setup.

### Quick path

1. Read the auth method that matches your API.
2. Build the header exactly as required.
3. Test the request in your target environment.

{% content-ref url="/pages/RO4zsRgh84XA56V4pKWS" %}
[BasicAuth](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer/basicauth.md)
{% endcontent-ref %}

{% content-ref url="/pages/ipaeqGinh2n64tA7XCwL" %}
[BearerAuth (JWT)](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer/bearerauth-jwt.md)
{% endcontent-ref %}

### Related guides

* [API authentication](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication.md)
* [Get your API Keys](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/get-your-api-keys.md)
* [Manage your API Keys](/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/manage-your-api-keys.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.verifone.com/online-payments/api-integration-methods-auth-and-endpoints/api-authentication/authentication-methods-basic-and-bearer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
