ConnectSessions
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
connectSession
.Allowed values:connectSession
- Name
- id
- Type
- string
- Description
Unique identifier for the Connect Session.
Example:"csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- intent
- Type
- Intent
- Description
- Name
- url
- Type
- nullable string
- Description
The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user.
Example:"https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp"
- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user that the session is for.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Example
{
"object": "connectSession",
"id": "csn_0SNlurA049MEWV1GWxpaE5D0t2D6",
"callbackUrl": "https://example.com",
"intent": {
"cancelSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"changeSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"checkoutAddon": {
"addons": [
"add_0SNlurA049MEWV4VxLfwJc7PJtHc"
],
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"checkoutNewSubscription": {
"addons": [
"add_0SNlurA049MEWV4VxLfwJc7PJtHc"
],
"device": "dev_0SNlurA049MEWV55CrA9qMvI2FVJ",
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"imei": "492388841798923"
},
"completePorting": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"confirmPayment": {
"payment": "pay_0SNlurA049MEWV2HRA0slWFuS8DV"
},
"resumeSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"type": "cancelSubscription",
"viewEsimInstallation": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"viewSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
},
"url": "https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
Retrieve a connect session
Retrieves the details of an existing Connect Session.
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- connectSessionId
- Type
- string
- Description
required
Responses
Returns the Connect Session if it exists.
- Name
- object
- Type
- string
- Description
Type of object is always
connectSession
.Allowed values:connectSession
- Name
- id
- Type
- string
- Description
Unique identifier for the Connect Session.
Example:"csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- intent
- Type
- Intent
- Description
- Name
- url
- Type
- nullable string
- Description
The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user.
Example:"https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp"
- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user that the session is for.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/connectSessions/{connectSessionId} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "connectSession",
"id": "csn_0SNlurA049MEWV1GWxpaE5D0t2D6",
"callbackUrl": "https://example.com",
"intent": {
"cancelSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"type": "cancelSubscription",
"subscription": null
},
"url": "https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
Update a connect session
Updates the Connect Session with the given parameters.
The user
or userDetails
attributes can only be set when the session is not associated with a user yet.
Related guide: Connect Sessions
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Body
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
- Name
- userDetails
- Type
- object
- Description
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- connectSessionId
- Type
- string
- Description
required
Responses
Returns the updated Connect Session.
- Name
- object
- Type
- string
- Description
Type of object is always
connectSession
.Allowed values:connectSession
- Name
- id
- Type
- string
- Description
Unique identifier for the Connect Session.
Example:"csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- intent
- Type
- Intent
- Description
- Name
- url
- Type
- nullable string
- Description
The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user.
Example:"https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp"
- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user that the session is for.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/connectSessions/{connectSessionId} \
-X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"callbackUrl\":\"https://example.com\",\"user\":\"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d\",\"userDetails\":{\"birthday\":\"2017-07-21\",\"email\":\"jerry@example.com\",\"fullName\":\"Jerry Seinfeld\",\"metadata\":{},\"preferredLocale\":\"en-US\"}}"
Response
{
"object": "connectSession",
"id": "csn_0SNlurA049MEWV1GWxpaE5D0t2D6",
"callbackUrl": "https://example.com",
"intent": {
"cancelSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"type": "cancelSubscription",
"subscription": null
},
"url": "https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
Create a connect session
Creates a new Connect Session for the given parameters.
Related guide: Connect Sessions
Preview
This endpoint is currently in preview and might change in the future.
We’re excited to hear your feedback and ideas. Please send an email to support@gigs.com to share your thoughts.
Body
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- intent
- Type
- IntentCreate
- Description
required- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
- Name
- userDetails
- Type
- object
- Description
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required
Responses
Returns the newly created Connect Session.
- Name
- object
- Type
- string
- Description
Type of object is always
connectSession
.Allowed values:connectSession
- Name
- id
- Type
- string
- Description
Unique identifier for the Connect Session.
Example:"csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
- Name
- callbackUrl
- Type
- nullable string
- Description
The URL to which the user will be redirected after the Connect Session is completed.
Example:"https://example.com"
- Name
- intent
- Type
- Intent
- Description
- Name
- url
- Type
- nullable string
- Description
The session URL. Redirect your users to this URL to take them to Connect. It is only present on all create responses or in the update responses that associate the session with a user. It should not be stored, logged or exposed to anyone other than the user.
Example:"https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp"
- Name
- user
- Type
- nullable string
- Description
The unique identifier of the user that the session is for.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/connectSessions \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"callbackUrl\":\"https://example.com\",\"intent\":{\"type\":\"cancelSubscription\",\"cancelSubscription\":{\"subscription\":\"sub_0SNlurA049MEWV2gSfSxi00xlPIi\"},\"subscription\":null},\"user\":\"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d\",\"userDetails\":{\"birthday\":\"2017-07-21\",\"email\":\"jerry@example.com\",\"fullName\":\"Jerry Seinfeld\",\"metadata\":{},\"preferredLocale\":\"en-US\"}}"
Response
{
"object": "connectSession",
"id": "csn_0SNlurA049MEWV1GWxpaE5D0t2D6",
"callbackUrl": "https://example.com",
"intent": {
"cancelSubscription": {
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
},
"type": "cancelSubscription",
"subscription": null
},
"url": "https://connect.gigs.com/checkout/entry?session=csn_0SNlurA049MEWV1GWxpaE5D0t2D6&token=lzODbEyaUQjVRAmalD4pdaq5Nkn1Lw0qTL6Rdsh7PwLVES6N7ImWxnCYbJA99AXp",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}