# 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.1 info: title: Send payment link version: endpoint_paymentLink.pushPayLinkFromId 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: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/type_:PushPayLinkRequest' 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 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 SendSMS from payabli import PushPayLinkRequest_Sms, payabli client = payabli( api_key="YOUR_API_KEY", ) client.payment_link.push_pay_link_from_id( pay_link_id="payLinkId", request=PushPayLinkRequest_Sms(), ) ``` ```typescript SendSMS import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.paymentLink.pushPayLinkFromId("payLinkId", { channel: "sms" }); ``` ```go SendSMS 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.PushPayLinkFromId( context.TODO(), "payLinkId", &sdkgo.PushPayLinkRequest{ Sms: &sdkgo.PushPayLinkRequestSms{}, }, ) ``` ```csharp SendSMS using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.PaymentLink.PushPayLinkFromIdAsync( "payLinkId", new PushPayLinkRequest(new PushPayLinkRequest.Sms(new PushPayLinkRequestSms())) ); ``` ```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"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"channel\": \"sms\"\n}" response = http.request(request) puts response.read_body ``` ```java SendSMS HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"channel\": \"sms\"\n}") .asString(); ``` ```php SendSMS request('POST', 'https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId', [ 'body' => '{ "channel": "sms" }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift SendSMS import Foundation let headers = [ "requestToken": "", "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() ``` ```python SendEmail from payabli import PushPayLinkRequest_Email, payabli client = payabli( api_key="YOUR_API_KEY", ) 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, ), ) ``` ```typescript SendEmail import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.paymentLink.pushPayLinkFromId("payLinkId", { channel: "email", additionalEmails: ["admin@example.com", "accounting@example.com"], attachFile: true }); ``` ```go SendEmail 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.PushPayLinkFromId( context.TODO(), "payLinkId", &sdkgo.PushPayLinkRequest{ Sms: &sdkgo.PushPayLinkRequestSms{}, }, ) ``` ```csharp SendEmail using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.PaymentLink.PushPayLinkFromIdAsync( "payLinkId", new PushPayLinkRequest( new PushPayLinkRequest.Email( new PushPayLinkRequestEmail { AdditionalEmails = new List() { "admin@example.com", "accounting@example.com", }, AttachFile = true, } ) ) ); ``` ```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"] = '' 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 HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentLink/push/payLinkId") .header("requestToken", "") .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 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' => '', ], ]); echo $response->getBody(); ``` ```swift SendEmail import Foundation let headers = [ "requestToken": "", "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() ```