Purchases

POST /api/public/purchases/{purchaseId}/use

Changed on

Record one use of an ACTIVE purchase: a punch card is charged amount credits (default 1), a membership logs one visit against its period allowance. Fails with 400 when not enough credits remain or the membership allowance is used up.

Request

  • Base URL
    https://api.coach-platform.com
  • Auth
    HTTP bearer

Path parameters

purchaseIdstring required

Headers

Idempotency-Keystring

Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate.

Request body

amountnumber

Credits to charge on a punch card. Defaults to 1. Ignored for memberships.

notestring

Note stored on the usage record

usageDatestring date-time

When the session took place. Defaults to now.

Response

Successful response

Changes