What this call does

Creates or changes several framework contracts in one call, with the contract file and any attachments travelling along inside each row.

Last updated: 15.05.2026

What you need first

A valid API key in the API-Key header and your companyAccountId. Put an externalId from your ERP on every row: it is how CATHAGO recognises a contract you have sent before, and the only reliable way to match the answer to your rows.

Parameters

Parameter

Required

Default

Meaning

companyAccountId

Yes

none

Your company id. Stamped onto every contract this call creates.

mode

No

ADD_OR_UPDATE

ADD, ADD_OR_UPDATE or PATCH. Anything else is rejected with 400, unlike the choice fields in the body, this one is not forgiving.

ADD_OR_UPDATE (the default) finds the row by id, or failing that by externalId: found → update, not found → create. ADD always creates, with no uniqueness check and no 409, so on a routine sync it silently makes duplicates, use it for the first import only. PATCH only updates: a row must carry id or externalId or the call fails with 400, and a row matching nothing is skipped without any error. id is only ever a lookup key, never the id of a new contract.

The fields

The request is a list; each entry is one framework contract. Nothing is required, not even name: a row of {} creates a contract with only an auto-generated id. Every field is optional and has no default unless stated otherwise.

Field

Type

Default

Meaning

id

text

(none)

CATHAGO id. Lookup key only; leave it out to create.

externalId

text

(none)

Your own contract number, and the lookup key for ADD_OR_UPDATE and PATCH. Not checked for uniqueness. There is no contractNumber field, this is it.

status

choice

none

DRAFT, ACTIVE or INACTIVE. No default: leave it out and the contract is stored with no status and matches no statuses filter. Send one.

priceListIds

list of text

empty list

Price list ids. See the warning below.

commercialConditions, contractDeliveryTime, installationDays

object

(none)

Commercial terms, delivery time, installation time. Detailed below.

contractFile

object

(none)

The signed contract file. Detailed below.

attachments

list

empty list

Further files. Detailed below.

The rest are plain values:

  • Text: name (strongly recommended), trade, description, constructionElement, noteToBuyer, legalNoteToSupplier, paymentTerms, pricingModel, invoiceSchedule, deliveryTimeAfterOrder, currency (e.g. EUR), supplierId, supplierName.
  • Free text with agreed spellings: contractType, CATHAGO's screens use PURCHASE, SERVICE, RENTAL, PREFAB, SUBCONTRACT, LOGISTICS, DISPOSAL, OTHERS; contractFormnoneSPOT, FRAMEWORK, MSA.
  • Dates, YYYY-MM-DD: validFrom and validUntil (the term; daysUntilExpiry counts to validUntil), renewalDate, and effectiveDate / expiryDate, which come back as validFrom / validUntil whenever those are set.
  • Numbers: totalValue (no quotes, no €), noticePeriodDays (whole number).
  • Yes/no: autoRenewalnonetrue renews automatically.
On an update, three things are replaced by exactly what you send. priceListIds, leave it out and every price list on that contract is unlinked. commercialConditions, contractDeliveryTime and installationDays, an object with one field inside it wipes the other fields of that object. Call-offs are cleared outright, so do not update a contract that has them here. Everything else you leave out keeps its old value, and existing attachments are never removed.

commercialConditions, all optional, no defaults: notes, paymentPeriod (e.g. 30 Tage netto), scontoPaymentPeriod, scontoPercentage (percent, e.g. 3.0, dot, not comma), scontoPeriodDays (whole number), volumeDiscountPercentage, volumeDiscountThreshold (value from which it applies), lateDeliveryPenaltyPerDay, lateDeliveryPenaltyCap and qualityRejectionPenalty. All amounts are numbers.

contractDeliveryTime, all optional, no defaults: duration (whole number), durationUnit (DAYS, WEEKS or MONTHS), availableDaysType (WORKDAYS, WEEKENDS, CALENDAR or CUSTOM) and customDayRange (fromDay and toDay, both YYYY-MM-DD, meant to go with CUSTOM, though that pairing is not enforced). installationDays has the same four fields, plus afterDeliveryDate (date): when installation starts after delivery.

contractFile, no defaults. Fill in exactly one source: documentId (already at CATHAGO), documentUrl (CATHAGO fetches it itself, without a login and without VPN) or fileInBytes (base64 text); fill in more and the later one in that order wins. Plus documentName (the file name CATHAGO shows, ignored with a documentId) and documentFormatnonePDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA, which is required with a URL or bytes; without it the call fails with 500.

attachments, the same five fields, plus two optional ones with no default: externalId (your own document number) and attachmentType (free text, e.g. CERTIFICATE, APPENDIX, SPEC, SUPPORTING_DOC, stored exactly as sent).

