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

# Send payment link

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

Send a payment link to the specified email addresses or phone numbers.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi
  version: 1.0.0
paths:
  /PaymentLink/push/{payLinkId}:
    post:
      operationId: push-pay-link-from-id
      summary: Send payment link
      description: Send a payment link to the specified email addresses or phone numbers.
      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:
              $ref: '#/components/schemas/type_:PushPayLinkRequest'
servers:
  - url: https://api-sandbox.payabli.com/api
  - url: https://api.payabli.com/api
components:
  schemas:
    type_:PushPayLinkRequest:
      oneOf:
        - type: object
          properties:
            channel:
              type: string
              enum:
                - email
              description: 'Discriminator value: email'
            additionalEmails:
              type: array
              items:
                type: string
              description: >-
                List of additional email addresses you want to send the paylink
                to, formatted as an array. 

                Payment links and opt-in requests are sent to the customer email
                address on file, and additional 

                recipients can be specified here.
            attachFile:
              type: boolean
              description: When `true`, attaches a PDF version of the invoice to the email.
          required:
            - channel
        - type: object
          properties:
            channel:
              type: string
              enum:
                - sms
              description: 'Discriminator value: sms'
          required:
            - channel
      discriminator:
        propertyName: channel
      description: Request body for the push paylink operation.
      title: PushPayLinkRequest
    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 SendSMS
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.paymentLink.pushPayLinkFromId("payLinkId", {
        channel: "sms",
    });
}
main();

```

```python SendSMS
from payabli import payabli, PushPayLinkRequest_Sms

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.payment_link.push_pay_link_from_id(
    pay_link_id="payLinkId",
    request=PushPayLinkRequest_Sms(),
)

```

```csharp SendSMS
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.PushPayLinkFromIdAsync(
            "payLinkId",
            new PushPayLinkRequest(
                new PushPayLinkRequestSms()
            )
        );
    }

}

```

```go SendSMS
package main

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

func main() {

	url := "https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId"

	payload := strings.NewReader("{\n  \"channel\": \"sms\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")

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

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"channel\": \"sms\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"sms\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId', [
  'body' => '{
  "channel": "sms"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

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

```swift SendSMS
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["channel": "sms"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

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

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.paymentLink.pushPayLinkFromId("payLinkId", {
        channel: "email",
        additionalEmails: [
            "admin@example.com",
            "accounting@example.com",
        ],
        attachFile: true,
    });
}
main();

```

```python SendEmail
from payabli import payabli, PushPayLinkRequest_Email

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.payment_link.push_pay_link_from_id(
    pay_link_id="payLinkId",
    request=PushPayLinkRequest_Email(
        additional_emails=[
            "admin@example.com",
            "accounting@example.com"
        ],
        attach_file=True,
    ),
)

```

```csharp SendEmail
using PayabliPayabliApi;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace Usage;

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

        await client.PaymentLink.PushPayLinkFromIdAsync(
            "payLinkId",
            new PushPayLinkRequest(
                new PushPayLinkRequestEmail {
                    AdditionalEmails = new List<string>(){
                        "admin@example.com",
                        "accounting@example.com",
                    }
                    ,
                    AttachFile = true
                }
            )
        );
    }

}

```

```go SendEmail
package main

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

func main() {

	url := "https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId"

	payload := strings.NewReader("{\n  \"channel\": \"email\",\n  \"additionalEmails\": [\n    \"admin@example.com\",\n    \"accounting@example.com\"\n  ],\n  \"attachFile\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")

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

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"channel\": \"email\",\n  \"additionalEmails\": [\n    \"admin@example.com\",\n    \"accounting@example.com\"\n  ],\n  \"attachFile\": true\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"email\",\n  \"additionalEmails\": [\n    \"admin@example.com\",\n    \"accounting@example.com\"\n  ],\n  \"attachFile\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId', [
  'body' => '{
  "channel": "email",
  "additionalEmails": [
    "admin@example.com",
    "accounting@example.com"
  ],
  "attachFile": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

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

```swift SendEmail
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "channel": "email",
  "additionalEmails": ["admin@example.com", "accounting@example.com"],
  "attachFile": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```