# Link transaction to customer GET https://api-sandbox.payabli.com/api/Customer/link/{customerId}/{transId} Links a customer to a transaction by ID. Reference: https://docs.payabli.com/developers/api-reference/customer/link-customer-to-transaction ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Link Customer to Transaction version: endpoint_customer.LinkCustomerTransaction paths: /Customer/link/{customerId}/{transId}: get: operationId: link-customer-transaction summary: Link Customer to Transaction description: Links a customer to a transaction by ID. tags: - - subpackage_customer parameters: - name: customerId in: path description: >- Payabli-generated customer ID. Maps to "Customer ID" column in PartnerHub. required: true schema: type: integer - name: transId in: path description: ReferenceId for the transaction (PaymentId). 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_:PayabliApiResponse00Responsedatanonobject '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:Responsecode: type: integer type_:PageIdentifier: type: string type_:IsSuccess: type: boolean type_:ResponseText: type: string type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:PayabliApiResponse00Responsedatanonobject: type: object properties: responseCode: $ref: '#/components/schemas/type_:Responsecode' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' roomId: type: integer format: int64 description: >- Describes the room ID. Only in use on Boarding endpoints, returns `0` when not applicable. isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' required: - responseText ``` ## SDK Code Examples ```python LinkCustomerTransaction from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.customer.link_customer_transaction( customer_id=998, trans_id="45-as456777hhhhhhhhhh77777777-324", ) ``` ```typescript LinkCustomerTransaction import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.customer.linkCustomerTransaction(998, "45-as456777hhhhhhhhhh77777777-324"); ``` ```go LinkCustomerTransaction import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Customer.LinkCustomerTransaction( context.TODO(), 998, "45-as456777hhhhhhhhhh77777777-324", ) ``` ```csharp LinkCustomerTransaction using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Customer.LinkCustomerTransactionAsync(998, "45-as456777hhhhhhhhhh77777777-324"); ``` ```ruby LinkCustomerTransaction require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Customer/link/998/45-as456777hhhhhhhhhh77777777-324") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java LinkCustomerTransaction HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Customer/link/998/45-as456777hhhhhhhhhh77777777-324") .header("requestToken", "") .asString(); ``` ```php LinkCustomerTransaction request('GET', 'https://api-sandbox.payabli.com/api/Customer/link/998/45-as456777hhhhhhhhhh77777777-324', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift LinkCustomerTransaction import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Customer/link/998/45-as456777hhhhhhhhhh77777777-324")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```