Retoure

Schlüssel Beschreibung
orderOID OID Bestellnummer pflicht
quantities Positionen optional

Facetten

Mit der Übergabe von Facetten kann der Inhalt der Antwort gesteuert werden.

Schlüssel Beschreibung
retoure Ergebnis über das anlegen der Retoure
quantities Ergebnis über das anlegen der Retouren Positionen
positions Ergebnis über das anlegen der Umtausch Positionen

Anlegen einer Retoure ohne Positionen

Es kommt auf den Workflow an ob das anlegen einer Retoure OHNE Positionen erlaubt ist.
Im Standard ist das nicht erlaubt und es wird ein 400 Bad Request zurück gegeben.

POST Request:

{
    "dataset": [
        {
            "orderOID": 1000
        }
    ]
}

Response:

{
    "sys": {
        "message": "400 Bad Request",
        "code": 400,
        "error": {
            "code": 400,
            "message": "400 Bad Request"
        }
    }
}

Anlegen einer Retoure mit Positionen

Request: POST /api/plugin/turnover/retoure?facet=retoure,positions

{
    "dataset": [
        {
            "orderOID": 1000,
            "action": 1,
            "payment": {
                "pid": 12
            },
            "positions": [
                {
                    "scid": 1433,
                    "count": 1,
                    "reason": 3,
                    "info": ""
                },
                {
                   "scid": 1434,
                    "count": 1,
                    "reason": 3,
                    "info": "Falsche Größe"
                }
            ]
        }
    ]
}

Response:

{
    "sys": {
        "message": "201 OK",
        "code": 201
    }
}

Anlegen einer Retoure mit Positionen und Umtausch Artikel

Request: POST /api/plugin/turnover/retoure?facet=retoure,positions,quantities

{
    "dataset": [
        {
            "orderOID": 1008,
            "action": 1,
            "payment": {
                "pid": 12
            },
            "positions": [
                 {
                    "scid": 11433,
                    "count": 1,
                    "reason": 3,
                    "info": ""
                }
            ],
            "exchangePositions" :[
                {
                    "itemIID": 10034,
                    "positionVariant": "S",
                    "positionCount": 1
                }
            ],
            "logging": [
                {
                    "date": "2021-05-30 12:00:00",
                    "i18n": "i18n:x.y.z",
                    "data": {}
                }
            ]
        }
    ]
}

Response:

{
    "sys": {
        "message": "201 Created",
        "code": 201
    },
    "dataset": [
        {
            "retoure": {
                "dataset": {
                    "orderOID": 1008,
                    "action": 1,
                    "paymentPID": 12,
                    "rid": 1203,
                    "created": "2021-06-20T06:47:34"
                },
                "sys": {
                    "message": "201 Created",
                    "code": 201
                }
            },
            "quantities": {
                "dataset": [
                    {
                        "turnoverOID": 1203,
                        "positionCount": 1,
                        "itemIID": 10035,
                        "positionVariant": "L",
                        "itemSKU": "4655662744937",
                        "depositGross": 499,
                        "depositNet": 419,
                        "depositCurrency": "EUR",
                        "depositVat": 1900,
                        "locationLID": 0,
                        "state": 1,
                        "type": 3,
                        "positionCreated": "2021-06-20T06:47:34",
                        "srqid": 164
                    }
                ]
            },
            "positions": [
                {
                    "dataset": {
                        "itemIID": 10034,
                        "positionVariant": "S",
                        "positionCount": 1,
                        "orderOID": 1008,
                        "itemName": "T-Shirt - grün",
                        "itemNumber": "10034",
                        "scid": 1602
                    },
                    "sys": {
                        "message": "201 Created",
                        "code": 201
                    }
                }
            ]
        }
    ]
}

Fehlermeldungen

{
    "dataset": [
        {
            "orderOID": 1008,
            "action": 1,
            "payment": {
                "pid": 12
            },
            "positions": [
                 {
                    "scid": 1433,
                    "count": 1,
                    "reason": 3,
                    "info": "Müll"
                }
            ],
            "exchangePositions" :[
                {
                    "itemIID": 110034,
                    "positionVariant": "S",
                    "positionCount": 1
                }
            ],
            "logging": [
                {
                    "date": "2021-05-30 12:00:00",
                    "i18n": "i18n:x.y.z",
                    "data": {}
                }
            ]
        }
    ]
}
{
    "sys": {
        "message": "400 Bad Request",
        "code": 400,
        "error": {
            "code": 400,
            "message": "400 Bad Request"
        }
    },
    "dataset": [
        {
            "exchangePositions": {
                "sys": {
                    "message": "404 Not Found",
                    "code": 404,
                    "error": {
                        "code": 404,
                        "message": "404 Not Found"
                    }
                },
                "dataset": [
                    {
                        "dataset": {
                            "itemIID": 110034,
                            "positionVariant": "S",
                            "positionCount": 1,
                            "orderOID": 1008
                        },
                        "sys": {
                            "message": "404 Not Found",
                            "code": 404,
                            "error": {
                                "code": 404,
                                "message": "404 Not Found",
                                "hint": "Position mit der IID 110034 wurde nicht gefunden."
                            }
                        }
                    }
                ]
            }
        }
    ]
}

