Skip to main content
POST
/
api
/
v1
/
credentials
curl --request POST \
  --url 'https://transaction-tax.api.in.commenda.io/api/v1/credentials' \
  --header 'Authorization: Bearer <your_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "corporation_id": "550e8400-e29b-41d4-a716-446655440000",
    "credential_type": "INDIRECT_TAX_REGISTRATION",
    "portal_id": "PORTAL_CA_CDTFA",
    "name": "California CDTFA Portal",
    "blocks": [
      {
        "block_key": "username",
        "block_label": "Username",
        "block_type": "String",
        "value": "user@example.com"
      },
      {
        "block_key": "password",
        "block_label": "Password",
        "block_type": "SecureString",
        "value": "my-secure-password"
      }
    ]
  }'
{
  "message": "Successfully created credential.",
  "data": {
    "credential": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  }
}
Create a credential to store login details for a government tax portal. Use the Portal Fields endpoint to discover what fields a portal requires.

Request body

corporation_id
string
required
The unique identifier (UUID) for the corporation.
credential_type
string
required
The type of credential. Values: INDIRECT_TAX_REGISTRATION, OTHER.
blocks
array
required
Array of credential blocks. Each block stores one field (e.g., username, password). Minimum 1 block required.Each block requires:
  • block_key — unique key for the field (e.g., username)
  • block_label — display label (e.g., Username)
  • block_type — one of String, SecureString, File
  • value — the field value
portal_id
string
The portal ID to associate the credential with. Get this from the Portal Fields endpoint.
name
string
A display name for the credential.
portal_url
string
URL of the tax portal.
notes
string
Optional notes about the credential.
is_custom
boolean
Whether this is a custom (user-defined) credential rather than a portal-driven one.
curl --request POST \
  --url 'https://transaction-tax.api.in.commenda.io/api/v1/credentials' \
  --header 'Authorization: Bearer <your_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "corporation_id": "550e8400-e29b-41d4-a716-446655440000",
    "credential_type": "INDIRECT_TAX_REGISTRATION",
    "portal_id": "PORTAL_CA_CDTFA",
    "name": "California CDTFA Portal",
    "blocks": [
      {
        "block_key": "username",
        "block_label": "Username",
        "block_type": "String",
        "value": "user@example.com"
      },
      {
        "block_key": "password",
        "block_label": "Password",
        "block_type": "SecureString",
        "value": "my-secure-password"
      }
    ]
  }'
{
  "message": "Successfully created credential.",
  "data": {
    "credential": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  }
}