MPChatMPChat/Docs

Merchants & API Keys

Retrieve your merchant profile and manage API keys. Each key is scoped to either the live or test environment.

The Merchant object

FieldTypeDescription
idstringUnique merchant UUID
namestringMerchant display name
emailstringContact email address
statusstringPENDING_KYB · ACTIVE · SUSPENDED
tierstringBASIC · STANDARD · PREMIUM — affects fee rate
fee_ratestringFee deducted from payments. E.g. "0.01" = 1%.
environmentstringlive or test
created_atstringISO 8601 creation timestamp

Retrieve merchant profile

GET
/v1/merchants/me

Get the authenticated merchant's profile

No parameters.

Returns Returns the Merchant object for the authenticated API key.

Request

bash
curl https://api.mpchat.com/v1/merchants/me \
  -H "Authorization: Bearer mk_live_abc:{ts}:{sig}"

Response 200

JSON
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "platform_user_id": "usr_abc123",
  "name": "Acme Store",
  "email": "[email protected]",
  "status": "ACTIVE",
  "tier": "STANDARD",
  "fee_rate": "0.01",
  "environment": "live",
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-10T08:00:00Z"
}

Register a merchant

POST
/v1/merchants

Register a new merchant account — public endpoint, no auth required

ℹ️After registration, use the merchant dashboard to generate your first API key. Live payments require KYB verification.

Body parameters

namestringrequired

Merchant display name.

emailstringrequired

Contact email address.

platform_user_idstringrequired

Unique user ID on your platform. Used for deduplication.

Returns Returns the Merchant object. New accounts start with status PENDING_KYB and operate in test mode.

Request

bash
curl -X POST https://api.mpchat.com/v1/merchants \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Store",
    "email": "[email protected]",
    "platform_user_id": "usr_abc123"
  }'

Response 201

JSON
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "platform_user_id": "usr_abc123",
  "name": "Acme Store",
  "email": "[email protected]",
  "status": "PENDING_KYB",
  "tier": "BASIC",
  "fee_rate": "0",
  "environment": "test",
  "created_at": "2024-01-15T10:00:00Z",
  "updated_at": "2024-01-15T10:00:00Z"
}

API keys

GET
/v1/merchants/api-keys

List all API keys for your merchant account

No parameters.

Returns Returns an array of API key summaries. The secret is never returned after initial creation.

Request

bash
curl https://api.mpchat.com/v1/merchants/api-keys \
  -H "Authorization: Bearer mk_live_abc:{ts}:{sig}"

Response 200

JSON
{
  "api_keys": [
    {
      "key_id": "mk_live_01HQ8ZTXV...",
      "name": "Production",
      "environment": "live",
      "is_active": true,
      "created_at": "2024-01-15T10:01:00Z",
      "last_used_at": "2024-01-15T14:00:00Z"
    },
    {
      "key_id": "mk_test_01HQ8ABCD...",
      "name": "Development",
      "environment": "test",
      "is_active": true,
      "created_at": "2024-01-10T09:00:00Z",
      "last_used_at": null
    }
  ]
}
POST
/v1/merchants/api-keys

Create a new API key

🚨 Secret shown once

The secret cannot be retrieved after creation. If lost, delete the key and create a new one.

Body parameters

namestringoptional

Human-readable label, e.g. "Production".

environmentstringrequired

Environment the key is valid for.One of: live, test

Returns Returns key_id and secret. The secret is shown only once — store it immediately.

Request

bash
curl -X POST https://api.mpchat.com/v1/merchants/api-keys \
  -H "Authorization: Bearer mk_live_abc:{ts}:{sig}" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production", "environment": "live"}'

Response 201

JSON
{
  "key_id": "mk_live_01HQ8ZTXV...",
  "secret": "4f3c2e1d0a9b8c7d6e5f4c3b2a109876543210abcdef...",
  "name": "Production",
  "environment": "live",
  "created_at": "2024-01-15T10:01:00Z"
}
DELETE
/v1/merchants/api-keys/{key_id}

Revoke an API key immediately

Path parameters

key_idstringrequired

The key ID to revoke, e.g. mk_live_01HQ...

Returns Returns a confirmation message. Any in-flight requests using this key will fail immediately.

Request

bash
curl -X DELETE \
  https://api.mpchat.com/v1/merchants/api-keys/mk_live_01HQ8ZTXV... \
  -H "Authorization: Bearer mk_live_abc:{ts}:{sig}"

Response 200

JSON
{"message": "API key deleted"}

See also: Error Reference