> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Update payment link

PUT https://api-sandbox.payabli.com/api/PaymentLink/update/{payLinkId}
Content-Type: application/json

Updates a payment link's details.

Reference: https://docs.payabli.com/developers/api-reference/paymentlink/update-payment-link

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi
  version: 1.0.0
paths:
  /PaymentLink/update/{payLinkId}:
    put:
      operationId: update-pay-link-from-id
      summary: Update payment link
      description: Updates a payment link's details.
      tags:
        - subpackage_paymentLink
      parameters:
        - name: payLinkId
          in: path
          description: ID for the payment link.
          required: true
          schema:
            type: string
        - name: requestToken
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/type_paymentLink:PayabliApiResponsePaymentLinks
        '400':
          description: Bad request/ invalid data
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal API Error
          content:
            application/json:
              schema:
                description: Any type
        '503':
          description: Database connection error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:PayabliApiResponse'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contactUs:
                  $ref: '#/components/schemas/type_:ContactElement'
                  description: ContactUs section of payment link page
                logo:
                  $ref: '#/components/schemas/type_:Element'
                  description: Logo section of payment link page
                messageBeforePaying:
                  $ref: '#/components/schemas/type_:LabelElement'
                  description: Message section of payment link page
                notes:
                  $ref: '#/components/schemas/type_:NoteElement'
                  description: Notes section of payment link page
                page:
                  $ref: '#/components/schemas/type_:PageElement'
                  description: Page header section of payment link page
                paymentButton:
                  $ref: '#/components/schemas/type_:LabelElement'
                  description: Payment button section of payment link page
                paymentMethods:
                  $ref: '#/components/schemas/type_:MethodElement'
                  description: Payment methods section of payment link page
                review:
                  $ref: '#/components/schemas/type_:HeaderElement'
                  description: Review section of payment link page
                settings:
                  $ref: '#/components/schemas/type_:PagelinkSetting'
                  description: Settings section of payment link page
servers:
  - url: https://api-sandbox.payabli.com/api
  - url: https://api.payabli.com/api
