# Open a customer's billing portal

Source: https://docs.orbytelabs.com/api-reference/subscriptions/createCustomerBillingPortal

## POST /v1/subscriptions/portal

```json
{
  "operationId": "createCustomerBillingPortal",
  "tags": [
    "Subscriptions"
  ],
  "summary": "Open a customer's billing portal",
  "description": "Creates a temporary Stripe portal URL for viewing invoices and updating billing details and payment methods. The selected environment needs a configured Stripe billing portal, and the customer needs an existing Stripe billing profile in that environment. Requires the subscriptions write permission.",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "type": "string",
        "minLength": 1,
        "description": "Required for environment-scoped OAuth operations. API keys remain bound to their own environment."
      },
      "required": false,
      "description": "Required for environment-scoped OAuth operations. API keys remain bound to their own environment.",
      "name": "X-Orbyte-Environment",
      "in": "header"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "identity": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "returnUrl": {
              "type": "string",
              "maxLength": 2048,
              "format": "uri"
            }
          },
          "required": [
            "identity",
            "returnUrl"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Temporary billing portal session",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "401": {
      "description": "Unauthorized",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "403": {
      "description": "Insufficient permission",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "404": {
      "description": "Resource not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "409": {
      "description": "Resource or request conflict",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "413": {
      "description": "Content too large",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "415": {
      "description": "Unsupported media type",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    }
  }
}
```

Complete schema: [OpenAPI 3.1 document](https://docs.orbytelabs.com/openapi.json)