Auth

Create organization API credentials

Creates new API credentials for an organization with the following validations:

  1. Organization Validation:

    • Organization must exist
    • User must have access to the organization
  2. Role Assignment (required):

    • At least one role must be provided
    • Roles will be assigned to the API credentials for the organization
    • Roles must be valid organization roles (not merchant roles)
    • Invalid or missing roles will result in a 400 error
  3. Permission Requirements:

    • User must have MERCHANT_DEV_SETTINGS_CREATE_API_KEY permission
post/api/v1/auth/organizations/{organizationId}/credentials

Request

  • Base URL: https://api-sandbox.koywe.com
  • URL: https://api-sandbox.koywe.com/api/v1/auth/organizations/{organizationId}/credentials
  • Auth: HTTP bearer

Path parameters

organizationIdstring required

Organization ID

Request body

namestring required

Descriptive name to identify the purpose of the API credentials

rolesstring[] required

Array of role IDs or names to assign to the API credentials for the merchant. Must contain at least 1 role.

Example request

{
  "name": "API Key for Koywe integration",
  "roles": [
    "MERCHANT_ADMIN",
    "MERCHANT_VIEWER"
  ]
}

Response

Organization API credentials created successfully

apiKeystring required

Generated API Key for the merchant

secretstring required

Generated Secret for the merchant

Example response

{
  "apiKey": "f7d8e9c0-b1a2-3d4e-5f6g-7h8i9j0k1l2m",
  "secret": "2af81190b3a153r48a3df3a1eefcc386ca763b99fba53d39666751ffd4e2ae81"
}

Changes

No recorded changes to this operation across all 1 revision of this API.