> For the complete documentation index, see [llms.txt](https://movemint.gitbook.io/movemint-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://movemint.gitbook.io/movemint-developer-docs/open-api-specification/credits.md).

# Credits

Manage group credits (stored-value codes) for the group that owns an event. Credits are group-scoped and usable across every event in the group; they are managed under the event so the event-bound integration can reach them. Returns 422 if the event is not part of a group.

## GET /api/v1/events/{handle}/credits

> List credits for the event's group

````json
{"openapi":"3.1.0","info":{"title":"Movemint API","version":"1.0"},"tags":[{"name":"Credits","description":"Manage group credits (stored-value codes) for the group that owns an\nevent. Credits are group-scoped and usable across every event in the\ngroup; they are managed under the event so the event-bound integration\ncan reach them. Returns 422 if the event is not part of a group.\n"}],"servers":[{"url":"https://www.movemint.cc","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Pass the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 authentication using the Authorization Code or Client\nCredentials grant flow.\n","flows":{"authorizationCode":{"authorizationUrl":"https://www.movemint.cc/oauth/authorize","tokenUrl":"https://www.movemint.cc/oauth/token","refreshUrl":"https://www.movemint.cc/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"https://www.movemint.cc/oauth/token","scopes":{}}}}},"parameters":{"EventHandle":{"name":"handle","in":"path","required":true,"description":"The unique handle (slug) of the event","schema":{"type":"string"}}},"schemas":{"Credit":{"type":"object","required":["id","code","amount_cents","amount_dollars","remaining_balance_cents","remaining_balance_dollars","currency","expiration_date","first_name","last_name","email","applies_to_merchandise"],"properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"amount_cents":{"type":"integer"},"amount_dollars":{"type":"number"},"remaining_balance_cents":{"type":"integer"},"remaining_balance_dollars":{"type":"number"},"currency":{"type":"string"},"expiration_date":{"type":"string","format":"date-time","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"applies_to_merchandise":{"type":"boolean"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code"},"error_description":{"type":"string","description":"Human-readable description of the error"}}},"Error":{"type":"object","description":"A generic error response","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"}}}},"responses":{"Unauthorized":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"Forbidden":{"description":"Forbidden - user is not an admin of this event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"EventNotFound":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/events/{handle}/credits":{"get":{"tags":["Credits"],"summary":"List credits for the event's group","operationId":"listEventCredits","parameters":[{"$ref":"#/components/parameters/EventHandle"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["credits"],"properties":{"credits":{"type":"array","items":{"$ref":"#/components/schemas/Credit"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/EventNotFound"}}}}}}
````

## Create a credit

> Creates a credit on the event's group. \`amount\_cents\` sets both the\
> face value and the starting balance. Returns 422 if the event is not\
> part of a group, if the code is missing or already used within the\
> group, if \`amount\_cents\` is missing or non-positive, or if the\
> currency is unsupported. When \`email\_credit\_to\_participant\` is not\
> false and an \`email\` is present, the recipient is emailed.<br>

````json
{"openapi":"3.1.0","info":{"title":"Movemint API","version":"1.0"},"tags":[{"name":"Credits","description":"Manage group credits (stored-value codes) for the group that owns an\nevent. Credits are group-scoped and usable across every event in the\ngroup; they are managed under the event so the event-bound integration\ncan reach them. Returns 422 if the event is not part of a group.\n"}],"servers":[{"url":"https://www.movemint.cc","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Pass the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 authentication using the Authorization Code or Client\nCredentials grant flow.\n","flows":{"authorizationCode":{"authorizationUrl":"https://www.movemint.cc/oauth/authorize","tokenUrl":"https://www.movemint.cc/oauth/token","refreshUrl":"https://www.movemint.cc/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"https://www.movemint.cc/oauth/token","scopes":{}}}}},"parameters":{"EventHandle":{"name":"handle","in":"path","required":true,"description":"The unique handle (slug) of the event","schema":{"type":"string"}}},"schemas":{"CreateCreditRequest":{"allOf":[{"$ref":"#/components/schemas/CreditWritableFields"},{"type":"object","required":["code","amount_cents"],"properties":{"amount_cents":{"type":"integer","minimum":1}}}]},"CreditWritableFields":{"type":"object","properties":{"code":{"type":"string"},"currency":{"type":"string","enum":["USD","CAD","AUD","DKK","NOK","MXN","GBP","EUR"]},"expiration_date":{"type":"string","format":"date-time"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"applies_to_merchandise":{"type":"boolean"},"email_credit_to_participant":{"type":"boolean","description":"Defaults to true; set false to suppress the recipient email on create."}}},"Credit":{"type":"object","required":["id","code","amount_cents","amount_dollars","remaining_balance_cents","remaining_balance_dollars","currency","expiration_date","first_name","last_name","email","applies_to_merchandise"],"properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"amount_cents":{"type":"integer"},"amount_dollars":{"type":"number"},"remaining_balance_cents":{"type":"integer"},"remaining_balance_dollars":{"type":"number"},"currency":{"type":"string"},"expiration_date":{"type":"string","format":"date-time","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"applies_to_merchandise":{"type":"boolean"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code"},"error_description":{"type":"string","description":"Human-readable description of the error"}}},"Error":{"type":"object","description":"A generic error response","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"}}},"ValidationError":{"type":"object","description":"A validation error response with a list of error messages","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of validation error messages"}}}},"responses":{"Unauthorized":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"Forbidden":{"description":"Forbidden - user is not an admin of this event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"EventNotFound":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/events/{handle}/credits":{"post":{"tags":["Credits"],"summary":"Create a credit","description":"Creates a credit on the event's group. `amount_cents` sets both the\nface value and the starting balance. Returns 422 if the event is not\npart of a group, if the code is missing or already used within the\ngroup, if `amount_cents` is missing or non-positive, or if the\ncurrency is unsupported. When `email_credit_to_participant` is not\nfalse and an `email` is present, the recipient is emailed.\n","operationId":"createEventCredit","parameters":[{"$ref":"#/components/parameters/EventHandle"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["credit"],"properties":{"credit":{"$ref":"#/components/schemas/Credit"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/EventNotFound"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
````

## GET /api/v1/events/{handle}/credits/{id}

> Get a credit

````json
{"openapi":"3.1.0","info":{"title":"Movemint API","version":"1.0"},"tags":[{"name":"Credits","description":"Manage group credits (stored-value codes) for the group that owns an\nevent. Credits are group-scoped and usable across every event in the\ngroup; they are managed under the event so the event-bound integration\ncan reach them. Returns 422 if the event is not part of a group.\n"}],"servers":[{"url":"https://www.movemint.cc","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Pass the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 authentication using the Authorization Code or Client\nCredentials grant flow.\n","flows":{"authorizationCode":{"authorizationUrl":"https://www.movemint.cc/oauth/authorize","tokenUrl":"https://www.movemint.cc/oauth/token","refreshUrl":"https://www.movemint.cc/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"https://www.movemint.cc/oauth/token","scopes":{}}}}},"parameters":{"EventHandle":{"name":"handle","in":"path","required":true,"description":"The unique handle (slug) of the event","schema":{"type":"string"}},"ResourceId":{"name":"id","in":"path","required":true,"description":"The ID of the resource","schema":{"type":"integer","format":"int64"}}},"schemas":{"Credit":{"type":"object","required":["id","code","amount_cents","amount_dollars","remaining_balance_cents","remaining_balance_dollars","currency","expiration_date","first_name","last_name","email","applies_to_merchandise"],"properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"amount_cents":{"type":"integer"},"amount_dollars":{"type":"number"},"remaining_balance_cents":{"type":"integer"},"remaining_balance_dollars":{"type":"number"},"currency":{"type":"string"},"expiration_date":{"type":"string","format":"date-time","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"applies_to_merchandise":{"type":"boolean"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code"},"error_description":{"type":"string","description":"Human-readable description of the error"}}},"Error":{"type":"object","description":"A generic error response","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"}}}},"responses":{"Unauthorized":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"Forbidden":{"description":"Forbidden - user is not an admin of this event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"EventNotFound":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/events/{handle}/credits/{id}":{"get":{"tags":["Credits"],"summary":"Get a credit","operationId":"getEventCredit","parameters":[{"$ref":"#/components/parameters/EventHandle"},{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["credit"],"properties":{"credit":{"$ref":"#/components/schemas/Credit"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/EventNotFound"}}}}}}
````

## Delete a credit

> Deletes a credit. Returns 422 if the credit has already been used\
> (it has usage records representing money applied to participants).<br>

````json
{"openapi":"3.1.0","info":{"title":"Movemint API","version":"1.0"},"tags":[{"name":"Credits","description":"Manage group credits (stored-value codes) for the group that owns an\nevent. Credits are group-scoped and usable across every event in the\ngroup; they are managed under the event so the event-bound integration\ncan reach them. Returns 422 if the event is not part of a group.\n"}],"servers":[{"url":"https://www.movemint.cc","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Pass the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 authentication using the Authorization Code or Client\nCredentials grant flow.\n","flows":{"authorizationCode":{"authorizationUrl":"https://www.movemint.cc/oauth/authorize","tokenUrl":"https://www.movemint.cc/oauth/token","refreshUrl":"https://www.movemint.cc/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"https://www.movemint.cc/oauth/token","scopes":{}}}}},"parameters":{"EventHandle":{"name":"handle","in":"path","required":true,"description":"The unique handle (slug) of the event","schema":{"type":"string"}},"ResourceId":{"name":"id","in":"path","required":true,"description":"The ID of the resource","schema":{"type":"integer","format":"int64"}}},"responses":{"Unauthorized":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"Forbidden":{"description":"Forbidden - user is not an admin of this event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"EventNotFound":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code"},"error_description":{"type":"string","description":"Human-readable description of the error"}}},"Error":{"type":"object","description":"A generic error response","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"}}},"ValidationError":{"type":"object","description":"A validation error response with a list of error messages","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of validation error messages"}}}}},"paths":{"/api/v1/events/{handle}/credits/{id}":{"delete":{"tags":["Credits"],"summary":"Delete a credit","description":"Deletes a credit. Returns 422 if the credit has already been used\n(it has usage records representing money applied to participants).\n","operationId":"deleteEventCredit","parameters":[{"$ref":"#/components/parameters/EventHandle"},{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/EventNotFound"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
````

## Update a credit

> Updates credit metadata. \`amount\_cents\`, when supplied, is treated as\
> the new face value: the same delta is applied to the remaining\
> balance so the ledger stays reconciled. A decrease below the amount\
> already spent is rejected with 422.<br>

````json
{"openapi":"3.1.0","info":{"title":"Movemint API","version":"1.0"},"tags":[{"name":"Credits","description":"Manage group credits (stored-value codes) for the group that owns an\nevent. Credits are group-scoped and usable across every event in the\ngroup; they are managed under the event so the event-bound integration\ncan reach them. Returns 422 if the event is not part of a group.\n"}],"servers":[{"url":"https://www.movemint.cc","description":"Production"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Pass the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n"},"oauth2":{"type":"oauth2","description":"OAuth 2.0 authentication using the Authorization Code or Client\nCredentials grant flow.\n","flows":{"authorizationCode":{"authorizationUrl":"https://www.movemint.cc/oauth/authorize","tokenUrl":"https://www.movemint.cc/oauth/token","refreshUrl":"https://www.movemint.cc/oauth/token","scopes":{}},"clientCredentials":{"tokenUrl":"https://www.movemint.cc/oauth/token","scopes":{}}}}},"parameters":{"EventHandle":{"name":"handle","in":"path","required":true,"description":"The unique handle (slug) of the event","schema":{"type":"string"}},"ResourceId":{"name":"id","in":"path","required":true,"description":"The ID of the resource","schema":{"type":"integer","format":"int64"}}},"schemas":{"UpdateCreditRequest":{"allOf":[{"$ref":"#/components/schemas/CreditWritableFields"},{"type":"object","properties":{"amount_cents":{"type":"integer","minimum":1,"description":"New face value; the same delta is applied to the remaining balance."}}}]},"CreditWritableFields":{"type":"object","properties":{"code":{"type":"string"},"currency":{"type":"string","enum":["USD","CAD","AUD","DKK","NOK","MXN","GBP","EUR"]},"expiration_date":{"type":"string","format":"date-time"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"applies_to_merchandise":{"type":"boolean"},"email_credit_to_participant":{"type":"boolean","description":"Defaults to true; set false to suppress the recipient email on create."}}},"Credit":{"type":"object","required":["id","code","amount_cents","amount_dollars","remaining_balance_cents","remaining_balance_dollars","currency","expiration_date","first_name","last_name","email","applies_to_merchandise"],"properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"amount_cents":{"type":"integer"},"amount_dollars":{"type":"number"},"remaining_balance_cents":{"type":"integer"},"remaining_balance_dollars":{"type":"number"},"currency":{"type":"string"},"expiration_date":{"type":"string","format":"date-time","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"applies_to_merchandise":{"type":"boolean"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code"},"error_description":{"type":"string","description":"Human-readable description of the error"}}},"Error":{"type":"object","description":"A generic error response","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"}}},"ValidationError":{"type":"object","description":"A validation error response with a list of error messages","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"string"},"description":"List of validation error messages"}}}},"responses":{"Unauthorized":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"Forbidden":{"description":"Forbidden - user is not an admin of this event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"EventNotFound":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/events/{handle}/credits/{id}":{"patch":{"tags":["Credits"],"summary":"Update a credit","description":"Updates credit metadata. `amount_cents`, when supplied, is treated as\nthe new face value: the same delta is applied to the remaining\nbalance so the ledger stays reconciled. A decrease below the amount\nalready spent is rejected with 422.\n","operationId":"updateEventCredit","parameters":[{"$ref":"#/components/parameters/EventHandle"},{"$ref":"#/components/parameters/ResourceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCreditRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["credit"],"properties":{"credit":{"$ref":"#/components/schemas/Credit"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/EventNotFound"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
````
