> ## Documentation Index
> Fetch the complete documentation index at: https://docs.equalsmoney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create spending limit for a card

> 
 Creates a spending limit for a given card.
 A spending limit defines the maximum amount that can be spent during a chosen time period. For example, £10 a day.
    



## OpenAPI

````yaml /autogenerated/openapi/cards.openapi.json post /cards/{cardId}/spending-limits
openapi: 3.1.0
info:
  title: Cards API
  version: 2.0.0
  description: Version 2
  license:
    name: UNLICENSED
    url: https://docs.equalsmoney.com
servers:
  - url: https://api.equalsmoney.com/v2
    description: Production
  - url: https://api-sandbox.equalsmoney.com/v2
    description: Sandbox
security: []
paths:
  /cards/{cardId}/spending-limits:
    post:
      tags:
        - Spending limits
      summary: Create spending limit for a card
      description: |2-

         Creates a spending limit for a given card.
         A spending limit defines the maximum amount that can be spent during a chosen time period. For example, £10 a day.
            
      operationId: createSpendingLimit
      parameters:
        - name: cardId
          in: path
          required: true
          schema:
            description: The ID of the card to work with.
            type:
              - string
            format: uuid
            maxLength: 36
            example: e9293471-5eb3-4dbc-916c-dbaf9e2deefd
        - name: accountId
          in: query
          schema:
            description: The ID of the account to work with.
            type:
              - string
            example: F50091
          required: true
        - name: budgetId
          in: query
          schema:
            description: The ID of the budget to work with.
            type:
              - string
            format: uuid
            maxLength: 36
            example: 775596ae-2624-40af-a9dc-9756110a4a03
          required: true
        - name: personId
          in: query
          schema:
            description: The ID of the person to work with.
            type:
              - string
            format: uuid
            maxLength: 36
            example: 775596ae-2624-40af-a9dc-9756110a4a04
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type:
                - object
              properties:
                amount:
                  type:
                    - number
                  description: amount of limit to be set
                  example: 100.5
                currencyCode:
                  type:
                    - string
                  example: GBP
                active:
                  type:
                    - boolean
                  description: Indicates whether the limit is active on Marqeta.
                usageLimit:
                  default: -1
                  type:
                    - integer
                  minimum: -1
                  description: >-
                    Number of transactions allowed in a given time window. `-1`
                    means the limit is disabled. `0` means no transactions can
                    be made.
                  example: 15
                limitTurnedOff:
                  type:
                    - boolean
                  description: Defines if the limit was turned off by the user
                limitWindow:
                  type:
                    - string
                  enum:
                    - DAY
                    - WEEK
                    - MONTH
                    - LIFETIME
                  description: Defines the time period to which the limit apply
              required:
                - amount
                - limitWindow
              example:
                amount: 100.5
                currencyCode: GBP
                active: true
                usageLimit: 15
                limitTurnedOff: true
                limitWindow: DAY
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  id:
                    type:
                      - string
                    maxLength: 36
                    format: uuid
                    description: The ID of the limit to work with.
                  amount:
                    type:
                      - number
                    description: amount of limit to be set
                    example: 100.5
                  currencyCode:
                    type:
                      - string
                    example: GBP
                  active:
                    type:
                      - boolean
                    description: Indicates whether the limit is active on Marqeta.
                  usageLimit:
                    default: -1
                    type:
                      - integer
                    minimum: -1
                    description: >-
                      Number of transactions allowed in a given time window.
                      `-1` means the limit is disabled. `0` means no
                      transactions can be made.
                    example: 15
                  limitTurnedOff:
                    type:
                      - boolean
                    description: Defines if the limit was turned off by the user
                  limitWindow:
                    type:
                      - string
                    enum:
                      - DAY
                      - WEEK
                      - MONTH
                      - LIFETIME
                    description: Defines the time period to which the limit apply
                  available:
                    type:
                      - object
                    properties:
                      uses:
                        type:
                          - number
                        description: number of  uses
                      amount:
                        type:
                          - number
                        description: amount of limit to be set
                        example: 100.5
                      daysRemaining:
                        type:
                          - number
                        description: number of days remaining in the limit window.
                        example: 1
                required:
                  - amount
                  - limitWindow
                example:
                  id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
                  amount: 100.5
                  currencyCode: GBP
                  active: true
                  usageLimit: 15
                  limitTurnedOff: true
                  limitWindow: DAY
                  available:
                    uses: 0
                    amount: 100.5
                    daysRemaining: 1
      security:
        - CommonAuth:
            - card-limits:create:own
            - card-limits:create:any
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.equalsmoney.com/v2/cards/{cardId}/spending-limits?accountId={{accountId}}&budgetId={{budgetId}}' \
              --header 'Authorization: <api-key>' \
              --header 'Content-Type: application/json' \
              --data '
            {
              "amount": 100.5,
              "currencyCode": "GBP",
              "active": true,
              "usageLimit": 15,
              "limitTurnedOff": true,
              "limitWindow": "DAY"
            }
            '
components:
  securitySchemes:
    CommonAuth:
      type: apiKey
      in: header
      name: Authorization

````