Create a pass

Use this endpoint to create 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 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.

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

Headers

Content-Typestring

Request body

customerIdinteger required

The identifier of Cleeng customer. Minimum: 100000000, maximum: 999999999.

offerIdstring required

The identifier of Cleeng offer.

paymentMethodIdinteger required

The identifier of the payment method configured for externally-managed passes; provided by Cleeng.

externalIdstring 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).

expiresAtinteger

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.

paymentIdinteger

The identifier of Cleeng payment. (Payment must be created with the same paymentMethodId as specified here).

initialPurchaseDevicestring

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

passIdinteger
customerIdinteger
statusstring
offerIdstring
expiresAtinteger
paymentMethodIdinteger
externalIdstring
externalPropertiesobject
isExternallyManagedboolean
sourcestring

Example response

{
  "passId": 123456789,
  "customerId": 123123123,
  "status": "active",
  "offerId": "P987654321_PL",
  "expiresAt": 1713182652,
  "paymentMethodId": 111222333,
  "externalId": "CustomerExternalId",
  "isExternallyManaged": true,
  "source": "samsung"
}

Changes

No recorded changes to this operation across all 1 revision of this API.