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"

Response

{
  "object": "connectSession",
  "id": "csn_0SNlurA049MEWV1GWxpaE5D0t2D6",
  "callbackUrl": "https://example.com",
  "intent": {
    "cancelSubscription": {
      "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
    },
    "changeSubscription": {
      "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
    },
    "checkoutAddon": {
      "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
    },
    "checkoutNewSubscription": {
      "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"
}

GET/projects/{project}/connectSessions/{connectSessionId}

Retrieve a connect session

Retrieves the details of an existing Connect Session.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    connectSessionId
    Type
    string
    required
    Description

Response Schemas

Returns the Connect Session if it exists.

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always connectSession.

    Allowed values: connectSession
  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the Connect Session.

    Example: "csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
  • Name
    callbackUrl
    Type
    nullable string
    required
    Description

    The URL to which the user will be redirected after the Connect Session is completed.

    Example: "https://example.com"
  • Name
    intent
    Type
    Intent
    required
    Description
  • Name
    url
    Type
    nullable string
    required
    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
    required
    Description

    The unique identifier of the user that the session is for.

    Example: "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"

Request

GET
/projects/{project}/connectSessions/{connectSessionId}
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"
}

PATCH/projects/{project}/connectSessions/{connectSessionId}

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

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
    required
    Description

    The unique identifier for the project.

    Example: "gigs"
  • Name
    connectSessionId
    Type
    string
    required
    Description

Response Schemas

Returns the updated Connect Session.

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always connectSession.

    Allowed values: connectSession
  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the Connect Session.

    Example: "csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
  • Name
    callbackUrl
    Type
    nullable string
    required
    Description

    The URL to which the user will be redirected after the Connect Session is completed.

    Example: "https://example.com"
  • Name
    intent
    Type
    Intent
    required
    Description
  • Name
    url
    Type
    nullable string
    required
    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
    required
    Description

    The unique identifier of the user that the session is for.

    Example: "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"

Request

PATCH
/projects/{project}/connectSessions/{connectSessionId}
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"
}

POST/projects/{project}/connectSessions

Create a connect session

Creates a new Connect Session for the given parameters.

Related guide: Connect Sessions

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
    required
    Description
  • 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
    required
    Description

    The unique identifier for the project.

    Example: "gigs"

Response Schemas

Returns the newly created Connect Session.

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always connectSession.

    Allowed values: connectSession
  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the Connect Session.

    Example: "csn_0SNlurA049MEWV1GWxpaE5D0t2D6"
  • Name
    callbackUrl
    Type
    nullable string
    required
    Description

    The URL to which the user will be redirected after the Connect Session is completed.

    Example: "https://example.com"
  • Name
    intent
    Type
    Intent
    required
    Description
  • Name
    url
    Type
    nullable string
    required
    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
    required
    Description

    The unique identifier of the user that the session is for.

    Example: "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"

Request

POST
/projects/{project}/connectSessions
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"
}