> For the complete documentation index, see [llms.txt](https://docs.tebex.io/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/developers/headless-api/guides/creator-codes/apply-creator-code.md).

# Apply Creator Code

See [Creator Codes](https://docs.tebex.io/creators/tebex-control-panel/engagement/creator-codes) in our Creators documentation for an in-depth guide on Creator Codes. These are used to attribute purchases to influencers. These codes can optionally apply a customer discount when used.

## Apply a creator code

> Applies a creator code to a basket.

```json
{"openapi":"3.1.0","info":{"title":"Tebex Headless API","version":"2.0.0"},"tags":[{"name":"Headless","description":"Main API scoped to public token"}],"servers":[{"url":"https://headless.tebex.io/api/accounts/{token}","description":"Main API scoped to public token","variables":{"token":{"default":"","description":"The store's public token"}}}],"paths":{"/baskets/{basketIdent}/creator-codes":{"post":{"tags":["Headless"],"operationId":"applyCreatorCode","summary":"Apply a creator code","parameters":[{"$ref":"#/components/parameters/basketIdent"}],"description":"Applies a creator code to a basket.","requestBody":{"description":"Provide a `creator_code` to apply to the basket.","content":{"application/json":{"schema":{"type":"object","properties":{"creator_code":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response returns a success object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"422":{"description":"The provided request is invalid. The error response will include detail as to which parameter failed validation."}}}}},"components":{"parameters":{"basketIdent":{"name":"basketIdent","in":"path","required":true,"schema":{"type":"string"},"description":"The basket identifier."}}}}
```