components:
  schemas:
    type_:Enabled:
      type: boolean
      description: Toggles whether the section or element is enabled.
      title: Enabled
    type_:Order:
      type: integer
      description: Order of element or section in container.
      title: Order
    type_:ContactElement:
      type: object
      properties:
        emailLabel:
          type: string
          description: Custom content for email
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        header:
          type: string
          description: Header text for section
        order:
          $ref: '#/components/schemas/type_:Order'
        paymentIcons:
          type: boolean
          description: Flag indicating if icons for accepted card brands will be shown
        phoneLabel:
          type: string
          description: Custom content for phone number
      title: ContactElement
    type_:Element:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        order:
          $ref: '#/components/schemas/type_:Order'
      title: Element
    type_:LabelElement:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        label:
          type: string
          description: Label to display for section or element
        order:
          $ref: '#/components/schemas/type_:Order'
      title: LabelElement
    type_:NoteElement:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        header:
          type: string
          description: Header text for section
        order:
          $ref: '#/components/schemas/type_:Order'
        placeholder:
          type: string
          description: Placeholder text for input field
        value:
          type: string
          description: Pre-populated value for input field
      title: NoteElement
    type_:PageElement:
      type: object
      properties:
        description:
          type: string
          description: Page description in header
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        header:
          type: string
          description: Page header
        order:
          $ref: '#/components/schemas/type_:Order'
      title: PageElement
    type_:MethodsList:
      type: object
      properties:
        amex:
          type: boolean
          description: When `true`, American Express is accepted.
        applePay:
          type: boolean
          description: When `true`, Apple Pay is accepted.
        googlePay:
          type: boolean
          description: When `true`, Google Pay is accepted.
        discover:
          type: boolean
          description: When `true`, Discover is accepted.
        eCheck:
          type: boolean
          description: When `true`, ACH is accepted.
        mastercard:
          type: boolean
          description: When `true`, Mastercard is accepted.
        visa:
          type: boolean
          description: When `true`, Visa is accepted.
      title: MethodsList
    type_:MethodElementSettingsApplePayButtonStyle:
      type: string
      enum:
        - black
        - white-outline
        - white
      default: black
      description: >-
        The Apple Pay button style. See [Apple Pay Button
        Style](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-button-style)
        for more information.
      title: MethodElementSettingsApplePayButtonStyle
    type_:MethodElementSettingsApplePayButtonType:
      type: string
      enum:
        - plain
        - buy
        - donate
        - check-out
        - book
        - continue
        - top-up
        - order
        - rent
        - support
        - contribute
        - tip
        - pay
      default: pay
      description: >-
        The text on Apple Pay button. See [Apple Pay Button
        Type](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-button-type)
        for more information.
      title: MethodElementSettingsApplePayButtonType
    type_:MethodElementSettingsApplePayLanguage:
      type: string
      enum:
        - en-US
        - ar-AB
        - ca-ES
        - zh-CN
        - zh-HK
        - zh-TW
        - hr-HR
        - cs-CZ
        - da-DK
        - de-DE
        - nl-NL
        - en-AU
        - en-GB
        - fi-FI
        - fr-CA
        - fr-FR
        - el-GR
        - he-IL
        - hi-IN
        - hu-HU
        - id-ID
        - it-IT
        - ja-JP
        - ko-KR
        - ms-MY
        - nb-NO
        - pl-PL
        - pt-BR
        - pt-PT
        - ro-RO
        - ru-RU
        - sk-SK
        - es-MX
        - es-ES
        - sv-SE
        - th-TH
        - tr-TR
        - uk-UA
        - vi-VN
      default: en-US
      description: >-
        The Apple Pay button locale. See [Apple Pay Button
        Language](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-language)
        for more information.
      title: MethodElementSettingsApplePayLanguage
    type_:MethodElementSettingsApplePay:
      type: object
      properties:
        buttonStyle:
          $ref: '#/components/schemas/type_:MethodElementSettingsApplePayButtonStyle'
          default: black
          description: >-
            The Apple Pay button style. See [Apple Pay Button
            Style](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-button-style)
            for more information.
        buttonType:
          $ref: '#/components/schemas/type_:MethodElementSettingsApplePayButtonType'
          default: pay
          description: >-
            The text on Apple Pay button. See [Apple Pay Button
            Type](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-button-type)
            for more information.
        language:
          $ref: '#/components/schemas/type_:MethodElementSettingsApplePayLanguage'
          default: en-US
          description: >-
            The Apple Pay button locale. See [Apple Pay Button
            Language](/developers/developer-guides/hosted-payment-page-apple-pay#param-applepay-language)
            for more information.
      title: MethodElementSettingsApplePay
    type_:MethodElementSettings:
      type: object
      properties:
        applePay:
          $ref: '#/components/schemas/type_:MethodElementSettingsApplePay'
      description: Settings for wallet payment methods.
      title: MethodElementSettings
    type_:MethodElement:
      type: object
      properties:
        allMethodsChecked:
          type: boolean
          description: Flag indicating if all allowed payment methods will be pre-selected.
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        header:
          type: string
          description: Header text for section
        methods:
          $ref: '#/components/schemas/type_:MethodsList'
        order:
          $ref: '#/components/schemas/type_:Order'
        settings:
          $ref: '#/components/schemas/type_:MethodElementSettings'
          description: Settings for wallet payment methods.
      title: MethodElement
    type_:HeaderElement:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/type_:Enabled'
        header:
          type: string
          description: Header text for section
        order:
          $ref: '#/components/schemas/type_:Order'
      title: HeaderElement
    type_:FileContentFtype:
      type: string
      enum:
        - pdf
        - doc
        - docx
        - jpg
        - jpeg
        - png
        - gif
        - txt
      description: The MIME type of the file (if content is provided)
      title: FileContentFtype
    type_:FileContent:
      type: object
      properties:
        fContent:
          type: string
          description: >-
            Content of file, Base64-encoded. Ignored if furl is specified. Max
            upload size is 30 MB.
        filename:
          type: string
          description: The name of the attached file.
        ftype:
          $ref: '#/components/schemas/type_:FileContentFtype'
          description: The MIME type of the file (if content is provided)
        furl:
          type: string
          description: Optional URL provided to show or download the file remotely
      description: Contains details about a file. Max upload size is 30 MB.
      title: FileContent
    type_:PagelinkSetting:
      type: object
      properties:
        color:
          type: string
          description: 'An HTML color code in format #RRGGBB'
        customCssUrl:
          type: string
          description: Complete URL to a custom CSS file to be loaded with the page
        language:
          type: string
          description: Two-letter code following ISO 639-1
        pageLogo:
          $ref: '#/components/schemas/type_:FileContent'
          description: Object containing logo file to upload/ use in page
        redirectAfterApprove:
          type: boolean
          description: >-
            Flag indicating if the capability for redirection in the page will
            be activated
        redirectAfterApproveUrl:
          type: string
          description: Complete URL where the page will be redirected after completion
      title: PagelinkSetting
    type_:IsSuccess:
      type: boolean
      description: >-
        Boolean indicating whether the operation was successful. A `true` value
        indicates success. A `false` value indicates failure.
      title: IsSuccess
    type_:ResponseText:
      type: string
      description: 'Response text for operation: ''Success'' or ''Declined''.'
      title: ResponseText
    type_paymentLink:PayabliApiResponsePaymentLinks:
      type: object
      properties:
        isSuccess:
          $ref: '#/components/schemas/type_:IsSuccess'
        responseData:
          type: string
          description: >-
            If `isSuccess` = true, this contains the payment link identifier. If
            `isSuccess` = false, this contains the reason of the error.
        responseText:
          $ref: '#/components/schemas/type_:ResponseText'
      required:
        - isSuccess
        - responseText
      title: PayabliApiResponsePaymentLinks
    type_:Responsedata:
      type: object
      additionalProperties:
        description: Any type
      description: The object containing the response data.
      title: Responsedata
    type_:PayabliApiResponse:
      type: object
      properties:
        isSuccess:
          $ref: '#/components/schemas/type_:IsSuccess'
        responseData:
          $ref: '#/components/schemas/type_:Responsedata'
        responseText:
          $ref: '#/components/schemas/type_:ResponseText'
      required:
        - responseText
      title: PayabliApiResponse
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: requestToken

```

## SDK Code Examples

```typescript UpdatePayLink
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.paymentLink.updatePayLinkFromId("332-c277b704-1301", {
        notes: {
            enabled: true,
            header: "Additional Notes",
            order: 0,
            placeholder: "Enter any additional notes here",
            value: "",
        },
        paymentButton: {
            enabled: true,
            label: "Pay Now",
            order: 0,
        },
    });
}
main();

