Create acquisition

Creates an acquisition in Sodtrack from an external system, together with its items (products, product units, or extended warranties) and an associated customer.

POST/api/integration/acquisition

Request

cURL
curl -X POST "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/acquisition" \
  -H "Authorization: Bearer $SODTRACK_TOKEN"

Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com · other environments

Responses

Create acquisition
{
  "id": 73457,
  "customer": {
    "id": 32813,
    "name": "Lucía",
    "lastname": "Fernández",
    "email": "lucia.fernandez@example.com",
    "phone": "+5491150000001",
    "reference": "EXT-CUST-1001"
  },
  "acquisitionDate": "2026-06-07T00:00:00.000Z",
  "items": [
    {
      "id": 89250,
      "itemType": "serialNumber",
      "product": {
        "id": 6,
        "sku": "MOTO-BAJ-BOX150",
        "name": "Bajaj Boxer 150"
      },
      "productUnit": {
        "id": 41020,
        "serialNumber": "BOX150-CHS-2402"
      }
    }
  ]
}

Error responses for this endpoint follow the shared error reference.

Purpose

Creates an acquisition in Sodtrack from an external system, together with its items (products, product units, or extended warranties) and an associated customer.

A single request can carry multiple items. For each item you indicate how to resolve it (sku, serialNumber, or warrantyReference) and the reference value. Sodtrack resolves each item against its product catalog and registers the acquisition.

The customer is resolved automatically: if a matching customer already exists it is reused; otherwise a new one is created.

Optionally, the request can attach dynamic form responses (at customer, acquisition, and/or item level), attribute the acquisition to a sale channel, and trigger the creation of a work order for a given service variant.


Authentication

HeaderRequiredDescription
x-api-keySodtrack inbound integration API key.

The endpoint is restricted to Sodtrack's private integration network. Requests from unauthorized origins are rejected.


Field Definitions

🧾 Acquisition

FieldTypeRequiredDescription
referencestringYour unique reference for this acquisition. Must be non-empty and unique; reusing it returns 409 Conflict.
acquisitionDatestring (date)Acquisition date. ISO format, e.g. "2026-06-07" or a full ISO datetime.
relatedAcquisitionReferencestringReference of a previously created acquisition to relate this one to.
serviceVariantReferenceTriggeredstringWhen sent, Sodtrack also creates a work order for the service variant with this external reference. See Work order trigger.

🧍 Customer (customer)

FieldTypeRequiredDescription
customer.namestringCustomer first name.
customer.lastNamestringCustomer last name.
customer.emailstringCustomer email. Used to match an existing customer. Recommended to avoid duplicates; if omitted a temporary email is generated.
customer.referencestringYour external reference for the customer. Used to match an existing customer when email does not match.
customer.phoneTypestringOne of: "MOBILE", "HOME", "WORK".
customer.phoneNumberstringCustomer phone number.
customer.identificationTypestringOne of: "PASSPORT", "DRIVER_LICENSE", "NATIONAL_ID", "TAX_ID", "OTHER".
customer.identificationNumberstringCustomer identification number.
customer.identificationNumberCountrystringCountry of the identification number.
customer.dynamicFormsarrayDynamic form responses attached to the customer. See Dynamic forms.

📦 Items (items[])

At least one item is required.

FieldTypeRequiredDescription
items[].item.typestringHow to resolve the item. One of: "sku" (product), "serialNumber" (product unit), "warrantyReference" (extended warranty).
items[].item.valuestringThe reference value matching type (the product SKU, the product unit serial number, or the warranty external reference).
items[].quantitynumberQuantity for the item. Defaults to 1.
items[].dynamicFormsarrayDynamic form responses attached to this item. See Dynamic forms.

📣 Sale channel (saleChannel)

FieldTypeRequiredDescription
saleChannelobjectSale channel the acquisition is attributed to. If omitted, the acquisition is created without one.
saleChannel.typestring✅ when object sentHow to identify the sale channel. One of: "reference" (look it up by its string reference), "id" (the numeric primary key).
saleChannel.valuestring✅ when object sentThe value used to identify the sale channel (the reference string, or the numeric id as string). An unknown or invalid channel is rejected with 400 Bad Request (INVALID_SALES_CHANNEL).

📝 Dynamic forms (dynamicForms[])

Acquisition-level dynamic forms are sent in the top-level dynamicForms. The same shape applies to customer.dynamicForms and items[].dynamicForms.

FieldTypeRequiredDescription
dynamicForms[].formReferencestringReference of an existing, active dynamic form.
dynamicForms[].valuesarrayField responses for the form.
dynamicForms[].values[].fieldReferencestringReference of a field defined in the form.
dynamicForms[].values[].valuestringValue for that field.
dynamicForms[].values[].secondaryValuestringSecondary answer for composite fields (e.g. currency amount). Free-form string.

Example Request

Complete example (customer + item-level and acquisition-level dynamic forms + sale channel + work order trigger):

