Update payment link
Update payment link
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
:idscoped touser.store_id(404 if not found for this store). PaymentRequestLifecycleService.assertUpdatableruns — the request must be in an updatable state (e.g. not COMPLETED/EXPIRED/DEACTIVATED), otherwise the update is rejected.assertImmutableFieldsUnchangedruns — fields considered immutable once invoices exist for the link cannot be changed; attempting to change them fails.- If
appIdis supplied it replaces the current app association; otherwise the existingAppIdis preserved. - Remaining fields are merged into the existing data (
{ ...oldData, ...data }).
Authentication
- Send the merchant API key in the
x-api-keyheader (aliasx-account-api-key). - Requires scope
Merchant.payment_link.update. - Optionally scope the key to a specific store/account with the
x-application-account-idheader (aliasx-account-id) or theapplication_account_id/account_idquery 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
Path parameters
Id of the payment link (payment request) to update. Must belong to the authenticated store.
Headers
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.
