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"
}
]
}'
{
"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"
}
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "invalid credential_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "blocks[0]: invalid block_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
Credentials
Create credential
Create a new credential for storing portal login information
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"
}
]
}'
{
"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"
}
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "invalid credential_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "blocks[0]: invalid block_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
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
string
required
The unique identifier (UUID) for the corporation.
string
required
The type of credential. Values:
INDIRECT_TAX_REGISTRATION, OTHER.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 ofString,SecureString,Filevalue— the field value
string
The portal ID to associate the credential with. Get this from the Portal Fields endpoint.
string
A display name for the credential.
string
URL of the tax portal.
string
Optional notes about the credential.
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"
}
]
}'
{
"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"
}
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "invalid credential_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
{
"message": "Validation failed.",
"error": {
"type": "CLIENT_INVALID_REQUEST_BODY",
"title": "Failed to validate the request body",
"detail": {
"description": "blocks[0]: invalid block_type: INVALID"
},
"status": 400,
"instance": "/api/v1/credentials"
}
}
Was this page helpful?