# Get Started

Start building and testing your integration in the Deluxe sandbox environment. The sandbox provides a non-production environment where you can explore the APIs, test your integration, and validate your implementation before moving to production.

To get started in sandbox, you’ll need a Client ID and Client Secret provided by Deluxe.

### Get Sandbox Access

To request your Client ID and Client Secret, expand the Deluxe Contact Form below and complete it. Our implementation team will review your request and follow-up with next steps.

Request Sandbox Access and API Credentials
### Base URLs

**Production**

```text
https://api.deluxe.com
```

**Sandbox**

```text
https://sandbox.api.deluxe.com
```

### Prerequisites

Before you begin, make sure you have:

- Access to the Deluxe Developer Portal
- A Client ID and Client Secret


### Definitions

| Term | Description |
|  --- | --- |
| Client ID | A unique identifier assigned to your application by the Implementations Team. |
| Client Secret | A confidential key issued to your application. Keep it private. |
| Bearer Token | A temporary access token included in the Authorization header of API requests. |
| Partner Token | Identifies the merchant on whose behalf the request is made. It is provided with your credentials. |


### Connecting to the API

Connecting to the API involves two steps:

1. Obtain an access token.
2. Include it in subsequent API requests.


### Token Endpoints

#### Sandbox

```text
https://sandbox.api.deluxe.com/secservices/oauth2/v2/token
```

#### Production

```text
https://api.deluxe.com/secservices/oauth2/v2/token
```

### 1. Obtain an Access Token

Make a POST request to the token endpoint. Base64-encode your `Client ID:Client Secret` pair and send it using Basic authentication with the `client_credentials` grant type.

```bash
curl --request POST \
  'https://sandbox.api.deluxe.com/secservices/oauth2/v2/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Basic <base64-client-credentials>' \
  --data-urlencode 'grant_type=client_credentials'
```

### 2. Refresh the Bearer Token

Bearer tokens are valid for a limited time. Obtain a new token before the current one expires. If a request fails because a token has expired, refresh the token and retry the request.

### Developer Tips

For common request errors, verify that:

- The `Content-Type` header is correct.
- The `Authorization` header uses the expected format.
- The `partnerToken` is present and valid.