---
title: "Create a pass"
method: POST
path: "/passes"
---

# Create a pass

`POST /passes`

## Request

- Base URL: `https://api.sandbox.cleeng.com/3.1`
- URL: `https://api.sandbox.cleeng.com/3.1/passes`
- Auth: API key in header `X-Publisher-Token`

Use this endpoint to create [externally-managed passes](https://developers.cleeng.com/docs/externally-managed-passes). <br><br>The life cycle of externally-managed passes is managed outside of Cleeng so it is up to a publisher to notify Cleeng about pass status changes, e.g. the change of pass expiration date or pass termination if auto-termination is not enabled (if auto-termination is not enabled for the payment method, Cleeng platform will not terminate the pass when expiry date is reached, and the publisher will need to send the termination request to revoke access). <br><br> You can create [multiple passes for the same offer and customer](https://developers.cleeng.com/docs/externally-managed-passes#multiple-passes-per-offer) with this endpoint. But the endpoint prevents duplicate passes with the same external ID and source. It only allows new passes if there isn't already an active pass from the same source and with the same external ID.

## Headers

- `Content-Type` string

## Request body

- object
  - `customerId` integer, required: The identifier of Cleeng customer. Minimum: `100000000`, maximum: `999999999`.
  - `offerId` string, required: The identifier of Cleeng offer.
  - `paymentMethodId` integer, required: The identifier of the payment method configured for externally-managed passes; provided by Cleeng.
  - `externalId` string, required: The external identifier of a pass. The identifier must be unique for a given payment method (i.e. you can't have two identical identifiers for the same payment method).
  - `expiresAt` integer: Expiration time in UNIX timestamp format. For non-expiring (permanent) passes it must be set to `null`. If the parameter is not provided, `expiresAt` will be calculated based on an offer.
  - `externalProperties` object: Any external properties of a pass. Payload is limited to 4000 characters.
    - `property1` string: Example property
  - `paymentId` integer: The identifier of Cleeng payment. (Payment must be created with the same `paymentMethodId` as specified here).
  - `initialPurchaseDevice` string: Device or sales channel reported by the app store for the purchase. The value is stored in lower case with leading and trailing whitespace removed. Minimum length: 1, maximum length: 50, counted on the value as sent, including surrounding spaces. Must contain at least one non-whitespace character.

## Response `201`

201

- object
  - `passId` integer
  - `customerId` integer
  - `status` string
  - `offerId` string
  - `expiresAt` integer
  - `paymentMethodId` integer
  - `externalId` string
  - `externalProperties` object
  - `isExternallyManaged` boolean
  - `source` string

## Other responses

- `400`: 400
- `422`: 422

---

[API](https://skmtc.dev/cleeng/apis/api-31.md) - [All operations](https://skmtc.dev/cleeng/apis/api-31/llms.txt) - [OpenAPI document](https://skmtc.dev/cleeng/apis/api-31/revisions/df55396cda4f?raw)
