# Update payment link status

> Enable or disable a payment link by Payment Link ID.

```yaml
openapi: 3.1.0
x-onerway-docs-version: v2
x-onerway-spec-key: payments/versions/v2/payment-links/update-payment-link-status
info:
  title: Update payment link status
  version: v2
  description: Enable or disable a payment link by Payment Link ID.
servers:
  - url: https://sandbox-payment-api.onerway.com
    description: sandbox
  - url: https://payment-api.onerway.com
    description: production
paths:
  /v1/txn/paymentLink/updateStatus:
    post:
      summary: Update payment link status
      description: Enable or disable a payment link by Payment Link ID.
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: API key for the merchant account. Send it in the `ApiKey` request
            header. See
            [Authentication](/payments/versions/v2/get-started/authentication).
          schema:
            type: string
            description: API key for the merchant account. Send it in the `ApiKey` request
              header. See
              [Authentication](/payments/versions/v2/get-started/authentication).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: Payment Link ID returned by [Create payment
                    link](/payments/versions/v2/api-reference/endpoints/create-payment-link)
                    or [List payment
                    links](/payments/versions/v2/api-reference/endpoints/list-payment-links).
                    Submit it as a string.
                linkStatus:
                  type: boolean
                  description: Target payment link status.
                  x-onerway-constraints:
                    - kind: values
                      text: Submit boolean `true` to enable the payment link or boolean `false` to
                        disable it; do not submit numeric `1` or `0` for this
                        update endpoint.
                merchantNo:
                  type: string
                  description: Merchant number assigned by Onerway. See
                    [Setup](/payments/versions/v2/get-started/setup#retrieve-your-credentials)
                    for how to obtain it.
              required:
                - id
                - linkStatus
                - merchantNo
            examples:
              enable-payment-link:
                summary: Enable payment link
                value:
                  id: payment_link_demo_202606210001
                  linkStatus: true
                  merchantNo: replace_with_merchant_no
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: "`20000` means the status update request was processed
                      successfully. Other values are error codes. See [Response
                      codes](/payments/versions/v2/api-reference/response-codes\
                      )."
                  respMsg:
                    type: string
                    description: Human-readable message for the response code.
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      {}
                    description: Status update result data.
                    x-onerway-value:
                      nullable: true
                      when:
                        en: Can be `null` when the update succeeds.
                        zh: 更新成功时可为 `null`。
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ApiKey
```
