# Using the Platform API



## Prerequisites [#prerequisites]

Before you begin, you'll need:

* A Paytrie account
* An API key (or vendor ID for embedded widget)

## Step 1: Create a Paytrie account [#step-1-create-a-paytrie-account]

Register for a Paytrie account at [app.paytrie.com/SignupEmail](https://app.paytrie.com/SignupEmail).

## Step 2: Request API access [#step-2-request-api-access]

Contact [support@paytrie.com](mailto:support@paytrie.com) to request a developer API key. Include:

* Your registered email address
* A brief description of your integration use case
* Expected transaction volume

## Step 3: Authenticate your requests [#step-3-authenticate-your-requests]

All API requests require authentication via the `x-api-key` header:

```bash
curl -X GET "https://api.paytrie.com/endpoint" \
  -H "x-api-key: your-api-key-here"
```

<Callout type="warn">
  **Keep your API key secret.** It authenticates your integrator account and can
  act on behalf of your users — treat it like a password.

  * Only ever use it from your **server**. Never embed it in browsers, mobile
    apps, or other client-side code where a user could extract it.
  * Store it in an environment variable or a secrets manager — never hard-code it
    in source or commit it to version control.
  * Always send it over HTTPS, and keep it out of URLs, logs, and error
    reports.
  * Rotate keys periodically, and use separate keys per environment
    (e.g. staging vs. production) so one can be revoked without affecting the
    others.
  * If you believe a key has been exposed, contact
    [support@paytrie.com](mailto:support@paytrie.com) immediately to rotate it.
</Callout>

## Step 4: Start building [#step-4-start-building]

Once you have your API key, you're ready to integrate.

### For Embedded Widget Integration [#for-embedded-widget-integration]

If you chose the embedded widget approach, head over to the [Embedded Widget Overview](/v2/embedded-widget) to learn how to embed the widget in your application, or jump directly to the [URL Builder](/v2/url-builder) to start generating custom widget URLs.

### For API Integration [#for-api-integration]

Here's a typical API integration flow:

<Steps>
  <Step>
    ### Register users [#register-users]

    Use the [Customer Onboarding](/v2/customer-onboarding) endpoint to register users and collect KYC information.
  </Step>

  <Step>
    ### Authenticate users [#authenticate-users]

    Implement the [Authentication](/v2/authentication) flow to get user tokens for transaction requests.
  </Step>

  <Step>
    ### Get price quotes [#get-price-quotes]

    Fetch real-time [Price Quotes](/v2/price-quotes) to display conversion rates to users.
  </Step>

  <Step>
    ### Create transactions [#create-transactions]

    Submit [Transactions](/v2/transactions) to process stablecoin purchases.
  </Step>

  <Step>
    ### Handle webhooks [#handle-webhooks]

    Set up [Webhooks](/v2/webhooks) to receive notifications about user verification and transaction status changes.
  </Step>
</Steps>

## Base URL [#base-url]

All API requests should be made to:

```
https://api.paytrie.com
```

## Response Format [#response-format]

Response will be returned in `JSON` format with `content-type: application/json`.
