Getting Started with Authentication

To use the Open Market API, you’ll need to create an account and obtain your API keys. This guide will walk you through the process step by step.

1. Create Your Account

First, create your business account at Open Market Enterprise.

2. Access API Settings

Once logged in, navigate to the API section in your dashboard at API Settings.

3. Configure Callback URLs

In the API settings, you’ll need to configure three important URLs:

Callback URL (Webhook)

This is the URL where Open Market will send payment notifications. It’s crucial for:

  • Receiving real-time payment confirmations
  • Updating order statuses automatically
  • Securing your transaction process

Example: https://your-domain.com/api/webhook

Success URL

The URL where customers are redirected after a successful payment:

  • Should be a page showing successful transaction
  • Can include order confirmation details
  • Typically a “Thank you” or order confirmation page

Example: https://your-domain.com/payment/success

Failure URL

The URL where customers are redirected if the payment fails:

  • Should provide clear error information
  • Can offer retry payment options
  • Should guide users on next steps

Example: https://your-domain.com/payment/failed

4. API Keys

After configuring your URLs, you’ll have access to two essential keys:

Public Key

  • Used for initiating payments
  • Safe to expose in your frontend code
  • Must be included in all API requests
  • Format: pk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Private Key

  • Used to verify webhook signatures
  • Must be kept secure
  • Never expose in frontend code
  • Format: sk_live_xxxxxxxxxxxxxxxxxxxxxxxx

5. Using Your API Key

Include your public key in all API requests using the api-key header:

curl -X POST "https://gateway.op-markets.com" \
-H "api-key: pk_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \