Skip to navigation

Update payment link

View as Markdown

Partially updates an existing payment link owned by the authenticated store. The body is a partial of the create DTO (all fields optional), and the supplied fields are shallow-merged over the link’s existing Data blob.

Behavior & side-effects

  • The link is looked up by :id scoped to user.store_id (404 if not found for this store).
  • PaymentRequestLifecycleService.assertUpdatable runs — the request must be in an updatable state (e.g. not COMPLETED/EXPIRED/DEACTIVATED), otherwise the update is rejected.
  • assertImmutableFieldsUnchanged runs — fields considered immutable once invoices exist for the link cannot be changed; attempting to change them fails.
  • If appId is supplied it replaces the current app association; otherwise the existing AppId is preserved.
  • Remaining fields are merged into the existing data ({ ...oldData, ...data }).

Authentication

  • Send the merchant API key in the x-api-key header (alias x-account-api-key).
  • Requires scope Merchant.payment_link.update.
  • Optionally scope the key to a specific store/account with the x-application-account-id header (alias x-account-id) or the application_account_id / account_id query param.

Path params

  • id — the payment link (payment request) id.

Body (application/json)

Any subset of the create-payment-link fields (see the Create payment link endpoint for the full field list, types, and conditional constraints). All fields are optional here (PartialType). Unknown properties are stripped by the global whitelist ValidationPipe.

Response

200 OK with the updated, presented PaymentLinkResponseDto.


Notas: Deprecated alias paths PATCH /v1/payment-links/:id and PATCH /v1/payment-link/:id route to this same handler. Full body field list, types and conditional constraints are identical to the Create payment link endpoint (this DTO is PartialType(CreatePaymentLinkDto)); only a representative subset is enumerated here. Update is rejected if the link is not in an updatable lifecycle state (assertUpdatable) or if immutable fields are changed after invoices exist (assertImmutableFieldsUnchanged).

Authentication

x-api-keystring
API Key authentication via header

Path parameters

idstringRequired

Id of the payment link (payment request) to update. Must belong to the authenticated store.

Headers

x-application-account-idstringOptional

Scope the request to a specific store / account instead of the one resolved from the API key. Aliases: the x-account-id header, or the application_account_id / account_id query parameter.

Request

This endpoint expects an object.
titlestringOptional
amountdoubleOptional
descriptionstringOptional