---
title: "Upsert customer stripe app data"
method: PUT
path: "/api/v1/customers/{customerIdOrKey}/stripe"
tags: ["Customers", "Apps"]
---

# Upsert customer stripe app data

`PUT /api/v1/customers/{customerIdOrKey}/stripe`

Upsert stripe app data for a customer.
Only updates data if the customer billing profile is linked to a stripe app.

## Path parameters

- `customerIdOrKey` union, required — ULID (Universally Unique Lexicographically Sortable Identifier) or external unique key.
  - string — ULID (Universally Unique Lexicographically Sortable Identifier).
  - string — ExternalKey is a looser version of key.

## Request body

- StripeCustomerAppDataBase — Stripe Customer App Data Base.
  - `stripeCustomerId` string, required — The Stripe customer ID.
  - `stripeDefaultPaymentMethodId` string — The Stripe default payment method ID.

## Response `200`

The request has succeeded.

- StripeCustomerAppData — Stripe Customer App Data.
  - `id` string — The app ID. If not provided, it will use the global default for the app type.
  - `type` 'stripe', required — The app name.
  - `stripeCustomerId` string, required — The Stripe customer ID.
  - `stripeDefaultPaymentMethodId` string — The Stripe default payment method ID.
  - `app` StripeApp — A installed Stripe app object.
    - `id` string, required — A unique identifier for the resource.
    - `name` string, required — Human-readable name for the resource. Between 1 and 256 characters.
    - `description` string — Optional description of the resource. Maximum 1024 characters.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `createdAt` string, date-time, required — Timestamp of when the resource was created.
    - `updatedAt` string, date-time, required — Timestamp of when the resource was last updated.
    - `deletedAt` string, date-time — Timestamp of when the resource was permanently deleted.
    - `listing` MarketplaceListing, required — A marketplace listing. Represent an available app in the app marketplace that can be installed to the organization. Marketplace apps only exist in config so they don't extend the Resource model.
      - `type` 'stripe' | 'sandbox' | 'custom_invoicing', required — Type of the app.
      - `name` string, required — The app's name.
      - `description` string, required — The app's description.
      - `capabilities` AppCapability[], required — The app's capabilities.
        - `type` 'reportUsage' | 'reportEvents' | 'calculateTax' | 'invoiceCustomers' | 'collectPayments', required — App capability type.
        - `key` string, required — Key
        - `name` string, required — The capability name.
        - `description` string, required — The capability description.
      - `installMethods` InstallMethod[], required — Install methods. List of methods to install the app.
    - `status` 'ready' | 'unauthorized', required — App installed status.
    - `type` 'stripe', required — The app's type is Stripe.
    - `stripeAccountId` string, required — The Stripe account ID.
    - `livemode` boolean, required — Livemode, true if the app is in production mode.
    - `maskedAPIKey` string, required — The masked API key. Only shows the first 8 and last 3 characters.

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
- `401` — The request has not been applied because it lacks valid authentication credentials for the target resource.
- `403` — The server understood the request but refuses to authorize it.
- `404` — The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
- `412` — One or more conditions given in the request header fields evaluated to false when tested on the server.
- `500` — The server encountered an unexpected condition that prevented it from fulfilling the request.
- `503` — The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.
- `default` — An unexpected error response.

---

[API](https://skmtc.net/openmeterio/apis/openmeter-api.md) · [All operations](https://skmtc.net/openmeterio/apis/openmeter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmeterio/openmeter-api/revisions/1cd97f063f4a/schema)
