# Tutorial: Changing orders via "Order Change"

After the buyer sends an order, the buyer may change the order if this is done before the order is prepared for delivery. This can be done with an Order Change transaction via the POST /api/v1-beta/{partyId}/generic/send endpoint. The seller can either accept or reject the change with the Order Response.

# Prerequisite

# Step 1: Change the order

Change the order via the POST /api/v1/{partyId}/generic/send endpoint by providing an Order Changed XML.

# Step 2: Receive hooks

When the order change is successfully received by the receiver access point a topic OrderChangeSent will be broadcasted to your registered hooks.

The available topics are:

  • OrderChangeSent
  • OrderChangeSentError
  • OrderChangeSentRetry

# Step 3: Receive confirmation via Order Response

The seller can either accept or reject your order change. Once the order response message is received a hook with topic OrderResponseReceived will be sent.

Order Change Accepted example

{
	"topic": "OrderResponseReceived",
	"partyId": "NL:KVK:RECEIVER",
	"hookId": "111",
	"documentId": "b34d7213-dd81-4a23-8867-99b12b4ca39e",
	"refToDocumentId": "2a737b9e-a724-4153-8a86-4fb8f334db8b",
	"message": "'OrderResponse' received. Status: 'Accept'.",
	"details": {
		"note": "Response message to accept change of the order.",
		"statusCode": "AP",
		"status": "Accept",
        "orderReferenceId": "Order-1",
		"id": "Change-1",
		"protocol": "As4",
		"returnedMessageId": "b34d7213-dd81-4a23-8867-99b12b4ca39e@econnect.eu",
		"sender": "NL:KVK:SENDER",
		"accessPoint": "C=NL, O=eConnect International B.V., OU=PEPPOL TEST AP, CN=PNL000052",
		"documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3::2.1",
		"profileId": "urn:fdc:peppol.eu:poacc:bis:advanced_ordering:3",
		"receiver": "NL:KVK:RECEIVER",
		"messageId": "5156bf0f-9bf7-4687-9ae7-a678c7931a9b@econnect.eu",
		"refToMessageId": "2a737b9e-a724-4153-8a86-4fb8f334db8b@econnect.eu"
	},
	"createdOn": "2022-01-28T14:26:52.3980938+00:00",
	"sentOn": "2022-01-28T14:26:52.6101319+00:00"
}
© 2024 eConnect International B.V.