# Add New Records
source: https://developer.mastercard.com/agent-suite-for-merchants/documentation/use-cases/add-new-database-records/index.md

👉 Replace the generic resource labels, endpoints, Mermaid sequence names, and sample payloads on this page with the real create flows for your service. For each sequence diagram, update the Mermaid `basename` so it matches the corresponding file in `data/mermaid/`. For each endpoint example, replace the Swagger embed values with your real OpenAPI file, path, and HTTP method. Keep the create-resource, create-transaction, and create-administrative structure only if those flow types apply.

Add new records for a new primary resource, secondary resource, downstream transaction, or administrative record.

## Add a New Primary or Secondary Resource {#add-a-new-primary-or-secondary-resource}

This endpoint allows service operators to add a new primary record to the system. You can send a `NewPrimaryResource` using `POST /resource-a` or send a `NewSecondaryResource` using `POST /resource-b`.

### Example sequence {#example-sequence}

Diagram post-new-dog An operator registers a new primary record so it becomes available for downstream workflows and searches. `POST /resource-a` creates the record and returns a unique identifier.

See the endpoint structure:

API Reference: `POST /dogs`

An operator registers a new secondary record that is part of the same business flow. `POST /resource-b` creates the record and returns a unique identifier.

See the endpoint structure:

API Reference: `POST /cats`

## Create a Transaction Record {#create-a-transaction-record}

This endpoint allows service operators to log a new downstream transaction using `POST /transactions`. After receiving the transaction identifier, the workflow may continue with a linked operation such as confirmation, approval, or payment using `POST /transactions/{transaction_id}/actions`.

### Preconditions {#preconditions}

* The related primary resource must already exist, and you must have its identifier from an earlier create, retrieve, or search response.
* Before calling `POST /transactions/{transaction_id}/actions`, you must first create the transaction record and keep the returned `transaction_id`.

### Example sequence {#example-sequence-1}

Diagram oauth-post-pet-adoption

### Transaction request {#transaction-request}

An operator logs a new transaction and processes the next required action. This is a two-step flow: `POST /transactions` creates the record and returns a `transaction_id`, then `POST /transactions/{transaction_id}/actions` completes the next step against that ID.

#### Step 1 - Create the transaction record {#step-1---create-the-transaction-record}

See the endpoint structure:


API Reference: `POST /adoptions`

<br />

#### Step 2 - Complete the next transaction action {#step-2---complete-the-next-transaction-action}

See the endpoint structure:


API Reference: `POST /adoptions/{adoption_id}/payments`

<br />

## Create an Administrative Record {#create-an-administrative-record}

This endpoint allows the service to add one or more new administrative records using `POST /admin-records`.

### Example sequence {#example-sequence-2}

Diagram oauth-post-employee

### Administrative record request {#administrative-record-request}

An administrator onboards one or more operational records into the system. `POST /admin-records` accepts a list, enabling batch creation in a single request.

See the endpoint structure:


API Reference: `POST /employees`

<br />

## Error Resolution {#error-resolution}

For details on error resolution please visit our [Code and Formats](https://developer.mastercard.com/agent-suite-for-merchants/documentation/code-and-formats/index.md) section.
