aYOUne
← Vertrieb API

Contracts

Singular: Contract — Base-URL: https://sale-api.ayoune.app — Zugriff: CRUD

play_circle Jetzt ausprobieren beta

Requests werden über den consumer-app Proxy an *.ayoune.app weitergeleitet. Tokens bleiben im Browser und werden pro Call mitgesendet.

Beispiel-Response (aufgezeichnet) Beispiel

Eine echte, zuvor aufgezeichnete GET /:id-Antwort dieses Endpunkts — nicht der Live-Call oben. Sensible Felder sind maskiert.

{
  "payload": {
    "license": {
      "active": false,
      "activated": false
    },
    "paypalPlan": {
      "payment_preferences": {
        "setup_fee": {
          "value": 0,
          "currency_code": "EUR"
        },
        "service_type": "PREPAID",
        "auto_bill_outstanding": true,
        "setup_fee_failure_action": "CANCEL",
        "payment_failure_threshold": 3
      },
      "taxes": {
        "percentage": 0,
        "inclusive": false
      },
      "paypalAccount": "",
      "plan_id": "",
      "product_id": "",
      "name": "",
      "description": "",
      "status": "ACTIVE",
      "usage_type": "LICENSED",
      "quantity_supported": false,
      "billing_cycles": []
    },
    "paypalSubscription": {
      "shipping_amount": {
        "currency_code": "EUR",
        "value": ""
      },
      "subscriber": {
        "name": {
          "given_name": "",
          "surname": ""
        },
        "shipping_address": {
          "name": {
            "full_name": ""
          },
          "address": {
            "address_line_1": "",
            "address_line_2": "",
            "admin_area_2": "",
            "admin_area_1": "",
            "postal_code": "",
            "country_code": ""
          }
        },
        "email_address": ""
      },
      "paypalAccount": "",
      "sub_id": "",
      "status": "",
      "plan_id": "",
      "quantity": "",
      "auto_renewal": true,
      "links": []
    },
    "_id": "65e0b1e9121b7d48fe15a40c",
    "suppliers": [],
    "team": [],
    "done": false,
    "resourcesProvided": false,
    "resourcesWorking": false,
    "locked": false,
    "demo": false,
    "userDataComplete": false,
    "cancelled": false,
    "sendAuto": false,
    "useCalculationRule": false,
    "hasQuota": false,
    "hasDuration": false,
    "hasCheckLists": false,
    "hasSupplierFeedback": false,
    "hasRequirements": false,
    "hasLicense": false,
    "name": "",
    "internalName": "",
    "additionalName": "",
    "description": "",
    "mode": "multiple",
    "type": "Kurz",
    "text_pre": "",
    "text_post": "",
    "deposits": [],
    "interval": "months",
    "runtime": 12,
    "runtime_type": "months",
    "status": "new",
    "shippingCosts": 0,
    "setupFee": 0,
    "currency": "EUR",
    "foreignCountry": false,
    "watchers": [],
    "createdBy": "6045f4d25704710012485569",
    "shares": [],
    "next_invoice": "2024-02-29T16:33:45.441Z",
    "contract_beginning": "2024-02-29T16:33:45.441Z",
    "positions": [],
    "contract_date": "2024-02-29T16:33:45.441Z",
    "taxes": [],
    "attributes": [],
    "comments": [],
    "requirements": [],
    "warnings": [],
    "createdAt": "2024-02-29T16:33:45.441Z",
    "updatedAt": "2024-02-29T16:33:45.441Z",
    "shortID": "SBARGKBOYBQN"
  },
  "meta": {
    "links": [
      {
        "rel": "self",
        "href": "https://sale-api.ayoune.app/contracts/65e0b1e9121b7d48fe15a40c",
        "method": "get",
        "title": "GET",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "relations": [
      {
        "rel": "Consumers",
        "title": "MODEL_CONSUMER",
        "href": "https://api.ayoune.app/crm/consumers",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.consumers"
      },
      {
        "rel": "CustomConfigFiles",
        "title": "MODEL_CUSTOMCONFIGFILE",
        "href": "https://api.ayoune.app/config/customconfigfiles",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.customconfigfiles"
      },
      {
        "rel": "ProductGroups",
        "title": "MODEL_PRODUCTGROUP",
        "href": "https://api.ayoune.app/config/productgroups",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.productgroups"
      },
      {
        "rel": "Products",
        "title": "MODEL_PRODUCT",
        "href": "https://api.ayoune.app/pim/products",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "pim.products"
      },
      {
        "rel": "Opportunities",
        "title": "MODEL_OPPORTUNITY",
        "href": "https://api.ayoune.app/sale/opportunities",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "sale.opportunities"
      },
      {
        "rel": "Offers",
        "title": "MODEL_OFFER",
        "href": "https://api.ayoune.app/sale/offers",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "sale.offers"
      },
      {
        "rel": "Assignments",
        "title": "MODEL_ASSIGNMENT",
        "href": "https://api.ayoune.app/sale/assignments",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "sale.assignments"
      },
      {
        "rel": "Projects",
        "title": "MODEL_PROJECT",
        "href": "https://api.ayoune.app/pm/projects",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "pm.projects"
      },
      {
        "rel": "CalendarEntries",
        "title": "MODEL_CALENDARENTRY",
        "href": "https://api.ayoune.app/crm/calendarentries",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.calendarentries"
      },
      {
        "rel": "PriceGroups",
        "title": "MODEL_PRICEGROUP",
        "href": "https://api.ayoune.app/config/pricegroups",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.pricegroups"
      },
      {
        "rel": "DiscountGroups",
        "title": "MODEL_DISCOUNTGROUP",
        "href": "https://api.ayoune.app/config/discountgroups",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.discountgroups"
      },
      {
        "rel": "PaymentGroups",
        "title": "MODEL_PAYMENTGROUP",
        "href": "https://api.ayoune.app/config/paymentgroups",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.paymentgroups"
      },
      {
        "rel": "CalculationRules",
        "title": "MODEL_CALCULATIONRULE",
        "href": "https://api.ayoune.app/config/calculationrules",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "config.calculationrules"
      },
      {
        "rel": "Documents",
        "title": "MODEL_DOCUMENT",
        "href": "https://api.ayoune.app/crm/documents",
        "method": "get",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ],
        "right": "crm.documents"
      }
    ],
    "debugId": "6a61990901c854403a7cc83b",
    "errors": [],
    "actions": [
      {
        "rel": "self",
        "action": "COPY",
        "title": "MODEL_CONTRACT",
        "href": "https://api.ayoune.app/sale/contracts/65e0b1e9121b7d48fe15a40c/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      },
      {
        "rel": "self",
        "action": "DELETE",
        "title": "MODEL_CONTRACT",
        "href": "https://api.ayoune.app/sale/contracts/65e0b1e9121b7d48fe15a40c/copy",
        "method": "post",
        "types": [
          "application/json",
          "application/yaml",
          "text/csv"
        ]
      }
    ],
    "version": {
      "host": "2026.37.2",
      "core": "2026.257.1"
    },
    "rateLimit": {
      "limit": "2500",
      "remaining": "2427",
      "reset": "1784784645",
      "resetDate": "Thu Jul 23 2026"
    },
    "responseTime": 95.168737,
    "code": 200,
    "status": "success",
    "error": false
  }
}

Endpunkte

MethodePathBeschreibungRight
GET /contracts Liste mit Filtern/Paginierung sale.contracts.view
GET /contracts/:id Einzelner Datensatz sale.contracts.view
POST /contracts Neuen Datensatz erstellen sale.contracts.new
PUT /contracts Datensatz aktualisieren sale.contracts.edit
DELETE /contracts/:id Datensatz löschen sale.contracts.delete

SDK

import { aYOUne } from '@tolinax/ayoune';
const ay = new aYOUne('pat_your_token');

// Alle abrufen
const list = await ay.sale.contracts.find().limit(10).exec();

// Einzelnen Datensatz
const one = await ay.sale.contracts.findById('OBJECT_ID').exec();

// Erstellen
const created = await ay.sale.contracts.create({ name: 'Foo' });

Weiterführend