---
title: "Update a payment link (its URL stays the same); active: false turns it off"
method: POST
path: "/payment_links/{id}"
tags: ["Payment links"]
---

# Update a payment link (its URL stays the same); active: false turns it off

`POST /payment_links/{id}`

## Request

- Base URL: `https://shieldz.cash/api/v1`
- URL: `https://shieldz.cash/api/v1/payment_links/{id}`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- PaymentLinkCreate
  - `line_items` object[], required
    - `price` string: An active price (price_…) of this shop.
    - `product` string: Shorthand for the product's default price. The link keeps that price ID.
    - `quantity` integer: Starting quantity. Must be 1 for a customer-chosen price.
    - `adjustable_quantity` object: Let the buyer change the quantity with a − / + stepper. Not allowed with a customer-chosen price.
      - `enabled` boolean: true shows the stepper.
      - `minimum` integer: Lowest quantity the buyer can pick.
      - `maximum` integer: Highest quantity the buyer can pick.
  - `idempotency_key` string: Retrying with the same key returns the first object (200, idempotent_replay: true) instead of creating another. The SDKs add one for you.
  - `collect_email` boolean: Ask the buyer for an email before payment.
  - `collect_shipping_address` boolean: Ask for a shipping address. It's on the invoice as shipping, for your API key and webhooks only.
  - `after_completion` object: What the buyer sees after paying. Defaults to the hosted confirmation.
    - `type` 'hosted_confirmation' | 'redirect'
    - `hosted_confirmation` object
      - `custom_message` string: A thank-you note on the confirmation page.
    - `redirect` object
      - `url` string, uri: A public https URL to send the buyer to.

## Response `200`

OK

- PaymentLink
  - `id` string
  - `object` 'payment_link'
  - `url` string, uri: The hosted page (/l/plink_…). Share it, or put the ID on a buy button: <button data-shieldz-link="plink_…">.
  - `active` boolean: false once turned off; the page then says the item isn't available.
  - `line_items` object[]
    - `price` Price
      - `id` string
      - `object` 'price'
      - `product` string: The product (prod_…) this price belongs to.
      - `active` boolean: false once archived. An archived price can't be added to new carts or links.
      - `unit_amount_usd_cents` integer, nullable: Fixed price per unit in USD cents; null when the customer chooses the amount.
      - `custom_unit_amount` object, nullable: The range the customer chooses from; null for a fixed price.
        - `minimum_usd_cents` integer, nullable
        - `maximum_usd_cents` integer, nullable
        - `preset_usd_cents` integer, nullable
      - `created_at` integer: Unix milliseconds.
    - `product` object, nullable
      - `id` string
      - `name` string
      - `image_url` string, nullable
      - `active` boolean
    - `quantity` integer
    - `adjustable_quantity` object
      - `enabled` boolean
      - `minimum` integer
      - `maximum` integer
  - `collect_email` boolean
  - `collect_shipping_address` boolean
  - `after_completion` object: { type: "redirect", redirect: { url } } or { type: "hosted_confirmation", hosted_confirmation: { custom_message } }.
  - `paid_count` integer: Invoices from this link that were paid.
  - `paid_usd_cents` integer: Their total, in USD cents.
  - `created_at` integer: Unix milliseconds.
  - `updated_at` integer: Unix milliseconds.

---

[API](https://skmtc.dev/shieldz/apis/shieldz-api.md) · [All operations](https://skmtc.dev/shieldz/apis/shieldz-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shieldz/apis/shieldz-api/revisions/0d7156bee439?raw)
