APG PayAPG Paydocs

Enterprises

Create enterprises

POST/enterprises

Create an enterprise. The response carries its API key, once.

Permissions

Required permission
enterprises:create

Requires the `create` action on `enterprises` for the supplied runtime context

Request body

This body is a tagged shape: type is always "EntCmdCreate". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "EntCmdCreate"
slugstringrequired

URL-safe identifier. Must be unique across the platform.

businessNamestringrequired

Example Ada Lovelace

websitestringrequired
companyEmailstringrequired

Example ada@example.com

companyPhonestringrequired

E.164 format, e.g. +61400000000.

Example +61400000000

Public keys to encrypt card data to, set up at creation.

The enterprise's registration, where it is known at creation. It can be given later with a patch.

curl -X POST https://api.tst.au.apgpay.dev/enterprises \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "EntCmdCreate",
  "slug": "string",
  "businessName": "Ada Lovelace",
  "website": "string",
  "companyEmail": "ada@example.com",
  "companyPhone": "+61400000000",
  "encryptionKeys": [
    {
      "type": "EntEncryptionKeyAttributes",
      "name": "Ada Lovelace",
      "key": "string"
    }
  ],
  "registration": {
    "type": "EntRegistrationAttributes",
    "country": "AU",
    "businessRegistrationNumber": "string",
    "taxRegistrationNumber": "string",
    "registeredAddress": {
      "type": "MchtAddressAttributes",
      "unitNumber": "string",
      "streetNumber": "string",
      "streetName": "Ada Lovelace",
      "streetType": "string",
      "suburb": "string",
      "city": "string",
      "state": "string",
      "postalCode": "3000",
      "country": "AU"
    }
  }
}'

Responses

The response is a tagged shape: type is always "EntCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "EntCreateRspAttributes"

A platform tenant, the party that holds the contract everything else sits under.

apiKeystringrequired

The enterprise's API key. Shown once, here, and never again, store it now.

Example
{
  "type": "EntCreateRspAttributes",
  "created": {
    "type": "EntViewAttributes",
    "enterpriseId": "ent_9f2Kd8QpLzXw",
    "slug": "string",
    "businessName": "Ada Lovelace",
    "status": "Enabled",
    "website": "string",
    "companyEmail": "ada@example.com",
    "companyPhone": "+61400000000",
    "encryptionKeyNames": [
      "Ada Lovelace"
    ],
    "registration": {
      "type": "EntRegistrationAttributes",
      "country": "AU",
      "businessRegistrationNumber": "string",
      "taxRegistrationNumber": "string",
      "registeredAddress": {
        "type": "MchtAddressAttributes",
        "unitNumber": "string",
        "streetNumber": "string",
        "streetName": "Ada Lovelace",
        "streetType": "string",
        "suburb": "string",
        "city": "string",
        "state": "string",
        "postalCode": "3000",
        "country": "AU"
      }
    },
    "branding": {
      "type": "EntBrandingAttributes",
      "displayName": "Ada Lovelace",
      "companyName": "Ada Lovelace",
      "supportEmail": "ada@example.com",
      "website": "string",
      "logoUri": "https://example.com/callback",
      "logoDarkUri": "https://example.com/callback",
      "iconUri": "https://example.com/callback",
      "logoAltText": "string",
      "primaryColor": "string",
      "primaryColorDark": "string"
    },
    "sites": [
      {
        "type": "EntSiteAttributes",
        "domain": "string",
        "app": {
          "type": "EntSiteAppDashboard"
        }
      }
    ],
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  },
  "apiKey": "string"
}

Error responses