A file block with all three sources empty is a trap. On contractFile the whole contract row disappears from the answer, although the contract itself is created or updated; an attachments entry is simply dropped. Leave the block out entirely when there is no file.

What you get back

200 OK with a list, one entry per contract stored, each carrying the id CATHAGO assigned and your externalId. Rows arrive one by one, in no guaranteed order, so match them by externalId or id, never by position. Fewer rows can come back than you sent: PATCH rows that matched nothing, and rows whose contractFile had no source, are left out. And the first failing row ends the stream, so 200 does not mean every row succeeded.

Read the answer to the end and reconcile by externalId. A very long answer can also be cut short by a timeout, so send large loads in batches.

Common mistakes

What you see

Why

What to do

401 Unauthorized, or 400 Bad Request

Key missing, unknown, disabled or expired; or the // comments are still in the body

Check the API-Key header, a staging key is not a production key. Remove the comments.

400, PATCH mode requires id or externalId on each contract

With mode=PATCH, a row carries neither

Put one of the two in every row.

Fewer rows come back than you sent

PATCH rows that matched nothing, or a contractFile with all three sources empty

Reconcile by externalId. Leave contractFile out when there is no file.

Price lists, or half of commercialConditions, vanished after an update

Both blocks are replaced by exactly what you send

Always resend them complete.

A field, or a status, you sent had no effect

A misspelled field name is dropped silently; an unknown choice value is silently emptied. Neither is rejected

Check the spelling. status must be DRAFT, ACTIVE or INACTIVE; case does not matter.

500 on a row that carried a file, or a 0-byte file

documentFormat was missing, or the documentUrl could not be fetched and that failure is swallowed

Send documentFormat, and make the address reachable without a login or VPN.

Adresse

HTTP
POST https://api.cathago.de/v3/api/gateways/integration/contracts/bulk?companyAccountId=<companyAccountId>&mode=ADD_OR_UPDATE

Beispielaufruf

Terminal
curl -X POST 'https://api.cathago.de/v3/api/gateways/integration/contracts/bulk?companyAccountId=<companyAccountId>&mode=ADD_OR_UPDATE' \
  -H 'API-Key: <Ihr API-Schlüssel>' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "externalId": "RV-2026-0417",
    "name": "Rahmenvertrag Betonstahl 2026",
    "contractType": "PURCHASE",
    "contractForm": "FRAMEWORK",
    "trade": "Rohbau",
    "description": "Betonstahl B500B als Stabstahl und Betonstahlmatten für alle Baustellen in Sachsen.",
    "constructionElement": "Bewehrung Decken und Wände",
    "noteToBuyer": "Abruf mindestens 5 Werktage vor Bedarf. Mindestabnahme 2 Tonnen je Abruf.",
    "legalNoteToSupplier": "Es gelten die VOB/B sowie unsere Einkaufsbedingungen in der Fassung vom 01.01.2026.",
    "deliveryTimeAfterOrder": "10 Wochen",
    "validFrom": "2026-06-01",
    "validUntil": "2027-05-31",
    "renewalDate": "2027-04-01",
    "noticePeriodDays": 90,
    "autoRenewal": true,
    "status": "ACTIVE",
    "supplierId": "S-STAHLHANDEL-NORDBAU",
    "supplierName": "Stahlhandel Nordbau GmbH",
    "priceListIds": [
      "PL-STAHL-NORD-2026",
      "PL-MATTEN-NORD-2026"
    ],
    "totalValue": 648500,
    "currency": "EUR",
    "paymentTerms": "30 Tage netto, 14 Tage 3 Prozent Skonto",
    "pricingModel": "FIXED",
    "invoiceSchedule": "MONTHLY",
    "commercialConditions": {
      "notes": "Preise fest bis 31.05.2027. Stahlzuschlag wird monatlich abgerechnet.",
      "paymentPeriod": "30 Tage netto",
      "scontoPaymentPeriod": "14 Tage",
      "scontoPercentage": 3,
      "scontoPeriodDays": 14,
      "volumeDiscountPercentage": 2.5,
      "volumeDiscountThreshold": 250000,
      "lateDeliveryPenaltyPerDay": 750,
      "lateDeliveryPenaltyCap": 15000,
      "qualityRejectionPenalty": 1500
    },
    "contractDeliveryTime": {
      "duration": 10,
      "durationUnit": "WEEKS",
      "availableDaysType": "WORKDAYS",
      "customDayRange": null
    },
    "installationDays": {
      "duration": 15,
      "durationUnit": "DAYS",
      "afterDeliveryDate": "2026-08-17",
      "availableDaysType": "CUSTOM",
      "customDayRange": {
        "fromDay": "2026-08-17",
        "toDay": "2026-09-04"
      }
    },
    "contractFile": {
      "documentUrl": "https://erp.weber-bau.de/dokumente/rv-2026-0417.pdf",
      "documentName": "Rahmenvertrag-Betonstahl-2026.pdf",
      "documentFormat": "PDF"
    },
    "attachments": [
      {
        "externalId": "ATT-DIN488-ZEUGNIS",
        "documentUrl": "https://erp.weber-bau.de/dokumente/din488-zeugnis.pdf",
        "documentName": "DIN-488-Werkszeugnis.pdf",
        "documentFormat": "PDF",
        "attachmentType": "CERTIFICATE"
      },
      {
        "externalId": "ATT-PREISANLAGE",
        "documentId": "C0626051233311345",
        "attachmentType": "APPENDIX"
      }
    ]
  },
  {
    "externalId": "RV-2026-0418",
    "name": "Rahmenvertrag Transportbeton 2026",
    "contractType": "PURCHASE",
    "contractForm": "FRAMEWORK",
    "trade": "Rohbau",
    "validFrom": "2026-06-01",
    "validUntil": "2027-05-31",
    "noticePeriodDays": 30,
    "autoRenewal": false,
    "status": "DRAFT",
    "supplierId": "S-BETONWERK-SACHSEN",
    "supplierName": "Betonwerk Sachsen GmbH",
    "priceListIds": [
      "PL-BETON-SACHSEN-2026"
    ],
    "totalValue": 312000,
    "currency": "EUR"
  }
]'

