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

# Delete payment link

DELETE https://api-sandbox.payabli.com/api/PaymentLink/{payLinkId}

Deletes a payment link by ID.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi
  version: 1.0.0
paths:
  /PaymentLink/{payLinkId}:
    delete:
      operationId: delete-pay-link-from-id
      summary: Delete payment link
      description: Deletes a payment link by ID.
      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'
servers:
  - url: https://api-sandbox.payabli.com/api
  - url: https://api.payabli.com/api
components:
  schemas:
    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 DeletePayLink
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.paymentLink.deletePayLinkFromId("2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234");
}
main();

```

```python DeletePayLink
from payabli import payabli

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.payment_link.delete_pay_link_from_id(
    pay_link_id="2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234",
)

```

```csharp DeletePayLink
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.DeletePayLinkFromIdAsync(
            "2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234"
        );
    }

}

```

```go DeletePayLink
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/PaymentLink/2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("requestToken", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby DeletePayLink
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/PaymentLink/2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["requestToken"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java DeletePayLink
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api-sandbox.payabli.com/api/PaymentLink/2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234")
  .header("requestToken", "<apiKey>")
  .asString();
```

```php DeletePayLink
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-sandbox.payabli.com/api/PaymentLink/2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234', [
  'headers' => [
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```swift DeletePayLink
import Foundation

let headers = ["requestToken": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentLink/2325-XXXXXXX-90b1-4598-b6c7-44cdcbf495d7-1234")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```