{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["accordion","code-walkthrough","step","admonition","tabs","tab","json-example"]},"type":"markdown"},"seo":{"title":"Quickstart","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io"},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"quickstart","__idx":0},"children":["Quickstart"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"style":{"display":"inline-block","fontSize":"20px","color":"#3A3D40","borderRadius":"0","fontWeight":"500","verticalAlign":"middle","lineHeight":"1.5","margin":"0 auto 20px auto!important"}},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Build a working Payout Drop-in withdrawal in your sandbox with this walkthrough."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"requirements","__idx":1},"children":["Requirements"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you start, make sure you have:"]},{"$$mdtype":"Tag","name":"ul","attributes":{"className":"code-walkthrough-list"},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Node.js 22.x or higher (for a Node.js backend) or the .NET SDK (for a .NET backend)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["API credentials from the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.pxp.io","target":"_blank"},"children":["Unity Portal"]}," (Client ID and an inbound API token)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payout Drop-in enabled for your site in the Unity Portal, with payout methods configured"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["At least one eligible stored payout instrument for the shopper you test with (saved card, linked PayPal account, or Apple Pay or Google Pay device token), unless you are validating empty-state behaviour"]}]},{"$$mdtype":"Tag","name":"Accordion","attributes":{"title":"Where to find your credentials","defaultOpen":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find credentials like this:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the Unity Portal, go to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant setup > Merchant groups"]}," and select a merchant group."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Inbound calls"]}," tab and copy the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Client ID"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ New token"]},", then copy both the token ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ID"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Value"]},"."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Session API returns which funding types are allowed. Drop-in shows a method only when the session permits it and the shopper has an instrument that passes SDK filtering."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-the-sdk","__idx":2},"children":["Install the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the latest Web SDK from the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://www.npmjs.com/package/@pxpio/web-components-sdk","target":"_blank"},"children":["npm public registry"]},". You'll need Node.js 22.x or higher for the frontend package install."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"npm i @pxpio/web-components-sdk\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Import ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutDropIn"]}," from the package root (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@pxpio/web-components-sdk"]},"). Prefer a single named import over paths under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/src/"]},"."]},{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{"Backend":{"items":[{"label":"Node.js","value":"nodejs"},{"label":".NET","value":"dotnet"}],"default":"nodejs"}},"filesets":[{"files":[{"path":"guides/payout/drop-in/web/_filesets/installation/create-session.js","content":["import crypto from 'node:crypto';","",{"start":2,"condition":{"steps":["credentials-setup"]},"children":["// Store your API credentials from the Unity Portal as environment variables.","const TOKEN_ID = process.env.PXP_TOKEN_ID;","const TOKEN_VALUE = process.env.PXP_TOKEN_VALUE;","const CLIENT_ID = process.env.PXP_CLIENT_ID;","","if (!TOKEN_ID || !TOKEN_VALUE || !CLIENT_ID) {","  throw new Error(","    'Set PXP_TOKEN_ID, PXP_TOKEN_VALUE, and PXP_CLIENT_ID before starting the server.',","  );","}"]},"","const REQUEST_PATH = 'api/v1/sessions';","",{"start":17,"condition":{"steps":["create-signature-function"]},"children":["/**"," * Creates an HMAC signature for authenticating API requests"," */","function createHmacSignature(","  timestamp,","  requestId,","  requestPath,","  requestBody,","  tokenValue,",") {","  const stringToHash = `${timestamp}${requestId}${requestPath}${requestBody}`;","  const hmac = crypto.createHmac('sha256', tokenValue);","","  hmac.update(stringToHash);","","  return hmac.digest('hex').toUpperCase();","}"]},"","/**"," * Creates a Payout Drop-in session from your merchant backend."," */","export async function createSession({","  merchantId,","  siteId,","  amount,","  currency,","  customerProfileId,","}) {","  const timestamp = Math.floor(Date.now() / 1000);","  const requestId = crypto.randomUUID();","  const merchantTransactionId = crypto.randomUUID();","",{"start":51,"condition":{"steps":["build-request-body"]},"children":["  // Build the request body. Use intent Payout and serviceType PayoutDropIn.","  const requestBody = {","    merchant: merchantId,","    site: siteId,","    sessionTimeout: 120,","    merchantTransactionId,","    amounts: {","      currencyCode: currency,","      transactionValue: amount,","    },","    transactionMethod: {","      intent: {","        card: 'Payout',","        paypal: 'Payout',","      },","    },","    allowTransaction: true,","    serviceType: 'PayoutDropIn',","  };","","  if (customerProfileId) {","    requestBody.customerProfileId = customerProfileId;","  }","","  const requestBodyString = JSON.stringify(requestBody);"]},"","  const signature = createHmacSignature(","    timestamp,","    requestId,","    REQUEST_PATH,","    requestBodyString,","    TOKEN_VALUE,","  );","",{"start":87,"condition":{"steps":["send-session-request"]},"children":["  const response = await fetch(`https://api-services.pxp.io/${REQUEST_PATH}`, {","    method: 'POST',","    headers: {","      Authorization: `PXP-UST1 ${TOKEN_ID}:${timestamp}:${signature}`,","      'X-Request-Id': requestId,","      'X-Client-Id': CLIENT_ID,","      'Content-Type': 'application/json',","    },","    body: requestBodyString,","  });"]},"",{"start":100,"condition":{"steps":["handle-response"]},"children":["  if (!response.ok) {","    const errorText = await response.text();","    throw new Error(","      `Session creation failed (${response.status}): ${errorText || response.statusText}`,","    );","  }","","  const sessionData = await response.json();","","  return {","    session: sessionData,","    transactionData: {","      merchantTransactionId,","      amount,","      currency,","    },","  };"]},"}",""],"metadata":{"steps":["credentials-setup","create-signature-function","build-request-body","send-session-request","handle-response"]},"basename":"create-session.js","language":"javascript"}],"downloadAssociatedFiles":[{"path":"guides/payout/drop-in/web/_filesets/installation/create-session.js","content":["import crypto from 'node:crypto';","",{"start":2,"condition":{"steps":["credentials-setup"]},"children":["// Store your API credentials from the Unity Portal as environment variables.","const TOKEN_ID = process.env.PXP_TOKEN_ID;","const TOKEN_VALUE = process.env.PXP_TOKEN_VALUE;","const CLIENT_ID = process.env.PXP_CLIENT_ID;","","if (!TOKEN_ID || !TOKEN_VALUE || !CLIENT_ID) {","  throw new Error(","    'Set PXP_TOKEN_ID, PXP_TOKEN_VALUE, and PXP_CLIENT_ID before starting the server.',","  );","}"]},"","const REQUEST_PATH = 'api/v1/sessions';","",{"start":17,"condition":{"steps":["create-signature-function"]},"children":["/**"," * Creates an HMAC signature for authenticating API requests"," */","function createHmacSignature(","  timestamp,","  requestId,","  requestPath,","  requestBody,","  tokenValue,",") {","  const stringToHash = `${timestamp}${requestId}${requestPath}${requestBody}`;","  const hmac = crypto.createHmac('sha256', tokenValue);","","  hmac.update(stringToHash);","","  return hmac.digest('hex').toUpperCase();","}"]},"","/**"," * Creates a Payout Drop-in session from your merchant backend."," */","export async function createSession({","  merchantId,","  siteId,","  amount,","  currency,","  customerProfileId,","}) {","  const timestamp = Math.floor(Date.now() / 1000);","  const requestId = crypto.randomUUID();","  const merchantTransactionId = crypto.randomUUID();","",{"start":51,"condition":{"steps":["build-request-body"]},"children":["  // Build the request body. Use intent Payout and serviceType PayoutDropIn.","  const requestBody = {","    merchant: merchantId,","    site: siteId,","    sessionTimeout: 120,","    merchantTransactionId,","    amounts: {","      currencyCode: currency,","      transactionValue: amount,","    },","    transactionMethod: {","      intent: {","        card: 'Payout',","        paypal: 'Payout',","      },","    },","    allowTransaction: true,","    serviceType: 'PayoutDropIn',","  };","","  if (customerProfileId) {","    requestBody.customerProfileId = customerProfileId;","  }","","  const requestBodyString = JSON.stringify(requestBody);"]},"","  const signature = createHmacSignature(","    timestamp,","    requestId,","    REQUEST_PATH,","    requestBodyString,","    TOKEN_VALUE,","  );","",{"start":87,"condition":{"steps":["send-session-request"]},"children":["  const response = await fetch(`https://api-services.pxp.io/${REQUEST_PATH}`, {","    method: 'POST',","    headers: {","      Authorization: `PXP-UST1 ${TOKEN_ID}:${timestamp}:${signature}`,","      'X-Request-Id': requestId,","      'X-Client-Id': CLIENT_ID,","      'Content-Type': 'application/json',","    },","    body: requestBodyString,","  });"]},"",{"start":100,"condition":{"steps":["handle-response"]},"children":["  if (!response.ok) {","    const errorText = await response.text();","    throw new Error(","      `Session creation failed (${response.status}): ${errorText || response.statusText}`,","    );","  }","","  const sessionData = await response.json();","","  return {","    session: sessionData,","    transactionData: {","      merchantTransactionId,","      amount,","      currency,","    },","  };"]},"}",""],"metadata":{"steps":["credentials-setup","create-signature-function","build-request-body","send-session-request","handle-response"]},"basename":"create-session.js","language":"javascript"}],"when":{"Backend":"nodejs"}},{"files":[{"path":"guides/payout/drop-in/web/_filesets/installation/create-session.cs","content":["using System.Security.Cryptography;","using System.Text;","using System.Text.Json;","using System.Text.Json.Serialization;","",{"start":5,"condition":{"steps":["credentials-setup"]},"children":["// Store your API credentials from the Unity Portal as environment variables.","private static readonly string TokenId = RequireEnv(\"PXP_TOKEN_ID\");","private static readonly string TokenValue = RequireEnv(\"PXP_TOKEN_VALUE\");","private static readonly string ClientId = RequireEnv(\"PXP_CLIENT_ID\");","private const string SessionUrl = \"https://api-services.pxp.io/api/v1/sessions\";","","private static string RequireEnv(string name) =>","    Environment.GetEnvironmentVariable(name)","    ?? throw new InvalidOperationException(","        $\"Set {name} before starting the server.\");"]},"","private static readonly HttpClient HttpClient = new();","private static readonly JsonSerializerOptions IndentedJsonOptions = new() { WriteIndented = true };","",{"start":21,"condition":{"steps":["create-signature-function"]},"children":["/// <summary>","/// Creates an HMAC signature for authenticating API requests","/// </summary>","private static string CreateHmacSignature(","    string timestamp,","    string requestId,","    string requestPath,","    string requestBody,","    string tokenValue)","{","    var stringToHash = $\"{timestamp}{requestId}{requestPath}{requestBody}\";","    var keyBytes = Encoding.UTF8.GetBytes(tokenValue);","    var payloadBytes = Encoding.UTF8.GetBytes(stringToHash);","","    using var hmac = new HMACSHA256(keyBytes);","    var hashBytes = hmac.ComputeHash(payloadBytes);","","    return Convert.ToHexString(hashBytes);","}"]},"","/// <summary>","/// Creates a new Payout Drop-in session","/// </summary>","public static async Task<string> CreateSessionAsync(","    string merchantId,","    string siteId,","    decimal amount,","    string currency,","    string? customerProfileId = null)","{","    var merchantTransactionId = Guid.NewGuid().ToString();","    var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();","    var requestId = Guid.NewGuid().ToString();","",{"start":57,"condition":{"steps":["build-request-body"]},"children":["    // Build the request body. Use intent Payout and serviceType PayoutDropIn.","    var requestBody = new SessionRequestBody","    {","        Merchant = merchantId,","        Site = siteId,","        SessionTimeout = 120,","        MerchantTransactionId = merchantTransactionId,","        TransactionMethod = new SessionTransactionMethod","        {","            Intent = new SessionIntent","            {","                Card = \"Payout\",","                Paypal = \"Payout\"","            }","        },","        Amounts = new SessionAmounts","        {","            CurrencyCode = currency,","            TransactionValue = amount","        },","        AllowTransaction = true,","        ServiceType = \"PayoutDropIn\",","        CustomerProfileId = customerProfileId","    };","","    var requestBodyString = JsonSerializer.Serialize(requestBody);","    var normalizedRequestBody = string.IsNullOrWhiteSpace(requestBodyString) ? string.Empty : requestBodyString;","    var requestPath = new Uri(SessionUrl).AbsolutePath.Trim('/');"]},"","    var signature = CreateHmacSignature(","        timestamp,","        requestId,","        requestPath,","        normalizedRequestBody,","        TokenValue);","",{"start":95,"condition":{"steps":["send-session-request"]},"children":["    const string authenticationScheme = \"PXP-UST1\";","    var authorizationHeader = $\"{authenticationScheme} {TokenId}:{timestamp}:{signature}\";","","    var request = new HttpRequestMessage(HttpMethod.Post, SessionUrl)","    {","        Content = new StringContent(requestBodyString, Encoding.UTF8, \"application/json\")","    };","","    request.Headers.TryAddWithoutValidation(\"Authorization\", authorizationHeader);","    request.Headers.Add(\"X-Request-Id\", requestId);","    request.Headers.Add(\"X-Client-Id\", ClientId);","","    using (request)","    {","        using var response = await HttpClient.SendAsync(request);","        var responseContent = await response.Content.ReadAsStringAsync();"]},"",{"start":114,"condition":{"steps":["handle-response"]},"children":["        if (!response.IsSuccessStatusCode)","        {","            throw new InvalidOperationException(","                $\"Session creation failed: {(int)response.StatusCode} {response.ReasonPhrase}{Environment.NewLine}{responseContent}\");","        }","","        // Pass the Sessions API JSON through unchanged. Do not reshape allowedFundingTypes","        // (for example inventing \"cards\": []) — Card is gated on that field being present.","        using var sessionDocument = JsonDocument.Parse(responseContent);","","        // Match the Node.js helper shape expected by the frontend sample:","        // { session, transactionData: { merchantTransactionId, amount, currency } }","        var frontendPayload = new CreateSessionFrontendPayload","        {","            Session = sessionDocument.RootElement.Clone(),","            TransactionData = new FrontendTransactionData","            {","                MerchantTransactionId = merchantTransactionId,","                Amount = amount,","                Currency = currency","            }","        };","","        return JsonSerializer.Serialize(frontendPayload, IndentedJsonOptions);"]},"    }","}","","public sealed class SessionRequestBody","{","    [JsonPropertyName(\"merchant\")]","    public string Merchant { get; set; } = string.Empty;","","    [JsonPropertyName(\"site\")]","    public string Site { get; set; } = string.Empty;","","    [JsonPropertyName(\"sessionTimeout\")]","    public int SessionTimeout { get; set; }","","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"transactionMethod\")]","    public SessionTransactionMethod TransactionMethod { get; set; } = new();","","    [JsonPropertyName(\"amounts\")]","    public SessionAmounts Amounts { get; set; } = new();","","    [JsonPropertyName(\"allowTransaction\")]","    public bool AllowTransaction { get; set; }","","    [JsonPropertyName(\"serviceType\")]","    public string ServiceType { get; set; } = string.Empty;","","    [JsonPropertyName(\"customerProfileId\")]","    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]","    public string? CustomerProfileId { get; set; }","}","","public sealed class SessionTransactionMethod","{","    [JsonPropertyName(\"intent\")]","    public SessionIntent Intent { get; set; } = new();","}","","public sealed class SessionIntent","{","    [JsonPropertyName(\"card\")]","    public string Card { get; set; } = string.Empty;","","    [JsonPropertyName(\"paypal\")]","    public string Paypal { get; set; } = string.Empty;","}","","public sealed class SessionAmounts","{","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","","    [JsonPropertyName(\"transactionValue\")]","    public decimal TransactionValue { get; set; }","}","","public sealed class CreateSessionFrontendPayload","{","    [JsonPropertyName(\"session\")]","    public JsonElement Session { get; set; }","","    [JsonPropertyName(\"transactionData\")]","    public FrontendTransactionData TransactionData { get; set; } = new();","}","","public sealed class FrontendTransactionData","{","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"amount\")]","    public decimal Amount { get; set; }","","    [JsonPropertyName(\"currency\")]","    public string Currency { get; set; } = string.Empty;","}",""],"metadata":{"steps":["credentials-setup","create-signature-function","build-request-body","send-session-request","handle-response"]},"basename":"create-session.cs","language":"csharp"}],"downloadAssociatedFiles":[{"path":"guides/payout/drop-in/web/_filesets/installation/create-session.cs","content":["using System.Security.Cryptography;","using System.Text;","using System.Text.Json;","using System.Text.Json.Serialization;","",{"start":5,"condition":{"steps":["credentials-setup"]},"children":["// Store your API credentials from the Unity Portal as environment variables.","private static readonly string TokenId = RequireEnv(\"PXP_TOKEN_ID\");","private static readonly string TokenValue = RequireEnv(\"PXP_TOKEN_VALUE\");","private static readonly string ClientId = RequireEnv(\"PXP_CLIENT_ID\");","private const string SessionUrl = \"https://api-services.pxp.io/api/v1/sessions\";","","private static string RequireEnv(string name) =>","    Environment.GetEnvironmentVariable(name)","    ?? throw new InvalidOperationException(","        $\"Set {name} before starting the server.\");"]},"","private static readonly HttpClient HttpClient = new();","private static readonly JsonSerializerOptions IndentedJsonOptions = new() { WriteIndented = true };","",{"start":21,"condition":{"steps":["create-signature-function"]},"children":["/// <summary>","/// Creates an HMAC signature for authenticating API requests","/// </summary>","private static string CreateHmacSignature(","    string timestamp,","    string requestId,","    string requestPath,","    string requestBody,","    string tokenValue)","{","    var stringToHash = $\"{timestamp}{requestId}{requestPath}{requestBody}\";","    var keyBytes = Encoding.UTF8.GetBytes(tokenValue);","    var payloadBytes = Encoding.UTF8.GetBytes(stringToHash);","","    using var hmac = new HMACSHA256(keyBytes);","    var hashBytes = hmac.ComputeHash(payloadBytes);","","    return Convert.ToHexString(hashBytes);","}"]},"","/// <summary>","/// Creates a new Payout Drop-in session","/// </summary>","public static async Task<string> CreateSessionAsync(","    string merchantId,","    string siteId,","    decimal amount,","    string currency,","    string? customerProfileId = null)","{","    var merchantTransactionId = Guid.NewGuid().ToString();","    var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();","    var requestId = Guid.NewGuid().ToString();","",{"start":57,"condition":{"steps":["build-request-body"]},"children":["    // Build the request body. Use intent Payout and serviceType PayoutDropIn.","    var requestBody = new SessionRequestBody","    {","        Merchant = merchantId,","        Site = siteId,","        SessionTimeout = 120,","        MerchantTransactionId = merchantTransactionId,","        TransactionMethod = new SessionTransactionMethod","        {","            Intent = new SessionIntent","            {","                Card = \"Payout\",","                Paypal = \"Payout\"","            }","        },","        Amounts = new SessionAmounts","        {","            CurrencyCode = currency,","            TransactionValue = amount","        },","        AllowTransaction = true,","        ServiceType = \"PayoutDropIn\",","        CustomerProfileId = customerProfileId","    };","","    var requestBodyString = JsonSerializer.Serialize(requestBody);","    var normalizedRequestBody = string.IsNullOrWhiteSpace(requestBodyString) ? string.Empty : requestBodyString;","    var requestPath = new Uri(SessionUrl).AbsolutePath.Trim('/');"]},"","    var signature = CreateHmacSignature(","        timestamp,","        requestId,","        requestPath,","        normalizedRequestBody,","        TokenValue);","",{"start":95,"condition":{"steps":["send-session-request"]},"children":["    const string authenticationScheme = \"PXP-UST1\";","    var authorizationHeader = $\"{authenticationScheme} {TokenId}:{timestamp}:{signature}\";","","    var request = new HttpRequestMessage(HttpMethod.Post, SessionUrl)","    {","        Content = new StringContent(requestBodyString, Encoding.UTF8, \"application/json\")","    };","","    request.Headers.TryAddWithoutValidation(\"Authorization\", authorizationHeader);","    request.Headers.Add(\"X-Request-Id\", requestId);","    request.Headers.Add(\"X-Client-Id\", ClientId);","","    using (request)","    {","        using var response = await HttpClient.SendAsync(request);","        var responseContent = await response.Content.ReadAsStringAsync();"]},"",{"start":114,"condition":{"steps":["handle-response"]},"children":["        if (!response.IsSuccessStatusCode)","        {","            throw new InvalidOperationException(","                $\"Session creation failed: {(int)response.StatusCode} {response.ReasonPhrase}{Environment.NewLine}{responseContent}\");","        }","","        // Pass the Sessions API JSON through unchanged. Do not reshape allowedFundingTypes","        // (for example inventing \"cards\": []) — Card is gated on that field being present.","        using var sessionDocument = JsonDocument.Parse(responseContent);","","        // Match the Node.js helper shape expected by the frontend sample:","        // { session, transactionData: { merchantTransactionId, amount, currency } }","        var frontendPayload = new CreateSessionFrontendPayload","        {","            Session = sessionDocument.RootElement.Clone(),","            TransactionData = new FrontendTransactionData","            {","                MerchantTransactionId = merchantTransactionId,","                Amount = amount,","                Currency = currency","            }","        };","","        return JsonSerializer.Serialize(frontendPayload, IndentedJsonOptions);"]},"    }","}","","public sealed class SessionRequestBody","{","    [JsonPropertyName(\"merchant\")]","    public string Merchant { get; set; } = string.Empty;","","    [JsonPropertyName(\"site\")]","    public string Site { get; set; } = string.Empty;","","    [JsonPropertyName(\"sessionTimeout\")]","    public int SessionTimeout { get; set; }","","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"transactionMethod\")]","    public SessionTransactionMethod TransactionMethod { get; set; } = new();","","    [JsonPropertyName(\"amounts\")]","    public SessionAmounts Amounts { get; set; } = new();","","    [JsonPropertyName(\"allowTransaction\")]","    public bool AllowTransaction { get; set; }","","    [JsonPropertyName(\"serviceType\")]","    public string ServiceType { get; set; } = string.Empty;","","    [JsonPropertyName(\"customerProfileId\")]","    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]","    public string? CustomerProfileId { get; set; }","}","","public sealed class SessionTransactionMethod","{","    [JsonPropertyName(\"intent\")]","    public SessionIntent Intent { get; set; } = new();","}","","public sealed class SessionIntent","{","    [JsonPropertyName(\"card\")]","    public string Card { get; set; } = string.Empty;","","    [JsonPropertyName(\"paypal\")]","    public string Paypal { get; set; } = string.Empty;","}","","public sealed class SessionAmounts","{","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","","    [JsonPropertyName(\"transactionValue\")]","    public decimal TransactionValue { get; set; }","}","","public sealed class CreateSessionFrontendPayload","{","    [JsonPropertyName(\"session\")]","    public JsonElement Session { get; set; }","","    [JsonPropertyName(\"transactionData\")]","    public FrontendTransactionData TransactionData { get; set; } = new();","}","","public sealed class FrontendTransactionData","{","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"amount\")]","    public decimal Amount { get; set; }","","    [JsonPropertyName(\"currency\")]","    public string Currency { get; set; } = string.Empty;","}",""],"metadata":{"steps":["credentials-setup","create-signature-function","build-request-body","send-session-request","handle-response"]},"basename":"create-session.cs","language":"csharp"}],"when":{"Backend":"dotnet"}}],"steps":[{"id":"credentials-setup","heading":"Store your credentials securely"},{"id":"create-signature-function","heading":"Create the HMAC signature function"},{"id":"build-request-body","heading":"Build the session request body"},{"id":"send-session-request","heading":"Send the session creation request"},{"id":"handle-response","heading":"Return the session data to your frontend"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-session-on-your-backend","__idx":3},"children":["Create a session on your backend"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Drop-in needs a session from the PXP API. Create it on your backend so inbound credentials stay secure."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Integration uses two authorisation steps, each with its own scheme:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-the-merchant-backend-creates-a-session","__idx":4},"children":["Step 1: The merchant backend creates a session"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Your server calls the Sessions API to get credentials the Web SDK will use."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["At this point there's no session yet, only Unity Portal merchant token credentials (client ID and inbound API token)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The correct scheme here is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PXP-UST1"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The quickstart Node.js and .NET samples cover only this step."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-the-sdk-runs-in-the-browser","__idx":5},"children":["Step 2: The SDK runs in the browser"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutDropIn.initialize({ session })"]},", the SDK calls Unity APIs such as payout Drop-in configuration, Token Vault, PayPal association, and payout submission."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Those calls use the session (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," and the signing key from the session response)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The scheme there is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PXP-WCA1"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK adds this automatically. Don't implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PXP-WCA1"]}," in your backend session-creation sample."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"credentials-setup","heading":"Store your credentials securely"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up your API credentials as environment variables. Never hardcode them in your application."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"create-signature-function","heading":"Create the HMAC signature function"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Concatenate the timestamp, request ID, request path (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api/v1/sessions"]},"), and minified request body with no separators, then create an HMAC SHA256 hash using your token value. Encode the digest as uppercase hex. This signature is for the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PXP-UST1"]}," session request only."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"build-request-body","heading":"Build the session request body"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a request with merchant and site IDs, withdrawal amount, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceType: \"PayoutDropIn\""]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionMethod.intent"]}," values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Payout"]}," for each method you enable. Minify the body before signing."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"send-session-request","heading":"Send the session creation request"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["POST to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api-services.pxp.io/api/v1/sessions"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: PXP-UST1 {tokenId}:{timestamp}:{signature}"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Request-Id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Client-Id"]},", and the minified JSON body."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"handle-response","heading":"Return the session data to your frontend"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return the Sessions API response as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]},", plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData"]}," with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]}," you used when creating the session. Only return this to the authenticated shopper who owns the withdrawal."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutDropIn.initialize()"]}," doesn't take payment intents on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData"]},". Intents are set on the session at creation time. The frontend must still pass matching amount, currency, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},". Card visibility requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedFundingTypes.cards"]}," on the session response; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardSchemes"]}," alone isn't enough."]}]}]},{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":2,"filters":{},"filesets":[{"files":[{"path":"guides/payout/drop-in/web/_filesets/installation/PayoutPage.tsx","content":[{"start":0,"condition":{"steps":["import-dependencies"]},"children":["import {","  PayoutDropIn,","  type BaseSdkException,","  type PayoutDropInSubmitResult,","} from '@pxpio/web-components-sdk';","import { useEffect } from 'react';"]},"",{"start":9,"condition":{"steps":["setup-component"]},"children":["export default function PayoutPage({","  shopperId,","  merchantGroupId,","}: {","  shopperId: string;","  merchantGroupId: string;","}) {","  useEffect(() => {","    let disposed = false;","    let instance: PayoutDropIn | undefined;","","    async function initialisePayoutDropIn() {",{"start":22,"condition":{"steps":["fetch-session"]},"children":["      // 1. Get the session data from your backend","      const { session, transactionData } = await fetch('/api/create-session', {","        method: 'POST',","        headers: { 'Content-Type': 'application/json' },","        body: JSON.stringify({","          amount: 25.0,","          currency: 'USD',","        }),","      }).then((response) => response.json());"]},"",{"start":34,"condition":{"steps":["initialize-dropin"]},"children":["      // 2. Initialise Payout Drop-in","      const payoutDropIn = PayoutDropIn.initialize({","        environment: 'test',","        session,","        ownerId: merchantGroupId,",{"start":40,"condition":{"steps":["configure-transaction"]},"children":["        transactionData: {","          currency: transactionData.currency,","          amount: transactionData.amount,","          entryType: 'Ecom',","          merchantTransactionId: transactionData.merchantTransactionId,","          merchantTransactionDate: () => new Date().toISOString(),","        },"]},{"start":49,"condition":{"steps":["setup-shopper"]},"children":["        onGetShopper: async () => ({ id: shopperId }),"]},{"start":52,"condition":{"steps":["before-submit-callback"]},"children":["        onBeforeSubmit: async (payoutMethod) => {","          console.log('Payout method selected:', payoutMethod);","          return true;","        },"]},{"start":58,"condition":{"steps":["submit-callback"]},"children":["        onSubmit: (payoutMethod) => {","          console.log('Payout processing started:', payoutMethod);","        },"]},{"start":63,"condition":{"steps":["success-callback"]},"children":["        onSuccess: async (result: PayoutDropInSubmitResult) => {","          // CRITICAL: Do NOT mark the withdrawal complete here.","          // Frontend callbacks can be manipulated. Always verify on your backend.","          console.log('Payout submitted:', result.systemTransactionId, result.payoutMethod);","","          const verified = await fetch('/api/verify-payout', {","            method: 'POST',","            headers: { 'Content-Type': 'application/json' },","            body: JSON.stringify({","              systemTransactionId: result.systemTransactionId,","              merchantTransactionId: result.merchantTransactionId,","              payoutMethod: result.payoutMethod,","              payouts: result.payouts,","            }),","          }).then((response) => response.json());","","          if (verified.success) {","            window.location.href = `/withdrawal-confirmation?id=${verified.withdrawalId}`;","          } else {","            alert(","              'We received your request but could not confirm it yet. Please contact support if needed.',","            );","          }","        },"]},{"start":89,"condition":{"steps":["error-callback"]},"children":["        onError: (error: BaseSdkException) => {","          console.error('Payout failed:', error.ErrorCode, error.message);","          alert(error.message || 'Withdrawal failed. Please try again.');","        },"]},"      });"]},"",{"start":98,"condition":{"steps":["mount-dropin"]},"children":["      // 3. Mount Drop-in to your page","      await payoutDropIn.create('payout-drop-in-container');"]},"","      if (disposed) {","        payoutDropIn.destroy();","        return;","      }","","      instance = payoutDropIn;","    }","","    void initialisePayoutDropIn().catch((error) => {","      console.error('Could not mount Payout Drop-in', error);","    });","","    return () => {","      disposed = true;","      instance?.destroy();","    };","  }, [shopperId, merchantGroupId]);","",{"start":121,"condition":{"steps":["render-container"]},"children":["  return (","    <div>","      <h1>Withdraw funds</h1>","      <div id=\"payout-drop-in-container\"></div>","    </div>","  );"]},"}"]},""],"metadata":{"steps":["import-dependencies","setup-component","fetch-session","initialize-dropin","configure-transaction","setup-shopper","before-submit-callback","submit-callback","success-callback","error-callback","mount-dropin","render-container"]},"basename":"PayoutPage.tsx","language":"tsx"}],"downloadAssociatedFiles":[{"path":"guides/payout/drop-in/web/_filesets/installation/PayoutPage.tsx","content":[{"start":0,"condition":{"steps":["import-dependencies"]},"children":["import {","  PayoutDropIn,","  type BaseSdkException,","  type PayoutDropInSubmitResult,","} from '@pxpio/web-components-sdk';","import { useEffect } from 'react';"]},"",{"start":9,"condition":{"steps":["setup-component"]},"children":["export default function PayoutPage({","  shopperId,","  merchantGroupId,","}: {","  shopperId: string;","  merchantGroupId: string;","}) {","  useEffect(() => {","    let disposed = false;","    let instance: PayoutDropIn | undefined;","","    async function initialisePayoutDropIn() {",{"start":22,"condition":{"steps":["fetch-session"]},"children":["      // 1. Get the session data from your backend","      const { session, transactionData } = await fetch('/api/create-session', {","        method: 'POST',","        headers: { 'Content-Type': 'application/json' },","        body: JSON.stringify({","          amount: 25.0,","          currency: 'USD',","        }),","      }).then((response) => response.json());"]},"",{"start":34,"condition":{"steps":["initialize-dropin"]},"children":["      // 2. Initialise Payout Drop-in","      const payoutDropIn = PayoutDropIn.initialize({","        environment: 'test',","        session,","        ownerId: merchantGroupId,",{"start":40,"condition":{"steps":["configure-transaction"]},"children":["        transactionData: {","          currency: transactionData.currency,","          amount: transactionData.amount,","          entryType: 'Ecom',","          merchantTransactionId: transactionData.merchantTransactionId,","          merchantTransactionDate: () => new Date().toISOString(),","        },"]},{"start":49,"condition":{"steps":["setup-shopper"]},"children":["        onGetShopper: async () => ({ id: shopperId }),"]},{"start":52,"condition":{"steps":["before-submit-callback"]},"children":["        onBeforeSubmit: async (payoutMethod) => {","          console.log('Payout method selected:', payoutMethod);","          return true;","        },"]},{"start":58,"condition":{"steps":["submit-callback"]},"children":["        onSubmit: (payoutMethod) => {","          console.log('Payout processing started:', payoutMethod);","        },"]},{"start":63,"condition":{"steps":["success-callback"]},"children":["        onSuccess: async (result: PayoutDropInSubmitResult) => {","          // CRITICAL: Do NOT mark the withdrawal complete here.","          // Frontend callbacks can be manipulated. Always verify on your backend.","          console.log('Payout submitted:', result.systemTransactionId, result.payoutMethod);","","          const verified = await fetch('/api/verify-payout', {","            method: 'POST',","            headers: { 'Content-Type': 'application/json' },","            body: JSON.stringify({","              systemTransactionId: result.systemTransactionId,","              merchantTransactionId: result.merchantTransactionId,","              payoutMethod: result.payoutMethod,","              payouts: result.payouts,","            }),","          }).then((response) => response.json());","","          if (verified.success) {","            window.location.href = `/withdrawal-confirmation?id=${verified.withdrawalId}`;","          } else {","            alert(","              'We received your request but could not confirm it yet. Please contact support if needed.',","            );","          }","        },"]},{"start":89,"condition":{"steps":["error-callback"]},"children":["        onError: (error: BaseSdkException) => {","          console.error('Payout failed:', error.ErrorCode, error.message);","          alert(error.message || 'Withdrawal failed. Please try again.');","        },"]},"      });"]},"",{"start":98,"condition":{"steps":["mount-dropin"]},"children":["      // 3. Mount Drop-in to your page","      await payoutDropIn.create('payout-drop-in-container');"]},"","      if (disposed) {","        payoutDropIn.destroy();","        return;","      }","","      instance = payoutDropIn;","    }","","    void initialisePayoutDropIn().catch((error) => {","      console.error('Could not mount Payout Drop-in', error);","    });","","    return () => {","      disposed = true;","      instance?.destroy();","    };","  }, [shopperId, merchantGroupId]);","",{"start":121,"condition":{"steps":["render-container"]},"children":["  return (","    <div>","      <h1>Withdraw funds</h1>","      <div id=\"payout-drop-in-container\"></div>","    </div>","  );"]},"}"]},""],"metadata":{"steps":["import-dependencies","setup-component","fetch-session","initialize-dropin","configure-transaction","setup-shopper","before-submit-callback","submit-callback","success-callback","error-callback","mount-dropin","render-container"]},"basename":"PayoutPage.tsx","language":"tsx"},{"path":"guides/payout/drop-in/web/_filesets/installation/package.json","content":[{"start":0,"condition":{"steps":["install-sdk"]},"children":["{","  \"name\": \"payout-integration\",","  \"version\": \"1.0.0\",","  \"description\": \"PXP Payout Drop-in integration example\",","  \"type\": \"module\",","  \"scripts\": {","    \"dev\": \"vite\",","    \"build\": \"vite build\"","  },","  \"dependencies\": {","    \"@pxpio/web-components-sdk\": \"latest\",","    \"react\": \"^18.2.0\",","    \"react-dom\": \"^18.2.0\"","  },","  \"devDependencies\": {","    \"@vitejs/plugin-react\": \"^4.0.0\",","    \"vite\": \"^4.0.0\"","  }","}"]},""],"metadata":{"steps":["install-sdk"]},"basename":"package.json","language":"text"}]}],"steps":[{"id":"import-dependencies","heading":"Import the required dependencies"},{"id":"setup-component","heading":"Set up your React component"},{"id":"fetch-session","heading":"Fetch the session data from your backend"},{"id":"initialize-dropin","heading":"Initialise Payout Drop-in"},{"id":"configure-transaction","heading":"Configure the transaction data"},{"id":"setup-shopper","heading":"Provide a shopper identifier"},{"id":"before-submit-callback","heading":"Optionally validate before card-on-file submit"},{"id":"submit-callback","heading":"Show loading when card-on-file submit starts"},{"id":"success-callback","heading":"Handle successful submissions"},{"id":"error-callback","heading":"Handle payout errors"},{"id":"mount-dropin","heading":"Mount Drop-in to the page"},{"id":"render-container","heading":"Add a container element to your page"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initialise-drop-in-on-your-frontend","__idx":6},"children":["Initialise Drop-in on your frontend"]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"import-dependencies","heading":"Import the required dependencies"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Import ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutDropIn"]}," and the types you need from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@pxpio/web-components-sdk"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"setup-component","heading":"Set up your React component"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a React component that hosts Payout Drop-in and destroys the instance on unmount."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"fetch-session","heading":"Fetch the session data from your backend"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call your authenticated backend endpoint to create the payout session and return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session"]}," plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"initialize-dropin","heading":"Initialise Payout Drop-in"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure Drop-in with environment, session, merchant group ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ownerId"]},", transaction data, and callbacks. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ownerType"]}," is set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantGroup"]}," automatically."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"configure-transaction","heading":"Configure the transaction data"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass currency, amount, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entryType"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionDate"]},". Don't pass payment intents here: the SDK sets payout intents internally."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"setup-shopper","heading":"Provide a shopper identifier"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," with the authenticated shopper ID so Drop-in can load stored cards, wallet device tokens, and PayPal association."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"before-submit-callback","heading":"Optionally validate before card-on-file submit"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," run for Card, Apple Pay, and Google Pay only. PayPal uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," alone."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"submit-callback","heading":"Show loading when card-on-file submit starts"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," to show progress UI for Card, Apple Pay, and Google Pay."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"success-callback","heading":"Handle successful submissions"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]},", then verify the payout on your backend before updating withdrawal status. Frontend callbacks can be manipulated."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"error-callback","heading":"Handle payout errors"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and map ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ErrorCode"]}," to shopper-safe messages. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/payout/drop-in/web/error-handling"},"children":["Error handling"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"mount-dropin","heading":"Mount Drop-in to the page"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create('payout-drop-in-container')"]}," after the container exists in the DOM."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"render-container","heading":"Add a container element to your page"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return JSX that includes a container div where Payout Drop-in mounts."]}]}]},{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":3,"filters":{"Backend":{"items":[{"label":"Node.js","value":"nodejs"},{"label":".NET","value":"dotnet"}],"default":"nodejs"}},"filesets":[{"files":[{"path":"guides/payout/drop-in/web/_filesets/installation/webhook-handler.js","content":[{"start":0,"condition":{"steps":["webhook-endpoint"]},"children":["// Webhook endpoint to receive payout transaction notifications","// Configure this URL in the Unity Portal under Webhooks","app.post('/webhooks/pxp', async (req, res) => {"]},{"start":5,"condition":{"steps":["process-events"]},"children":["  const events = req.body;","","  for (const event of events) {","    if (event.eventCategory !== 'transaction') {","      continue;","    }","","    const txn = event.eventData;"]},"",{"start":16,"condition":{"steps":["check-state"]},"children":["    // PayPal payout success uses Authorised in the merchant-webhook example.","    // Confirm acceptable states for each method you enable.","    if (!isSuccessfulPayoutState(txn.state)) {","      continue;","    }"]},"",{"start":24,"condition":{"steps":["prevent-duplicates"]},"children":["    const alreadyProcessed = await isTransactionProcessed(txn.systemTransactionId);","    if (alreadyProcessed) {","      continue;","    }"]},"",{"start":31,"condition":{"steps":["verify-details"]},"children":["    const expectedWithdrawal = await getWithdrawalByMerchantTransactionId(","      txn.merchantTransactionId,","    );","","    // PayPal payout webhooks use amount.transaction / amount.currencyCode.","    // Other methods may use amounts.transactionValue / amounts.currencyCode.","    const amount = txn.amount?.transaction ?? txn.amounts?.transactionValue;","    const currency = txn.amount?.currencyCode ?? txn.amounts?.currencyCode;","","    if (","      expectedWithdrawal &&","      amount === expectedWithdrawal.amount &&","      currency === expectedWithdrawal.currency","    ) {"]},"",{"start":48,"condition":{"steps":["fulfill-order"]},"children":["      await reconcileWithdrawal(txn);","      await markTransactionProcessed(txn.systemTransactionId);","      console.log(`Withdrawal ${txn.merchantTransactionId} reconciled successfully`);"]},"    } else {","      console.error('Withdrawal verification failed - amount or currency mismatch');","    }","  }","",{"start":58,"condition":{"steps":["respond"]},"children":["  res.json({ state: 'Success' });"]},"});","","function isSuccessfulPayoutState(state) {","  // Extend with successful states for each method you enable","  const successfulStates = ['Authorised'];","  return successfulStates.includes(state);","}",""],"metadata":{"steps":["webhook-endpoint","process-events","check-state","prevent-duplicates","verify-details","fulfill-order","respond"]},"basename":"webhook-handler.js","language":"javascript"}],"downloadAssociatedFiles":[{"path":"guides/payout/drop-in/web/_filesets/installation/webhook-handler.js","content":[{"start":0,"condition":{"steps":["webhook-endpoint"]},"children":["// Webhook endpoint to receive payout transaction notifications","// Configure this URL in the Unity Portal under Webhooks","app.post('/webhooks/pxp', async (req, res) => {"]},{"start":5,"condition":{"steps":["process-events"]},"children":["  const events = req.body;","","  for (const event of events) {","    if (event.eventCategory !== 'transaction') {","      continue;","    }","","    const txn = event.eventData;"]},"",{"start":16,"condition":{"steps":["check-state"]},"children":["    // PayPal payout success uses Authorised in the merchant-webhook example.","    // Confirm acceptable states for each method you enable.","    if (!isSuccessfulPayoutState(txn.state)) {","      continue;","    }"]},"",{"start":24,"condition":{"steps":["prevent-duplicates"]},"children":["    const alreadyProcessed = await isTransactionProcessed(txn.systemTransactionId);","    if (alreadyProcessed) {","      continue;","    }"]},"",{"start":31,"condition":{"steps":["verify-details"]},"children":["    const expectedWithdrawal = await getWithdrawalByMerchantTransactionId(","      txn.merchantTransactionId,","    );","","    // PayPal payout webhooks use amount.transaction / amount.currencyCode.","    // Other methods may use amounts.transactionValue / amounts.currencyCode.","    const amount = txn.amount?.transaction ?? txn.amounts?.transactionValue;","    const currency = txn.amount?.currencyCode ?? txn.amounts?.currencyCode;","","    if (","      expectedWithdrawal &&","      amount === expectedWithdrawal.amount &&","      currency === expectedWithdrawal.currency","    ) {"]},"",{"start":48,"condition":{"steps":["fulfill-order"]},"children":["      await reconcileWithdrawal(txn);","      await markTransactionProcessed(txn.systemTransactionId);","      console.log(`Withdrawal ${txn.merchantTransactionId} reconciled successfully`);"]},"    } else {","      console.error('Withdrawal verification failed - amount or currency mismatch');","    }","  }","",{"start":58,"condition":{"steps":["respond"]},"children":["  res.json({ state: 'Success' });"]},"});","","function isSuccessfulPayoutState(state) {","  // Extend with successful states for each method you enable","  const successfulStates = ['Authorised'];","  return successfulStates.includes(state);","}",""],"metadata":{"steps":["webhook-endpoint","process-events","check-state","prevent-duplicates","verify-details","fulfill-order","respond"]},"basename":"webhook-handler.js","language":"javascript"}],"when":{"Backend":"nodejs"}},{"files":[{"path":"guides/payout/drop-in/web/_filesets/installation/webhook-handler.cs","content":["using System.Text.Json;","using System.Text.Json.Serialization;","",{"start":3,"condition":{"steps":["webhook-endpoint"]},"children":["// Webhook endpoint to receive payout transaction notifications","// Configure this URL in the Unity Portal under Webhooks","app.MapPost(\"/webhooks/pxp\", async (string webhookJson) =>","{"]},{"start":9,"condition":{"steps":["process-events"]},"children":["    var events = JsonSerializer.Deserialize<List<PxpWebhookEvent>>(webhookJson)","        ?? [];","","    foreach (var webhookEvent in events)","    {","        if (webhookEvent.EventCategory != \"transaction\" || webhookEvent.EventData is null)","        {","            continue;","        }","","        var transaction = webhookEvent.EventData;"]},"",{"start":23,"condition":{"steps":["check-state"]},"children":["        // PayPal payout success uses Authorised in the documented example.","        // Confirm acceptable states for each method you enable.","        if (!IsSuccessfulPayoutState(transaction.State))","        {","            continue;","        }"]},"",{"start":32,"condition":{"steps":["prevent-duplicates"]},"children":["        var alreadyProcessed = await IsTransactionProcessedAsync(transaction.SystemTransactionId);","        if (alreadyProcessed)","        {","            continue;","        }"]},"",{"start":40,"condition":{"steps":["verify-details"]},"children":["        var expectedWithdrawal = await GetWithdrawalByMerchantTransactionIdAsync(","            transaction.MerchantTransactionId);","","        // PayPal payout webhooks use amount.transaction / amount.currencyCode.","        // Other methods may use amounts.transactionValue / amounts.currencyCode.","        var amount = transaction.Amount?.Transaction ?? transaction.Amounts?.TransactionValue;","        var currency = transaction.Amount?.CurrencyCode ?? transaction.Amounts?.CurrencyCode;","","        if (expectedWithdrawal is not null &&","            amount == expectedWithdrawal.Amount &&","            currency == expectedWithdrawal.Currency)","        {"]},"",{"start":55,"condition":{"steps":["fulfill-order"]},"children":["            await ReconcileWithdrawalAsync(transaction);","            await MarkTransactionProcessedAsync(transaction.SystemTransactionId);","","            Console.WriteLine($\"Withdrawal {transaction.MerchantTransactionId} reconciled successfully\");"]},"        }","        else","        {","            Console.Error.WriteLine(\"Withdrawal verification failed - amount or currency mismatch\");","        }","    }","",{"start":68,"condition":{"steps":["respond"]},"children":["    return Results.Content(JsonSerializer.Serialize(new WebhookAcknowledgement","    {","        State = \"Success\"","    }), \"application/json\");"]},"});","","static bool IsSuccessfulPayoutState(string state)","{","    // Extend with successful states for each method you enable","    string[] successfulStates = [\"Authorised\"];","    return Array.IndexOf(successfulStates, state) >= 0;","}","","static Task<bool> IsTransactionProcessedAsync(string systemTransactionId)","{","    return Task.FromResult(false);","}","","static Task<WithdrawalRecord?> GetWithdrawalByMerchantTransactionIdAsync(string merchantTransactionId)","{","    return Task.FromResult<WithdrawalRecord?>(null);","}","","static Task ReconcileWithdrawalAsync(TransactionWebhookData transaction)","{","    return Task.CompletedTask;","}","","static Task MarkTransactionProcessedAsync(string systemTransactionId)","{","    return Task.CompletedTask;","}","","public sealed class PxpWebhookEvent","{","    [JsonPropertyName(\"eventCategory\")]","    public string EventCategory { get; set; } = string.Empty;","","    [JsonPropertyName(\"eventData\")]","    public TransactionWebhookData? EventData { get; set; }","}","","public sealed class TransactionWebhookData","{","    [JsonPropertyName(\"state\")]","    public string State { get; set; } = string.Empty;","","    [JsonPropertyName(\"systemTransactionId\")]","    public string SystemTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"amount\")]","    public WebhookAmount? Amount { get; set; }","","    [JsonPropertyName(\"amounts\")]","    public WebhookAmounts? Amounts { get; set; }","}","","public sealed class WebhookAmount","{","    [JsonPropertyName(\"transaction\")]","    public decimal Transaction { get; set; }","","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","}","","public sealed class WebhookAmounts","{","    [JsonPropertyName(\"transactionValue\")]","    public decimal TransactionValue { get; set; }","","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","}","","public sealed class WithdrawalRecord","{","    public decimal Amount { get; set; }","","    public string Currency { get; set; } = string.Empty;","}","","public sealed class WebhookAcknowledgement","{","    [JsonPropertyName(\"state\")]","    public string State { get; set; } = string.Empty;","}",""],"metadata":{"steps":["webhook-endpoint","process-events","check-state","prevent-duplicates","verify-details","fulfill-order","respond"]},"basename":"webhook-handler.cs","language":"csharp"}],"downloadAssociatedFiles":[{"path":"guides/payout/drop-in/web/_filesets/installation/webhook-handler.cs","content":["using System.Text.Json;","using System.Text.Json.Serialization;","",{"start":3,"condition":{"steps":["webhook-endpoint"]},"children":["// Webhook endpoint to receive payout transaction notifications","// Configure this URL in the Unity Portal under Webhooks","app.MapPost(\"/webhooks/pxp\", async (string webhookJson) =>","{"]},{"start":9,"condition":{"steps":["process-events"]},"children":["    var events = JsonSerializer.Deserialize<List<PxpWebhookEvent>>(webhookJson)","        ?? [];","","    foreach (var webhookEvent in events)","    {","        if (webhookEvent.EventCategory != \"transaction\" || webhookEvent.EventData is null)","        {","            continue;","        }","","        var transaction = webhookEvent.EventData;"]},"",{"start":23,"condition":{"steps":["check-state"]},"children":["        // PayPal payout success uses Authorised in the documented example.","        // Confirm acceptable states for each method you enable.","        if (!IsSuccessfulPayoutState(transaction.State))","        {","            continue;","        }"]},"",{"start":32,"condition":{"steps":["prevent-duplicates"]},"children":["        var alreadyProcessed = await IsTransactionProcessedAsync(transaction.SystemTransactionId);","        if (alreadyProcessed)","        {","            continue;","        }"]},"",{"start":40,"condition":{"steps":["verify-details"]},"children":["        var expectedWithdrawal = await GetWithdrawalByMerchantTransactionIdAsync(","            transaction.MerchantTransactionId);","","        // PayPal payout webhooks use amount.transaction / amount.currencyCode.","        // Other methods may use amounts.transactionValue / amounts.currencyCode.","        var amount = transaction.Amount?.Transaction ?? transaction.Amounts?.TransactionValue;","        var currency = transaction.Amount?.CurrencyCode ?? transaction.Amounts?.CurrencyCode;","","        if (expectedWithdrawal is not null &&","            amount == expectedWithdrawal.Amount &&","            currency == expectedWithdrawal.Currency)","        {"]},"",{"start":55,"condition":{"steps":["fulfill-order"]},"children":["            await ReconcileWithdrawalAsync(transaction);","            await MarkTransactionProcessedAsync(transaction.SystemTransactionId);","","            Console.WriteLine($\"Withdrawal {transaction.MerchantTransactionId} reconciled successfully\");"]},"        }","        else","        {","            Console.Error.WriteLine(\"Withdrawal verification failed - amount or currency mismatch\");","        }","    }","",{"start":68,"condition":{"steps":["respond"]},"children":["    return Results.Content(JsonSerializer.Serialize(new WebhookAcknowledgement","    {","        State = \"Success\"","    }), \"application/json\");"]},"});","","static bool IsSuccessfulPayoutState(string state)","{","    // Extend with successful states for each method you enable","    string[] successfulStates = [\"Authorised\"];","    return Array.IndexOf(successfulStates, state) >= 0;","}","","static Task<bool> IsTransactionProcessedAsync(string systemTransactionId)","{","    return Task.FromResult(false);","}","","static Task<WithdrawalRecord?> GetWithdrawalByMerchantTransactionIdAsync(string merchantTransactionId)","{","    return Task.FromResult<WithdrawalRecord?>(null);","}","","static Task ReconcileWithdrawalAsync(TransactionWebhookData transaction)","{","    return Task.CompletedTask;","}","","static Task MarkTransactionProcessedAsync(string systemTransactionId)","{","    return Task.CompletedTask;","}","","public sealed class PxpWebhookEvent","{","    [JsonPropertyName(\"eventCategory\")]","    public string EventCategory { get; set; } = string.Empty;","","    [JsonPropertyName(\"eventData\")]","    public TransactionWebhookData? EventData { get; set; }","}","","public sealed class TransactionWebhookData","{","    [JsonPropertyName(\"state\")]","    public string State { get; set; } = string.Empty;","","    [JsonPropertyName(\"systemTransactionId\")]","    public string SystemTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"merchantTransactionId\")]","    public string MerchantTransactionId { get; set; } = string.Empty;","","    [JsonPropertyName(\"amount\")]","    public WebhookAmount? Amount { get; set; }","","    [JsonPropertyName(\"amounts\")]","    public WebhookAmounts? Amounts { get; set; }","}","","public sealed class WebhookAmount","{","    [JsonPropertyName(\"transaction\")]","    public decimal Transaction { get; set; }","","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","}","","public sealed class WebhookAmounts","{","    [JsonPropertyName(\"transactionValue\")]","    public decimal TransactionValue { get; set; }","","    [JsonPropertyName(\"currencyCode\")]","    public string CurrencyCode { get; set; } = string.Empty;","}","","public sealed class WithdrawalRecord","{","    public decimal Amount { get; set; }","","    public string Currency { get; set; } = string.Empty;","}","","public sealed class WebhookAcknowledgement","{","    [JsonPropertyName(\"state\")]","    public string State { get; set; } = string.Empty;","}",""],"metadata":{"steps":["webhook-endpoint","process-events","check-state","prevent-duplicates","verify-details","fulfill-order","respond"]},"basename":"webhook-handler.cs","language":"csharp"}],"when":{"Backend":"dotnet"}}],"steps":[{"id":"webhook-endpoint","heading":"Create the webhook endpoint"},{"id":"process-events","heading":"Process webhook events"},{"id":"check-state","heading":"Check payout state"},{"id":"prevent-duplicates","heading":"Prevent duplicate processing"},{"id":"verify-details","heading":"Verify transaction details"},{"id":"fulfill-order","heading":"Reconcile the withdrawal"},{"id":"respond","heading":"Respond to the webhook"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"verify-payouts","__idx":7},"children":["Verify payouts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a payout submission succeeds, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," fires with transaction details. Always verify on your backend before marking a withdrawal complete."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure webhooks in the Unity Portal to receive transaction notifications on your server. Payout Drop-in uses the same merchant transaction webhook channel as other products. A successful payout looks like this:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PayPal","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":100,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"PAYOUT_001","systemTransactionId":"787ebfee-c0ce-497a-82c3-265d1bf19b0c","providerTransactionId":"PAYPAL_PAYOUT_ITEM_ID","fundingData":{"paypal":{"paymentSource":"Paypal"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Card","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":50,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"CARD-PAYOUT-001","systemTransactionId":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","fundingData":{"card":{"cardScheme":"Visa","gatewayTokenId":"1ed768bb-e88a-4636-91ae-67927ccbb03a","schemeTokenNumber":"4837261112345678"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Apple Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":40,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"APPLEPAY-PAYOUT-001","systemTransactionId":"b2c3d4e5-f6a7-8901-bcde-f12345678901","fundingData":{"card":{"cardScheme":"Mastercard","gatewayTokenId":"2fd879cc-f99b-4747-92bf-78038ddcc03c","schemeTokenNumber":"5200820000000010"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Google Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":40,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"GOOGLEPAY-PAYOUT-001","systemTransactionId":"c3d4e5f6-a7b8-9012-cdef-123456789012","fundingData":{"card":{"cardScheme":"Visa","gatewayTokenId":"3ae98add-0aac-4858-a3c0-89149eeed14d","schemeTokenNumber":"4111111111111111"}}}},"errors":[]},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/get-started/manage-webhooks"},"children":["Manage webhooks"]}," for subscription and signature validation."]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"webhook-endpoint","heading":"Create the webhook endpoint"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up an endpoint at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/webhooks/pxp"]}," to receive notifications from Unity."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"process-events","heading":"Process webhook events"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Loop through the events array and filter for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eventCategory"]}," values of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"check-state","heading":"Check payout state"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Filter to the successful payout states defined for your programme. The documented success examples use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorised"]},". Confirm acceptable states for each method you enable."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"prevent-duplicates","heading":"Prevent duplicate processing"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Skip events you have already handled using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},"."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"verify-details","heading":"Verify transaction details"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Match ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},", amount, and currency against the withdrawal you authorised."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"fulfill-order","heading":"Reconcile the withdrawal"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If verification passes, update withdrawal status and mark the transaction as processed."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"respond","heading":"Respond to the webhook"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Always return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ state: 'Success' }"]}," to acknowledge receipt, even if processing failed."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also verify payouts with the Transactions API. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/payout/drop-in/web/implementation"},"children":["Implementation"]}," for the broader integration flow."]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["That's it! You now have a working Payout Drop-in integration."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whats-next","__idx":8},"children":["What's next?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Explore these guides next:"]},{"$$mdtype":"Tag","name":"ul","attributes":{"className":"code-walkthrough-list"},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/implementation"},"children":["Implementation"]}]}," for HMAC details, mount lifecycle, and method availability."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/configuration"},"children":["Configuration"]}]}," for initialiser options, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["methodConfig"]},", and localisation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/events"},"children":["Events"]}]}," for callbacks and ordering."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/card"},"children":["Card"]}]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/paypal"},"children":["PayPal"]}]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/apple-pay"},"children":["Apple Pay"]}]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/google-pay"},"children":["Google Pay"]}]}," for method requirements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/testing"},"children":["Testing"]}]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/guides/payout/drop-in/web/troubleshooting"},"children":["Troubleshooting"]}]}," to validate and diagnose your integration."]}]}]},"headings":[{"value":"Quickstart","id":"quickstart","depth":1},{"value":"Requirements","id":"requirements","depth":2},{"value":"Install the SDK","id":"install-the-sdk","depth":2},{"value":"Create a session on your backend","id":"create-a-session-on-your-backend","depth":2},{"value":"Step 1: The merchant backend creates a session","id":"step-1-the-merchant-backend-creates-a-session","depth":3},{"value":"Step 2: The SDK runs in the browser","id":"step-2-the-sdk-runs-in-the-browser","depth":3},{"value":"Initialise Drop-in on your frontend","id":"initialise-drop-in-on-your-frontend","depth":2},{"value":"Verify payouts","id":"verify-payouts","depth":2},{"value":"What's next?","id":"whats-next","depth":2}],"frontmatter":{"markdown":{"toc":{"hide":true}},"footer":{"hide":true},"seo":{"title":"Quickstart"}},"lastModified":"2026-11-12T15:20:37.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/payout/drop-in/web/quickstart","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}