Beispiel für den Body

JSON
[
    {
        "externalId": "RV-2026-0417",               // Recommended. Your own contract number from your ERP - Cathago recognises a known contract by it
        "name": "Rahmenvertrag Betonstahl 2026",    // Recommended. Name of the framework contract
        "contractType": "PURCHASE",                 // Optional. Free text. Screens use PURCHASE, SERVICE, RENTAL, PREFAB, SUBCONTRACT, LOGISTICS, DISPOSAL, OTHERS
        "contractForm": "FRAMEWORK",                // Optional. Free text. Screens use SPOT, FRAMEWORK, MSA
        "trade": "Rohbau",                          // Optional. Trade
        "description": "Betonstahl B500B als Stabstahl und Betonstahlmatten für alle Baustellen in Sachsen.", // Optional. Description
        "constructionElement": "Bewehrung Decken und Wände", // Optional. Building element the contract covers
        "noteToBuyer": "Abruf mindestens 5 Werktage vor Bedarf. Mindestabnahme 2 Tonnen je Abruf.", // Optional. Note for your buyers, shown in Cathago
        "legalNoteToSupplier": "Es gelten die VOB/B sowie unsere Einkaufsbedingungen in der Fassung vom 01.01.2026.", // Optional. Legal note to the supplier
        "deliveryTimeAfterOrder": "10 Wochen",      // Optional. Delivery time after ordering, free text
        "validFrom": "2026-06-01",                  // Optional. Start of the term. Format YYYY-MM-DD
        "validUntil": "2027-05-31",                 // Optional. End of the term. daysUntilExpiry is counted to this day
        "renewalDate": "2027-04-01",                // Optional. Day the renewal is decided
        "noticePeriodDays": 90,                     // Optional. Notice period in days. Whole number
        "autoRenewal": true,                        // Optional. true = renews automatically, false = simply expires
        "status": "ACTIVE",                         // Send it. DRAFT, ACTIVE or INACTIVE. No default - omit it and the contract matches no statuses filter
        "supplierId": "S-STAHLHANDEL-NORDBAU",      // Optional. Supplier account id in Cathago
        "supplierName": "Stahlhandel Nordbau GmbH", // Optional. Supplier name
        "priceListIds": [                           // Send the COMPLETE list every time - on an update this replaces the stored links
            "PL-STAHL-NORD-2026",
            "PL-MATTEN-NORD-2026"
        ],
        "totalValue": 648500.00,                    // Optional. Contract value. Number, no quotes, no currency sign
        "currency": "EUR",                          // Optional. Currency, free text
        "paymentTerms": "30 Tage netto, 14 Tage 3 Prozent Skonto", // Optional. Payment terms, free text
        "pricingModel": "FIXED",                    // Optional. Pricing model, free text
        "invoiceSchedule": "MONTHLY",               // Optional. Invoicing rhythm, free text
        "commercialConditions": {                   // Optional. Replaced whole on an update - always resend every field below
            "notes": "Preise fest bis 31.05.2027. Stahlzuschlag wird monatlich abgerechnet.", // Optional. Free note on the terms
            "paymentPeriod": "30 Tage netto",       // Optional. Payment period, free text
            "scontoPaymentPeriod": "14 Tage",       // Optional. Early-payment period, free text
            "scontoPercentage": 3.0,                // Optional. Early-payment discount in percent. Dot, not comma
            "scontoPeriodDays": 14,                 // Optional. Early-payment period in days. Whole number
            "volumeDiscountPercentage": 2.5,        // Optional. Volume discount in percent
            "volumeDiscountThreshold": 250000.00,   // Optional. Contract value from which the volume discount applies
            "lateDeliveryPenaltyPerDay": 750.00,    // Optional. Penalty per day of late delivery
            "lateDeliveryPenaltyCap": 15000.00,     // Optional. Upper limit of the late-delivery penalty
            "qualityRejectionPenalty": 1500.00      // Optional. Penalty for rejected quality
        },
        "contractDeliveryTime": {                   // Optional. Replaced whole on an update
            "duration": 10,                         // Optional. How long, as a whole number
            "durationUnit": "WEEKS",                // Optional. DAYS, WEEKS or MONTHS
            "availableDaysType": "WORKDAYS",        // Optional. WORKDAYS, WEEKENDS, CALENDAR or CUSTOM
            "customDayRange": null                  // Left empty on purpose: it belongs with CUSTOM, and this block uses WORKDAYS
        },
        "installationDays": {                       // Optional. Replaced whole on an update
            "duration": 15,                         // Optional. How long, as a whole number
            "durationUnit": "DAYS",                 // Optional. DAYS, WEEKS or MONTHS
            "afterDeliveryDate": "2026-08-17",      // Optional. When installation starts after delivery. Format YYYY-MM-DD
            "availableDaysType": "CUSTOM",          // Optional. WORKDAYS, WEEKENDS, CALENDAR or CUSTOM
            "customDayRange": {                     // Optional. Belongs with CUSTOM, but the pairing is not enforced
                "fromDay": "2026-08-17",            // Optional. First installation day
                "toDay": "2026-09-04"               // Optional. Last installation day
            }
        },
        "contractFile": {                           // Optional. Leave the block out entirely when no file travels along
            "documentUrl": "https://erp.weber-bau.de/dokumente/rv-2026-0417.pdf", // One source per file. Must be reachable without a login or VPN
            "documentName": "Rahmenvertrag-Betonstahl-2026.pdf", // Optional. File name Cathago stores and shows
            "documentFormat": "PDF"                 // Required with documentUrl or fileInBytes. PDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA
        },
        "attachments": [                            // Optional. Added on top of existing attachments, never replacing them
            {
                "externalId": "ATT-DIN488-ZEUGNIS", // Optional. Your own document number, handed back in the answer
                "documentUrl": "https://erp.weber-bau.de/dokumente/din488-zeugnis.pdf", // One source per file. Beaten by fileInBytes if you fill in both
                "documentName": "DIN-488-Werkszeugnis.pdf", // Optional. File name Cathago stores and shows
                "documentFormat": "PDF",            // Required with documentUrl or fileInBytes. PDF, DOC, JPEG, JPG, PNG, DOCX, CSV, XLSX, XLS, XML, JSON, DAT, WDA
                "attachmentType": "CERTIFICATE"     // Optional. Free text, stored and shown exactly as sent
            },
            {                                       // Second entry - same fields as above
                "externalId": "ATT-PREISANLAGE",
                "documentId": "C0626051233311345",  // File already at Cathago, so only the id is given
                "attachmentType": "APPENDIX"
            }
        ]
    },
    {                                               // Second contract - same fields, only some of them used here
        "externalId": "RV-2026-0418",
        "name": "Rahmenvertrag Transportbeton 2026",
        "contractType": "PURCHASE",
        "contractForm": "FRAMEWORK",
        "trade": "Rohbau",
        "validFrom": "2026-06-01",
        "validUntil": "2027-05-31",
        "noticePeriodDays": 30,
        "autoRenewal": false,
        "status": "DRAFT",
        "supplierId": "S-BETONWERK-SACHSEN",
        "supplierName": "Betonwerk Sachsen GmbH",
        "priceListIds": [
            "PL-BETON-SACHSEN-2026"
        ],
        "totalValue": 312000.00,
        "currency": "EUR"                           // No contractFile and no attachments block: this contract's files are left untouched
    }
]

