# 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.1 info: title: Update payment link version: endpoint_paymentLink.updatePayLinkFromId 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: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} 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 components: schemas: type_:Enabled: type: boolean type_:Order: type: integer 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 type_:Element: type: object properties: enabled: $ref: '#/components/schemas/type_:Enabled' order: $ref: '#/components/schemas/type_:Order' 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' 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 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' 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. type_:MethodElementSettingsApplePayButtonStyle: type: string enum: - value: black - value: white-outline - value: white default: black type_:MethodElementSettingsApplePayButtonType: type: string enum: - value: plain - value: buy - value: donate - value: check-out - value: book - value: continue - value: top-up - value: order - value: rent - value: support - value: contribute - value: tip - value: pay default: pay type_:MethodElementSettingsApplePayLanguage: type: string enum: - value: en-US - value: ar-AB - value: ca-ES - value: zh-CN - value: zh-HK - value: zh-TW - value: hr-HR - value: cs-CZ - value: da-DK - value: de-DE - value: nl-NL - value: en-AU - value: en-GB - value: fi-FI - value: fr-CA - value: fr-FR - value: el-GR - value: he-IL - value: hi-IN - value: hu-HU - value: id-ID - value: it-IT - value: ja-JP - value: ko-KR - value: ms-MY - value: nb-NO - value: pl-PL - value: pt-BR - value: pt-PT - value: ro-RO - value: ru-RU - value: sk-SK - value: es-MX - value: es-ES - value: sv-SE - value: th-TH - value: tr-TR - value: uk-UA - value: vi-VN default: en-US type_:MethodElementSettingsApplePay: type: object properties: buttonStyle: $ref: '#/components/schemas/type_:MethodElementSettingsApplePayButtonStyle' 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' 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' 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. type_:MethodElementSettings: type: object properties: applePay: $ref: '#/components/schemas/type_:MethodElementSettingsApplePay' 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. 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' type_:FileContentFtype: type: string enum: - value: pdf - value: doc - value: docx - value: jpg - value: jpeg - value: png - value: gif - value: txt 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 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 type_:IsSuccess: type: boolean type_:ResponseText: type: string 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 ``` ## SDK Code Examples ```python UpdatePayLink from payabli import LabelElement, NoteElement, payabli client = payabli( api_key="YOUR_API_KEY", ) 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, ), ) ``` ```typescript UpdatePayLink import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); 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 } }); ``` ```go UpdatePayLink import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.PaymentLink.UpdatePayLinkFromId( context.TODO(), "332-c277b704-1301", &sdkgo.PayLinkUpdateData{ Notes: &sdkgo.NoteElement{ Enabled: sdkgo.Bool( true, ), Header: sdkgo.String( "Additional Notes", ), Order: sdkgo.Int( 0, ), Placeholder: sdkgo.String( "Enter any additional notes here", ), Value: sdkgo.String( "", ), }, PaymentButton: &sdkgo.LabelElement{ Enabled: sdkgo.Bool( true, ), Label: sdkgo.String( "Pay Now", ), Order: sdkgo.Int( 0, ), }, }, ) ``` ```csharp UpdatePayLink using PayabliApi; var client = new PayabliApiClient("API_KEY"); 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, }, } ); ``` ```ruby UpdatePayLink require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/PaymentLink/update/332-c277b704-1301") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"notes\": {\n \"enabled\": true,\n \"header\": \"Additional Notes\",\n \"order\": 0,\n \"placeholder\": \"Enter any additional notes here\",\n \"value\": \"\"\n },\n \"paymentButton\": {\n \"enabled\": true,\n \"label\": \"Pay Now\",\n \"order\": 0\n }\n}" response = http.request(request) puts response.read_body ``` ```java UpdatePayLink HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/PaymentLink/update/332-c277b704-1301") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"notes\": {\n \"enabled\": true,\n \"header\": \"Additional Notes\",\n \"order\": 0,\n \"placeholder\": \"Enter any additional notes here\",\n \"value\": \"\"\n },\n \"paymentButton\": {\n \"enabled\": true,\n \"label\": \"Pay Now\",\n \"order\": 0\n }\n}") .asString(); ``` ```php UpdatePayLink request('PUT', 'https://api-sandbox.payabli.com/api/PaymentLink/update/332-c277b704-1301', [ 'body' => '{ "notes": { "enabled": true, "header": "Additional Notes", "order": 0, "placeholder": "Enter any additional notes here", "value": "" }, "paymentButton": { "enabled": true, "label": "Pay Now", "order": 0 } }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift UpdatePayLink import Foundation let headers = [ "requestToken": "", "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() ```