> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blink.store/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer Portal Session

> Generates a 15-minute magic link that allows a buyer to log into the customer portal where they can view their orders. This endpoint verifies the customer via `x-store-id`. The JWT token embedded in the portal link ensures secure access.

- **Parameters:**
  - `id` (string, path, required): The ID of the customer.

- **Responses:**
  - `201`: Successfully created portal session.
  - `401`: Unauthorized if `x-store-id` is not provided.
  - `404`: Customer not found.



## OpenAPI

````yaml /api-reference/blink-api.json post /customers/{id}/portal-session
openapi: 3.0.0
info:
  title: Blink API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
tags:
  - name: Invoices
    description: Unified merchant of record invoices for products and subscriptions.
  - name: Geo Pricing
    description: Resolve Purchasing Power Parity (PPP) localized pricing.
paths:
  /customers/{id}/portal-session:
    post:
      tags:
        - Customers
      summary: Create Customer Portal Session
      description: >-
        Generates a 15-minute magic link that allows a buyer to log into the
        customer portal where they can view their orders. This endpoint verifies
        the customer via `x-store-id`. The JWT token embedded in the portal link
        ensures secure access.


        - **Parameters:**
          - `id` (string, path, required): The ID of the customer.

        - **Responses:**
          - `201`: Successfully created portal session.
          - `401`: Unauthorized if `x-store-id` is not provided.
          - `404`: Customer not found.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID of the customer.
      responses:
        '201':
          description: Customer portal session created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalSessionResponse'
        '401':
          description: Unauthorized - Store ID header missing.
        '404':
          description: Customer not found.
      security:
        - storeIdHeader: []
components:
  schemas:
    PortalSessionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            customer_id:
              type: string
            customer_email:
              type: string
            url:
              type: string
            expires_in:
              type: integer
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````