Beispielantworten

Example 1, ADD_OR_UPDATE creates 2 new contracts (200)

Status: 200 OK

JSON
[
    {
        "id": "C12260512895327",
        "externalId": "ERP-PO-77831",
        "name": "Logistic contract",
        "contractForm": "STANDARD",    
        "trade": "Construction contract",
        "status": "DRAFT",
        "validFrom": "2026-04-30",
        "validUntil": "2026-05-29",
        "daysUntilExpiry": 14,
        "commercialConditions": {
            "notes": "Make Sure this Contract Should deliver On the time for Applied for the Construction material",
            "paymentPeriod": "10 Days",
            "scontoPercentage": 19.0,
            "scontoPeriodDays": 5
        },
        "contractDeliveryTime": { "duration": 20, "durationUnit": "WEEKS", "availableDaysType": "WORKDAYS" },
        "installationDays": { "duration": 30, "durationUnit": "WEEKS", "afterDeliveryDate": "2026-06-29", "availableDaysType": "WEEKENDS" },
        "supplierId": "S-STEELCO",
        "supplierName": "Infra ware Supplier",
        "priceListIds": ["PL-STEEL-NORTH"],
        "createdAt": "2026-05-15T09:23:00Z"
    },
    {
        "id": "C12260512895328",
        "externalId": "ERP-PO-77832",
        "name": "Concrete C25/30",
        "contractForm": "STANDARD",    
        "status": "DRAFT",
        "validFrom": "2026-04-01",
        "validUntil": "2026-06-30",
        "createdAt": "2026-05-15T09:23:00Z"
    }
]

