# Migrate paypoint POST https://api-sandbox.payabli.com/api/Paypoint/migrate Content-Type: application/json Migrates a paypoint to a new parent organization. Reference: https://docs.payabli.com/developers/api-reference/paypoint/migrate-paypoint-to-another-organization ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Migrate paypoint version: endpoint_paypoint.migrate paths: /Paypoint/migrate: post: operationId: migrate summary: Migrate paypoint description: Migrates a paypoint to a new parent organization. tags: - - subpackage_paypoint parameters: - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_paypoint:MigratePaypointResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/type_paypoint:PaypointMoveRequest' components: schemas: type_:Entrypointfield: type: string type_paypoint:WebHeaderParameter: type: object properties: key: type: string value: type: string required: - key - value type_paypoint:NotificationRequest: type: object properties: notificationUrl: type: string description: Complete HTTP URL receiving the notification webHeaderParameters: type: array items: $ref: '#/components/schemas/type_paypoint:WebHeaderParameter' description: >- A dictionary of key-value pairs to be inserted in the header when the notification request is submitted required: - notificationUrl type_paypoint:PaypointMoveRequest: type: object properties: entryPoint: $ref: '#/components/schemas/type_:Entrypointfield' newParentOrganizationId: type: integer description: The ID for the paypoint's new parent organization. notificationRequest: $ref: '#/components/schemas/type_paypoint:NotificationRequest' description: Optional notification request object for a webhook required: - entryPoint - newParentOrganizationId type_:IsSuccess: type: boolean type_:Responsecode: type: integer type_:ResponseText: type: string type_paypoint:MigratePaypointResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseText: $ref: '#/components/schemas/type_:ResponseText' required: - isSuccess - responseText ``` ## SDK Code Examples ```typescript MigrateWithNotification import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.paypoint.migrate({ entryPoint: "473abc123def", newParentOrganizationId: 123, notificationRequest: { notificationUrl: "https://webhook-test.yoursie.com", webHeaderParameters: [ { key: "testheader", value: "1234567890", }, ], }, }); } main(); ``` ```python MigrateWithNotification from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.paypoint.migrate( entry_point="473abc123def", new_parent_organization_id=123, notification_request={ "notification_url": "https://webhook-test.yoursie.com", "web_header_parameters": [ { "key": "testheader", "value": "1234567890" } ] } ) ``` ```csharp MigrateWithNotification using PayabliApi; using System.Threading.Tasks; using System.Collections.Generic; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.Paypoint.MigrateAsync( new PaypointMoveRequest { EntryPoint = "473abc123def", NewParentOrganizationId = 123, NotificationRequest = new NotificationRequest { NotificationUrl = "https://webhook-test.yoursie.com", WebHeaderParameters = new List(){ new WebHeaderParameter { Key = "testheader", Value = "1234567890" }, } } } ); } } ``` ```go MigrateWithNotification package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) request := &payabli.PaypointMoveRequest{ EntryPoint: "473abc123def", NewParentOrganizationId: 123, NotificationRequest: &payabli.NotificationRequest{ NotificationUrl: "https://webhook-test.yoursie.com", WebHeaderParameters: []*payabli.WebHeaderParameter{ &payabli.WebHeaderParameter{ Key: "testheader", Value: "1234567890", }, }, }, } client.Paypoint.Migrate( context.TODO(), request, ) } ``` ```ruby MigrateWithNotification require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Paypoint/migrate") 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 \"entryPoint\": \"473abc123def\",\n \"newParentOrganizationId\": 123,\n \"notificationRequest\": {\n \"notificationUrl\": \"https://webhook-test.yoursie.com\",\n \"webHeaderParameters\": [\n {\n \"key\": \"testheader\",\n \"value\": \"1234567890\"\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java MigrateWithNotification import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/Paypoint/migrate") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"entryPoint\": \"473abc123def\",\n \"newParentOrganizationId\": 123,\n \"notificationRequest\": {\n \"notificationUrl\": \"https://webhook-test.yoursie.com\",\n \"webHeaderParameters\": [\n {\n \"key\": \"testheader\",\n \"value\": \"1234567890\"\n }\n ]\n }\n}") .asString(); ``` ```php MigrateWithNotification request('POST', 'https://api-sandbox.payabli.com/api/Paypoint/migrate', [ 'body' => '{ "entryPoint": "473abc123def", "newParentOrganizationId": 123, "notificationRequest": { "notificationUrl": "https://webhook-test.yoursie.com", "webHeaderParameters": [ { "key": "testheader", "value": "1234567890" } ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift MigrateWithNotification import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "entryPoint": "473abc123def", "newParentOrganizationId": 123, "notificationRequest": [ "notificationUrl": "https://webhook-test.yoursie.com", "webHeaderParameters": [ [ "key": "testheader", "value": "1234567890" ] ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Paypoint/migrate")! 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() ```