json
{
  "reference": "ACQ-EXT-1001",
  "acquisitionDate": "2026-06-07",
  "serviceVariantReferenceTriggered": "SERVICE-MOTO-10000KM",
  "customer": {
    "name": "Lucía",
    "lastName": "Fernández",
    "email": "lucia.fernandez@example.com",
    "phoneType": "MOBILE",
    "phoneNumber": "+5491150000001",
    "identificationType": "NATIONAL_ID",
    "identificationNumber": "30111222",
    "identificationNumberCountry": "AR",
    "reference": "EXT-CUST-1001",
    "dynamicForms": [
      {
        "formReference": "FORM-CUSTOMER",
        "values": [{ "fieldReference": "customer_segment", "value": "Premium" }]
      }
    ]
  },
  "items": [
    {
      "item": { "type": "serialNumber", "value": "BOX150-CHS-2402" },
      "quantity": 1,
      "dynamicForms": [
        {
          "formReference": "FORM-ACQ-ITEM",
          "values": [{ "fieldReference": "item_condition", "value": "nuevo" }]
        }
      ]
    }
  ],
  "saleChannel": { "type": "reference", "value": "SALES-CHANNEL-WEB" },
  "dynamicForms": [
    {
      "formReference": "FORM-ACQUISITION",
      "values": [{ "fieldReference": "acquisition_channel", "value": "web" }]
    }
  ]
}

Minimal example:

json
{
  "reference": "ACQ-EXT-1002",
  "acquisitionDate": "2026-06-07",
  "customer": {
    "name": "Diego",
    "email": "diego.pereyra@example.com"
  },
  "items": [
    { "item": { "type": "sku", "value": "MOTO-HND-CG125" }, "quantity": 1 }
  ]
}

Response Example

json
{
  "id": 73457,
  "customer": {
    "id": 32813,
    "name": "Lucía",
    "lastname": "Fernández",
    "email": "lucia.fernandez@example.com",
    "phone": "+5491150000001",
    "reference": "EXT-CUST-1001"
  },
  "acquisitionDate": "2026-06-07T00:00:00.000Z",
  "items": [
    {
      "id": 89250,
      "itemType": "serialNumber",
      "product": { "id": 6, "sku": "MOTO-BAJ-BOX150", "name": "Bajaj Boxer 150" },
      "productUnit": { "id": 41020, "serialNumber": "BOX150-CHS-2402" }
    }
  ]
}

Response Fields

FieldTypeDescription
idnumberSodtrack acquisition identifier.
customer.idnumberSodtrack customer identifier.
customer.namestringCustomer first name.
customer.lastnamestringCustomer last name.
customer.emailstringCustomer email.
customer.phonestringCustomer phone.
customer.referencestringCustomer external reference.
acquisitionDatestring (date-time)Acquisition date.
items[].idnumberSodtrack acquisition item identifier.
items[].itemTypestringResolved item type.
items[].productobjectResolved product (id, sku, name). Present when the item resolves to a product.
items[].productUnitobjectResolved product unit (id, serialNumber). Present when the item is a product unit.

Error Responses

HTTP StatusErrorDescription
400 Bad RequestMissing or invalid fields, an invalid/unknown dynamic form, or an item that cannot be resolved (e.g. product, product unit, or warranty not found).
400 Bad RequestINVALID_SALES_CHANNELThe sale channel could not be resolved from saleChannel.
401 UnauthorizedAPI key missing or invalid.
403 ForbiddenOrigin not authorized for the inbound integration network.
409 ConflictACQUISITION_ALREADY_EXISTSAn acquisition already exists for the given reference.
500 Internal Server ErrorUnexpected server error. Contact Sodtrack support.

Business Rules & Constraints

Customer resolution

Sodtrack resolves the customer before creating the acquisition:

ScenarioBehavior
customer.email matches an existing customerThe existing customer is reused.
No email match but customer.reference matchesThe existing customer is reused.
No matchA new customer is created (a temporary email is generated when none is provided).

When an existing customer is reused, the remaining customer.* fields are not updated.

Dynamic forms

Dynamic forms can be attached at three levels: customer, the acquisition (top-level dynamicForms), and each item (items[].dynamicForms).

ScenarioBehavior
All sent forms are validThe acquisition is created and the form responses are stored.
A form is invalid (unknown formReference, or a value that does not satisfy the form)The request is rejected with 400 Bad Request and nothing is created. Forms are validated before the acquisition is created.

Item resolution

Each item is resolved against the Sodtrack product catalog using item.type and item.value:

item.typeitem.value must beResolves to
skua product SKUa product
serialNumbera product unit serial numbera product unit (and its product)
warrantyReferencea warranty external referencean extended warranty (resolved against the products in the same request)

If any item cannot be resolved, the request is rejected with 400 Bad Request.

Work order trigger

When serviceVariantReferenceTriggered is sent, Sodtrack additionally creates a work order:

  • Same customer as the acquisition.

  • One work order item per acquisition item that resolved to a product (carrying the product unit when present).

  • Built on a best-effort basis: if the service variant reference does not exist, or no acquisition item resolved to a product, the work order is not created and the acquisition is still returned successfully.

Idempotency

reference must be unique. Re-sending the same reference returns 409 Conflict.