commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Payment → Update Payment by Key

AI-generated

Summary

Update a commercetools Payment identified by its unique key, applying specified actions to modify its data.

Inputs

  • Payment Key (required) — The unique key string of the Payment resource to update.
  • Version (required) — The current version number of the Payment to ensure concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply; if provided and not empty, it overrides the UI-based actions.
  • Actions (UI) — A set of structured update actions selectable via the UI, representing common updates like adding transactions, changing states, setting custom fields, and more.

Output shape

a single JSON object representing the updated Payment resource returned from the commercetools API

The update requires the correct current version to avoid conflicts. The returned object contains the Payment after applying the actions. Errors on invalid keys, versions, or actions will be surfaced as operation failures.

Examples

Example 1: Update a Payment by its key 'payment-123' to add a transaction and set a custom field.

Set resource to 'Payment', operation to 'Update Payment by Key', supply 'payment-123' as Payment Key, current version number, and provide actions via the UI or JSON to add the transaction and custom field.

Links

Discussion