Erfolgreiche Retouren werden bearbeitet.

{
    "sys": {
        "error": {
            "code": 404,
            "message": "404 Not Found"
        },
        "message": "404 Not Found",
        "code": 404
    },
    "dataset": [
        {
            "dataset": {
                "orderOID": 1000,
                "quantities": [
                    {
                        "itemIID": 10065,
                        "positionVariant": "__UNIQUE__",
                        "positionCount": 1,
                        "type": 3,
                        "reason": 0,
                        "info": "",
                        "itemSKU": "4867578957529",
                        "positionCreated": "2021-05-26T11:29:52",
                        "positionDescription": "Smartwatch Phone BLK"
                    },
                    {
                        "itemSKU": "4867578957530",
                        "positionCount": 1,
                        "type": 3,
                        "reason": 0,
                        "info": ""
                    }
                ]
            },
            "sys": {
                "error": {
                    "code": 404,
                    "message": "404 Not Found",
                    "hint": "Position mit der SKU 4867578957530 wurde nicht gefunden."
                },
                "message": "404 Not Found",
                "code": 404
            }
        }
    ]
}

Retouren Fähige Positionen auslesen

GET /api/plugin/turnover/retourablepositions/{oid}

{
    "dataset": {
        "1002": {
            "erpID": "",
            "erpName": "",
            "erpNumber": "",
            "erpLastUpdate": "2020-02-20T10:56:55",
            "erpCreation": "2020-02-20T10:56:55",
            "archived": false,
            "oid": 1002,
            "orderDate": "2019-02-20T10:56:55",
            "orderState": 57,
            "orderLastStatusChange": "2019-02-20T11:06:22",
            "customerUID": 31,
            "customerNotice": "",
            "billingAddressAID": 18,
            "deliveryAddressAID": 18,
            "deliveryNotice": "",
            "paymentPID": 102,
            "assigndTickets": "",
            "resubmissionDate": "1970-01-01T12:00:00",
            "resubmissionInfo": "",
            "acquisitionPartnerID": 0,
            "acquisitionInfo": "",
            "acquisitionRedirect": null,
            "acquisitionDate": "1970-01-01T12:00:00",
            "shippingNotice": "",
            "shippingDCID": 2,
            "retoureRID": 0,
            "companySHID": 1,
            "salesmanUID": 0,
            "channelOrderID": "",
            "channelOrderState": "0",
            "channelOrderDate": null,
            "channelOrderData": {},
            "retourablePositions": {
                "dataset": [
                    {
                        "scid": 1415,
                        "parentSCID": null,
                        "customerUID": 0,
                        "customerNumber": "",
                        "customerText": "",
                        "salesmanUID": 0,
                        "orderOID": 1002,
                        "packagingItemIID": 0,
                        "positionCount": 1,
                        "positionVariant": "S",
                        "positionDescription": "",
                        "positionCreated": null,
                        "positionSerialnumber": "",
                        "positionCustom1": "",
                        "positionCustom2": "499",
                        "positionCustom3": "",
                        "positionSystemtext": "",
                        "restrictionToCount": "0",
                        "restrictionToVariant": "0",
                        "stockUpdated": "0",
                        "itemIID": 10033,
                        "itemName": "T-Shirt - dunkelrot",
                        "itemSKU": "5424155144857",
                        "itemNumber": "10033",
                        "itemDealersnumber": "",
                        "priceVat": 1900,
                        "priceGross": 499,
                        "priceNet": 419,
                        "priceDigits": 2,
                        "priceType": 0,
                        "priceCurrency": "EUR",
                        "deliveryDID": 1002,
                        "priceRecommendedGross": 0,
                        "priceRecommendedNet": 0,
                        "priceRecommended": "",
                        "pricePurchasingGross": 0,
                        "pricePurchasingNet": 0,
                        "priceBaseNet": null,
                        "priceBaseGross": null,
                        "priceBaseMeasureNormalizationFactor": null,
                        "priceBaseMesaureReference": null,
                        "priceBaseMeasureValue": null,
                        "priceExchangerateLeadCurrency": "EUR",
                        "priceExchangerateRate": 100000,
                        "priceExchangerateNet": 419,
                        "priceExchangerateGross": 499,
                        "priceExchangerateDigits": 2,
                        "validated": "1",
                        "token": null,
                        "stockLocationID": 0,
                        "itemDataSalesType": 10,
                        "itemDataSalesGroup": 1,
                        "itemDataVariants": {
                            "S": {
                                "sku": "5424155144857",
                                "variant": "S",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 53
                            },
                            "M": {
                                "sku": "5769864186729",
                                "variant": "M",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 162
                            },
                            "L": {
                                "sku": "6876634633196",
                                "variant": "L",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 55
                            },
                            "XL": {
                                "sku": "5591665777547",
                                "variant": "XL",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 183
                            }
                        }
                    },
                    {
                        "scid": 1416,
                        "parentSCID": null,
                        "customerUID": 0,
                        "customerNumber": "",
                        "customerText": "",
                        "salesmanUID": 0,
                        "orderOID": 1002,
                        "packagingItemIID": 0,
                        "positionCount": 1,
                        "positionVariant": "M",
                        "positionDescription": "",
                        "positionCreated": null,
                        "positionSerialnumber": "",
                        "positionCustom1": "",
                        "positionCustom2": "499",
                        "positionCustom3": "",
                        "positionSystemtext": "",
                        "restrictionToCount": "0",
                        "restrictionToVariant": "0",
                        "stockUpdated": "0",
                        "itemIID": 10033,
                        "itemName": "T-Shirt - dunkelrot",
                        "itemSKU": "5769864186729",
                        "itemNumber": "10033",
                        "itemDealersnumber": "",
                        "priceVat": 1900,
                        "priceGross": 499,
                        "priceNet": 419,
                        "priceDigits": 2,
                        "priceType": 0,
                        "priceCurrency": "EUR",
                        "deliveryDID": 1002,
                        "priceRecommendedGross": 0,
                        "priceRecommendedNet": 0,
                        "priceRecommended": "",
                        "pricePurchasingGross": 0,
                        "pricePurchasingNet": 0,
                        "priceBaseNet": null,
                        "priceBaseGross": null,
                        "priceBaseMeasureNormalizationFactor": null,
                        "priceBaseMesaureReference": null,
                        "priceBaseMeasureValue": null,
                        "priceExchangerateLeadCurrency": "EUR",
                        "priceExchangerateRate": 100000,
                        "priceExchangerateNet": 419,
                        "priceExchangerateGross": 499,
                        "priceExchangerateDigits": 2,
                        "validated": "1",
                        "token": null,
                        "stockLocationID": 0,
                        "itemDataSalesType": 10,
                        "itemDataSalesGroup": 1,
                        "itemDataVariants": {
                            "S": {
                                "sku": "5424155144857",
                                "variant": "S",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 53
                            },
                            "M": {
                                "sku": "5769864186729",
                                "variant": "M",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 162
                            },
                            "L": {
                                "sku": "6876634633196",
                                "variant": "L",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 55
                            },
                            "XL": {
                                "sku": "5591665777547",
                                "variant": "XL",
                                "price": 4.99,
                                "priceCurency": "EUR",
                                "availableCount": 183
                            }
                        }
                    }
                ]
            },
            "delivery": {
                "dataset": [
                    {
                        "did": 1002,
                        "orderOID": 1002,
                        "deliveryAddress": {
                            "contact": "Melanie Musterfrau",
                            "company": "Test GmbH",
                            "address1": "Testweg 10",
                            "address2": "",
                            "city": "Testhausen",
                            "state": "",
                            "zipcode": "87654",
                            "country": "de",
                            "description": "",
                            "type": "4",
                            "preset": "1",
                            "systemUsage": "",
                            "erpID": "",
                            "erpName": "",
                            "erpNumber": "",
                            "formOfAddress": "",
                            "salutation": "",
                            "firstname": "Melanie",
                            "name1": "Musterfrau"
                        },
                        "billingAddress": {
                            "contact": "Melanie Musterfrau",
                            "company": "Test GmbH",
                            "address1": "Testweg 10",
                            "address2": "",
                            "city": "Testhausen",
                            "state": "",
                            "zipcode": "87654",
                            "country": "de",
                            "description": "",
                            "type": "4",
                            "preset": "1",
                            "systemUsage": "",
                            "erpID": "",
                            "erpName": "",
                            "erpNumber": "",
                            "formOfAddress": "",
                            "salutation": "",
                            "firstname": "Melanie",
                            "name1": "Musterfrau"
                        },
                        "createDate": "2019-02-20T12:05:35",
                        "state": 15,
                        "billNumber": "1002-1002-31",
                        "billDate": "2019-02-20T12:05:35",
                        "paymentState": 0,
                        "archivePrintFlag": "0",
                        "serviceNumber": "",
                        "serviceCompany": 0,
                        "deliveryDate": "2019-02-20T11:06:22",
                        "shippingDCID": 0,
                        "receivingDate": null,
                        "packetNumber": "",
                        "packetNumberRetoure": "",
                        "resubmissionDate": null,
                        "resubmissionInfo": "",
                        "notice": "",
                        "traceReceivingState": 0,
                        "traceReceivingSign": "",
                        "traceReceivingDate": null,
                        "picklistID": 0,
                        "transactionTID": 0,
                        "transactionAmount": 0,
                        "signatureRequiredFlag": 0,
                        "erpID": "",
                        "erpName": "",
                        "erpNumber": "",
                        "erpLastUpdate": "2018-02-20T11:05:21",
                        "erpCreation": null
                    }
                ]
            }
        }
    },
    "sys": {
        "message": "200 OK",
        "code": 200
    }
}