Sometimes the customer data is not final when the solicitation starts, or needs to be corrected afterwards. In these cases you can update the customer data of an existing order without starting a new solicitation, keeping the same order and its conditions.

Issue a PUT to the order uuid with the root-level field action_type set to update_customer_data and without the state field. Send the same complete payload you use to start the solicitation; only these sections will be updated:

  • customer
  • delivery_address
  • invoice_address

Each section you include replaces the stored one entirely, so always send complete objects. Any other section in the payload (cart, merchant, etc.) is ignored by this call. Note that PATCH is not supported for this call; use PUT.

When is updating allowed

The customer data can be updated only while all of these conditions hold:

  • The order is still pending: no state transition has happened yet.
  • The shopper has not started the identification process.
  • The checkout form URL has not been delivered to the shopper, neither by SMS nor by email.

Once any of these conditions is not met the call returns an error and the customer data is left untouched.

cURL example

$ SQPASS='yourAccountKey:yourAccountSecret'
$ curl -i -X PUT -u $SQPASS -k \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @update_customer_data_sample.json \
  https://sandbox.sequrapi.com/orders/1dc26b35-06f6-41d6-b6f5-d0eb6c66aad1

Where update_customer_data_sample.json contains the same payload used to start the solicitation, with action_type added at the root and state removed. See the payload description for the full field list.

{
  "action_type": "update_customer_data",
  "order": {
    "customer": { "given_names": "Ahmad", "surnames": "Ali", "email": "ahmad@example.com", ... },
    "delivery_address": { ... },
    "invoice_address": { ... },
    "cart": { ... },
    "merchant": { ... },
    "gui": { ... },
    "platform": { ... }
  }
}

Responses

  • 200 (OK): the customer data was updated.
  • 202 (Accepted): the request was valid but the data was already the same; nothing changed.
  • 409 (Conflict): the update is not allowed for this order any more, the payload also requests a state transition, or the updated data is not valid. The response body contains the errors.