Example 2, ADD_OR_UPDATE updates 1 existing + creates 1 (200)

Status: 200 OK

JSON
[
    {
        "id": "C12260512895327",
        "externalId": "ERP-PO-77831",
        "name": "Steel rebar 2026 Q2 (updated)",
        "status": "DRAFT",
        "lastModifiedAt": "2026-05-15T09:27:00Z"
    },
    {
        "id": "C12260512895999",
        "externalId": "ERP-PO-NEW-001",
        "name": "New gravel framework",
        "status": "DRAFT",
        "createdAt": "2026-05-15T09:27:00Z"
    }
]

Example 3, ADD mode always creates (200)

Status: 200 OK

JSON
[
    {
        "id": "C12260512896001",
        "externalId": "ERP-PO-77831",
        "name": "Steel rebar 2026 Q2 (a separate row)",
        "status": "DRAFT",
        "createdAt": "2026-05-15T09:30:00Z"
    }
]

Example 4, PATCH mode updates existing only (200)

Status: 200 OK

JSON
[
    {
        "id": "C12260512895327",
        "externalId": "ERP-PO-77831",
        "name": "Steel rebar 2026 Q2",
        "totalValue": 720000.00,
        "noteToBuyer": "Updated guidance — order in 200kg increments.",
        "status": "ACTIVE",
        "lastModifiedAt": "2026-05-15T09:32:00Z"
    }
]

Example 5, ADD_OR_UPDATE with inline contractFile + attachments

Status: 200 OK

JSON
[
    {
        "id": "C12260512895327",
        "externalId": "ERP-PO-77831",
        "name": "Logistic contract",
        "contractForm": "STANDARD",    
        "status": "DRAFT",
        "contractFileDocumentId": "C0626051233311343",
        "contractFilePublicUrl": "https://docs.cathago.de/contract-pdfs/C0626051233311343",
        "contractFileName": "Steel-2026-Q2_Master.pdf",
        "attachments": [
            {
                "id": "A-77731-1",
                "externalId": "ATT-INSPECTION-CERT",
                "documentId": "C0626051233311344",
                "fileName": "DIN-488-Cert.pdf",
                "attachmentType": "CERTIFICATE",
                "createdAt": "2026-05-15T09:23:01Z"
            },
            {
                "id": "A-77731-2",
                "externalId": "ATT-PRICE-APPENDIX",
                "documentId": "C0626051233311345",
                "fileName": "Price-Appendix.pdf",
                "attachmentType": "APPENDIX",
                "createdAt": "2026-05-15T09:23:02Z"
            }
        ],
        "createdAt": "2026-05-15T09:23:00Z"
    }
]

Example 6, 400 PATCH without id/externalId

Status: 400 Bad Request

JSON
{
    "timestamp": "2026-05-15T09:33:00Z",
    "status": 400,
    "error": "Bad Request",
    "message": "PATCH mode requires id or externalId on each contract"
}

Example 7, 404 PATCH but no matching contract

Status: 404 Not Found

JSON
{
    "timestamp": "2026-05-15T09:33:00Z",
    "status": 404,
    "error": "Not Found",
    "message": "Contract not found for externalId: ERP-DOES-NOT-EXIST"
}