Solarware API-Dokumentation
YAML herunterladen

Deal-Felder aktualisieren

Setzt Feldwerte eines Deals. `field_id` kommt aus GET /deals/fields. Bei multiple true ist value ein Array und kann mehrere Optionsnamen enthalten: {"deal_id": 12, "fields": [{"field_id": 47, "value": ["Barzahler", "Finanzierung"]}]}. Jeder Name muss in den options des Feldes stehen. signature und uploader müssen binär sein (base64 oder Data-URL). date muss Y-m-d sein. Ein leerer String leert den Wert.

post /api/v1/deals/fields

Sicherheit

ApiKeyAuth

Request-Body Pflicht

application/json

Beispiel

{
    "deal_id": 12,
    "fields": [
        {
            "field_id": 47,
            "value": [
                "Barzahler",
                "Finanzierung"
            ]
        }
    ]
}

Schema

{
    "type": "object",
    "required": [
        "deal_id",
        "fields"
    ],
    "properties": {
        "deal_id": {
            "type": "integer"
        },
        "fields": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "required": [
                    "field_id",
                    "value"
                ],
                "properties": {
                    "field_id": {
                        "type": "integer",
                        "description": "Field id from `GET /deals/fields`."
                    },
                    "value": {
                        "nullable": true,
                        "description": "text/longtext/link/plaintext string; number; date `Y-m-d`; dropdown/checkbox array of option names; dropdown_single/radio one option name; product id; signature/uploader base64 or data URL. Empty string clears the value. `table` and `fixed_table` fields are not accepted.\n"
                    }
                }
            }
        }
    }
}

Antworten

200 Deal-Felder aktualisiert

application/json

{
    "allOf": [
        {
            "title": "API envelope",
            "type": "object",
            "properties": {
                "success": {
                    "type": "boolean"
                },
                "message": {
                    "type": "string",
                    "nullable": true
                },
                "errors": {
                    "nullable": true
                },
                "meta": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": true
                }
            }
        },
        {
            "type": "object",
            "properties": {
                "data": {
                    "type": "object",
                    "required": [
                        "deal_id",
                        "fields"
                    ],
                    "properties": {
                        "deal_id": {
                            "type": "integer"
                        },
                        "fields": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "required": [
                                    "field_id"
                                ],
                                "properties": {
                                    "field_id": {
                                        "type": "integer"
                                    },
                                    "value": {
                                        "nullable": true,
                                        "description": "Value stored for this field, in the same shape as `GET /deals/fields`."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    ]
}
401 Missing or invalid API key

application/json

{
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean",
            "example": false
        },
        "message": {
            "type": "string",
            "example": "Missing API key (X-Api-Key)"
        }
    }
}
404 Resource not found

application/json

{
    "title": "API envelope",
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "message": {
            "type": "string",
            "nullable": true
        },
        "errors": {
            "nullable": true
        },
        "meta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
        }
    }
}
422 Validation failed

application/json

{
    "title": "API envelope",
    "type": "object",
    "properties": {
        "success": {
            "type": "boolean"
        },
        "message": {
            "type": "string",
            "nullable": true
        },
        "errors": {
            "nullable": true
        },
        "meta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
        }
    }
}