```

```python UpdatePayLink
from payabli import payabli, NoteElement, LabelElement

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.payment_link.update_pay_link_from_id(
    pay_link_id="332-c277b704-1301",
    notes=NoteElement(
        enabled=True,
        header="Additional Notes",
        order=0,
        placeholder="Enter any additional notes here",
        value="",
    ),
    payment_button=LabelElement(
        enabled=True,
        label="Pay Now",
        order=0,
    ),
)

```

```java UpdatePayLink
package com.example.usage;

import io.github.payabli.api.PayabliPayabliApiClient;
import io.github.payabli.api.resources.paymentlink.requests.PayLinkUpdateData;
import io.github.payabli.api.types.LabelElement;
import io.github.payabli.api.types.NoteElement;

public class Example {
    public static void main(String[] args) {
        PayabliPayabliApiClient client = PayabliPayabliApiClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.paymentLink().updatePayLinkFromId(
            "332-c277b704-1301",
            PayLinkUpdateData
                .builder()
                .notes(
                    NoteElement
                        .builder()
                        .enabled(true)
                        .header("Additional Notes")
                        .order(0)
                        .placeholder("Enter any additional notes here")
                        .value("")
                        .build()
                )
                .paymentButton(
                    LabelElement
                        .builder()
                        .enabled(true)
                        .label("Pay Now")
                        .order(0)
                        .build()
                )
                .build()
        );
    }
}
```

```ruby UpdatePayLink
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

client.payment_link.update_pay_link_from_id(
  pay_link_id: "332-c277b704-1301",
  notes: {
    enabled: true,
    header: "Additional Notes",
    order: 0,
    placeholder: "Enter any additional notes here",
    value: ""
  },
  payment_button: {
    enabled: true,
    label: "Pay Now",
    order: 0
  }
)

```

```csharp UpdatePayLink
using PayabliPayabliApi;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayabliPayabliApiClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.PaymentLink.UpdatePayLinkFromIdAsync(
            "332-c277b704-1301",
            new PayLinkUpdateData {
                Notes = new NoteElement {
                    Enabled = true,
                    Header = "Additional Notes",
                    Order = 0,
                    Placeholder = "Enter any additional notes here",
                    Value = ""
                },
                PaymentButton = new LabelElement {
                    Enabled = true,
                    Label = "Pay Now",
                    Order = 0
                }
            }
        );
    }

}

```

```go UpdatePayLink
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithApiKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    request := &payabli.PayLinkUpdateData{
        Notes: &payabli.NoteElement{
            Enabled: payabli.Bool(
                true,
            ),
            Header: payabli.String(
                "Additional Notes",
            ),
            Order: payabli.Int(
                0,
            ),
            Placeholder: payabli.String(
                "Enter any additional notes here",
            ),
            Value: payabli.String(
                "",
            ),
        },
        PaymentButton: &payabli.LabelElement{
            Enabled: payabli.Bool(
                true,
            ),
            Label: payabli.String(
                "Pay Now",
            ),
            Order: payabli.Int(
                0,
            ),
        },
    }
    client.PaymentLink.UpdatePayLinkFromId(
        context.TODO(),
        "332-c277b704-1301",
        request,
    )
}

```

```php UpdatePayLink
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\PaymentLink\Requests\PayLinkUpdateData;
use Payabli\Types\NoteElement;
use Payabli\Types\LabelElement;

$client = new PayabliClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->paymentLink->updatePayLinkFromId(
    '332-c277b704-1301',
    new PayLinkUpdateData([
        'notes' => new NoteElement([
            'enabled' => true,
            'header' => 'Additional Notes',
            'order' => 0,
            'placeholder' => 'Enter any additional notes here',
            'value' => '',
        ]),
        'paymentButton' => new LabelElement([
            'enabled' => true,
            'label' => 'Pay Now',
            'order' => 0,
        ]),
    ]),
);

```

```swift UpdatePayLink
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "notes": [
    "enabled": true,
    "header": "Additional Notes",
    "order": 0,
    "placeholder": "Enter any additional notes here",
    "value": ""
  ],
  "paymentButton": [
    "enabled": true,
    "label": "Pay Now",
    "order": 0
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentLink/update/332-c277b704-1301")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```