Skip to content
Get started

Create a Widget session token

BridgeTokenV1 Bridge.Initialize(BridgeInitializeParamsparameters, CancellationTokencancellationToken = default)
POST/v1/bridge/initialize

Use this endpoint to generate a session token for use in the Bridge widget.

ParametersExpand Collapse
BridgeInitializeParams parameters
required string customerID

Body param: The Straddle generated unique identifier of the customer to create a bridge token for.

formatuuid
Config config

Body param

ProcessingMethod ProcessingMethod
One of the following:
"inline"Inline
"background"Background
"skip"Skip
SandboxOutcome SandboxOutcome
One of the following:
"standard"Standard
"active"Active
"rejected"Rejected
"review"Review
string? externalID

Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems.

string correlationID

Header param: Optional client generated identifier to trace and debug a series of requests.

string idempotencyKey

Header param: Optional client generated value to use for idempotent requests.

maxLength40
minLength10
string requestID

Header param: Optional client generated identifier to trace and debug a request.

string straddleAccountID

Header param: For use by platforms to specify an account id and set scope of a request.

formatuuid
ReturnsExpand Collapse
class BridgeTokenV1:
required Data Data
required string BridgeToken

JWT Token to use in the bridge widget.

required ResponseMetadata Meta

Metadata about the API request, including an identifier and timestamp.

required string ApiRequestID

Unique identifier for this API request, useful for troubleshooting.

formatuuid
required DateTimeOffset ApiRequestTimestamp

Timestamp for this API request, useful for troubleshooting.

formatdate-time
required ResponseType ResponseType

Indicates the structure of the returned content.

  • "object" means the data field contains a single JSON object.
  • "array" means the data field contains an array of objects.
  • "error" means the data field contains an error object with details of the issue.
  • "none" means no data is returned.
One of the following:
"object"Object
"array"Array
"error"Error
"none"None

Create a Widget session token

BridgeInitializeParams parameters = new()
{
    CustomerID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

var bridgeTokenV1 = await client.Bridge.Initialize(parameters);

Console.WriteLine(bridgeTokenV1);
{
  "data": {
    "bridge_token": "bridge_token"
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}
Returns Examples
{
  "data": {
    "bridge_token": "bridge_token"
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}