# Credits

## GET /v2.0/admin/members/{id}/credits

> Returns all credits for one customer. API key is used to match the customer to your account for security reasons. Ensure that the customer ID is included in the request path.\<br>\<br>\
> &#x20;   Pagination is supported by passing limit and lastCreditEntry values as query parameters. You will get a lastCreditEntry value in the response of the previous request, which can be used for the next. Ensure that the lastCreditEntry value passed to the server is  encoded.

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members/{id}/credits":{"get":{"operationId":"CreditsController_findOne","summary":"","description":"Returns all credits for one customer. API key is used to match the customer to your account for security reasons. Ensure that the customer ID is included in the request path.<br><br>\n    Pagination is supported by passing limit and lastCreditEntry values as query parameters. You will get a lastCreditEntry value in the response of the previous request, which can be used for the next. Ensure that the lastCreditEntry value passed to the server is  encoded.","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"The customer ID number.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"The number of credits to return (for pagination).","schema":{"type":"number"}},{"name":"lastCreditEntry","required":false,"in":"query","description":"The last credit entry from the previous request.","schema":{"type":"string"}}],"responses":{"200":{"description":"Returned upon successful direct action to our database. Action is immediate.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Credits"]}}},"components":{"schemas":{"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```

## POST /v2.0/admin/members/{id}/credits

> This method forwards the credit creation request to our backend. Returns the success status of the request against backend service. Like the other endpoints that make requests against our backend, the changes may not take effect immediately.

```json
{"openapi":"3.0.0","info":{"title":"Inveterate Public API","version":"v2.0"},"paths":{"/v2.0/admin/members/{id}/credits":{"post":{"operationId":"CreditsController_create","summary":"","description":"This method forwards the credit creation request to our backend. Returns the success status of the request against backend service. Like the other endpoints that make requests against our backend, the changes may not take effect immediately.","parameters":[{"name":"X-Inveterate-Api-Key","in":"header","description":"Your private Inveterate API key.","required":true,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","description":"The customer ID number.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDto"}}}},"responses":{"201":{"description":"Returned upon successful request made to our backend. Requests that return this code may take a small amount of time after successful API return to fully update.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"400":{"description":"Returned upon a malformed request. Check your API key, URL parameters, and body parameters when this error is returned. Generally, if you see this error, that also means NO action was taken on our backend.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}},"500":{"description":"Returned for all other errors. Generally these come from our backend. Some multipart functions may execute somewhat and then fail, causing some data to be updated.","schema":{"allOf":[{"$ref":"#/components/schemas/ResponseBodyDto"}]},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseBodyDto"}}}}},"tags":["Admin - Credits"]}}},"components":{"schemas":{"CreditDto":{"type":"object","properties":{"amount":{"type":"number","description":"The amount of credits to be added to or removed from the customer's account. It can't be zero"},"note":{"type":"string","description":"Optional note to be associated with this credit transaction"},"force":{"type":"boolean","description":"When force: true is included with a negative credit amount, this will disable any active credit redemption discount codes when necessary."}},"required":["amount"]},"ResponseBodyDto":{"type":"object","properties":{"message":{"type":"string","description":"The message associated with the response. Generally, the message only confirms the requested action. In the case of errors, the message will give insight into the source of the error."},"data":{"type":"object","description":"The data associated with the response. Data is only returned from errors if the error originates from our backend to give further insight into the nature of the error."}},"required":["message","data"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.inveterate.com/dev/api-reference-docs/public-api-2.0-reference/admin/members/credits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
