Purpose

Changing order fields without changing the order contents

Request typeasynchronous/synchronous
Supported agent version, SH

WSA v2.8.5.7

PluggetSystemTypeRKMid


Request format

{
    "taskType": "PatchOrder",
    "params": {
        "sync": {
            "objectId": number,
            "timeout": number
        },
        "orderGuid": "string",
        "fields":[
 
             { "name": "string", "value": "string"}
 
        ]
    }
}

Parameter

Type

Mandatory

Description

taskTypestring+Task type (PatchOrder)
sync

Synchronous method call (either synchronous or asynchronous)
|-timeoutint-Agent response timeout in seconds, default is 120 seconds
|-objectIdint+Restaurant code in the licensing system
orderGuidguid+Order Guid in Keeper
fieldsarray+Array: list of fields to change
|- namestring+The name of the field to be changed. For a list of fields available for modification, see the table below
|- valuestring+New value of the field. Can be null – the old value is deleted


List of fields available for update:

Name

Description

ChangeBackFrom

Amount for which change is required

Comment

Comment to order

Delivery.Courier.Name

Delivery courier name

Delivery.Courier.Phone

Delivery courier phone number

Delivery.Address

Delivery address

Delivery.Address.Comment

Comment on the delivery address

PayMethod

Payment method

 

Response format

// Successful response {
    "taskResponse": {
        "fields": [
            {
                "name": "string",
                "isSuccess": boolean,
                "error": null | "string"
            }
        ]
    },
    "responseCommon": {
        "taskGuid": "string",
        "taskType": "PatchOrder",
        "objectId": number,
        "agentGuid": "string"
    }
}
  
// Response with error
{
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "PatchOrder",
    "objectId": number
  },
  "error": {
    "wsError": {
      "code": "string",
      "desc": "string"
    },
    "agentError": {
      "code": "string",
      "desc": "string"
    }
  }
}

Parameter

Parameter type

Mandatory

Description

fieldsarray+Array: list of fields to change
|- namestring+Name of the field being modified
|- isSuccessboolean+Field changed successfully/not updated (see error)
|- errorstring-Error description if field is not updated


Example request

{
    "taskType": "PatchOrder",
    "params": {
        "sync": {
            "objectId": "199990246",
            "timeout": 120
        },
        "orderGuid": "0bf84cf5-754c-4b60-9aa7-ef6b33d02be9",
        "fields":[
            { "name": "Comment", "value": "Test comment from the patch"},
            { "name": "PayMethod", "value": "Cash"},
            { "name": "Delivery.Address", "value": "37 let Pobedy 1/3"},
            { "name": "Delivery.Courier.Name", "value": "Ivan I.I."},
            { "name": "Delivery.Courier.Phone", "value": "+79876543210"},
            { "name": "ChangeBackFrom", "value": "5000"},
            { "name": "Delivery.Address.Comment", "value": "Pobednaya Paradnaya"}           
        ]
    }
}



Example answer

{
    "taskResponse": {
        "fields": [
 
            {
                "name": "Comment",
                "isSuccess": true
            },
            {
                "name": "PayMethod",
                "isSuccess": true
            },
            {
                "name": "Delivery.Address",
                "isSuccess": true
            },
            {
                "name": "Delivery.Courier.Name",
                "isSuccess": true
            },
            {
                "name": "Delivery.Courier.Phone",
                "isSuccess": true
            },
            {
                "name": "ChangeBackFrom",
                "isSuccess": true
            },
            {
                "name": "Delivery.Address.Comment",
                "isSuccess": true
            }
        ]
    },
    "responseCommon": {
        "taskGuid": "3bc26173-c9a8-486b-9f7a-e68b4159b5c8",
        "taskType": "PatchOrder",
        "objectId": 199990246,
        "agentGuid": "d564619a-50c3-3d87-0816-de67ed9c8e18"
    }
}