GetConnectionContext()

This method is called during store setup with the initial credentials and connection context provided by the seller, and returns any additional context for the connection to the order source.

Syntax

module.exports = async function GetConnectionContext(request) {
// Your code here
}
import {
GetConnectionContextRequest,
GetConnectionContextResponse
} from "@shipengine/connect-order-source-api";
export const GetConnectionContext = async (
request: GetConnectionContextRequest
): Promise<GetConnectionContextResponse> => {
// Your code here
}

GetConnectionContextRequest

This request is sent after a user authenticates with the third party, this allows you the chance to fetch additional properties and append them onto the connection_context.

NameTypeNullable?Description
auth

Auth

The authorization information necessary to fulfill this request.

transaction_idstring

A randomly generated transaction ID, used to correlate the request and response

GetConnectionContextResponse

The connection context response which will allow you to update the connection_context for all future requests.

NameTypeNullable?Description
connection_contextobject

The connection context that will be sent as part of the auth.connection_context for other requests. ex: { 'user_id': 'fake_234', 'store_id': '12324' }