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

# Create a new credit grant

> Create a new credit grant



## OpenAPI

````yaml billing.2024-07-30.product.live POST /credits
openapi: 3.0.0
info:
  title: Billing
  description: Manage Billing
  version: 0.0.1
servers:
  - url: https://dev.seqhq.io
    description: E2E
  - url: https://dev.seqhq.io
    description: DEV
  - url: https://sandbox.sequencehq.com
    description: SANDBOX
  - url: https://eu.sequencehq.com
    description: PRODUCTION
security: []
tags:
  - name: Billing Schedules
  - name: Prices
  - name: Credits
  - name: Discounts
paths:
  /credits:
    servers: []
    parameters: []
    post:
      tags:
        - Credits
      summary: Create a new credit grant
      description: Create a new credit grant
      operationId: postCredits
      parameters:
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: sequence-version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCreditGrantRequest'
              example:
                sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
                customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                name: Onboarding Credits
                creditUnitType: CURRENCY
                currency: GBP
                metricId: f092246c-6b90-4106-bcca-304ccf06bf45
                amount: 10
                costOfCredit: 10
                effectiveDate: '2023-01-01'
                expiryDate: '2023-01-31'
                createInvoice: true
            examples:
              CreateCreditGrantRequest:
                summary: ''
                value:
                  sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
                  customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                  name: Onboarding Credits
                  creditUnitType: CURRENCY
                  currency: GBP
                  metricId: f092246c-6b90-4106-bcca-304ccf06bf45
                  amount: 10
                  costOfCredit: 10
                  effectiveDate: '2023-01-01'
                  expiryDate: '2023-01-31'
                  createInvoice: true
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditGrantResponse2'
                example:
                  id: 746fc7f2-8098-4fe7-953c-7d51c580a126
                  sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
                  customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                  name: Onboarding Credits
                  creditUnitType: CURRENCY
                  currency: GBP
                  metricId: f092246c-6b90-4106-bcca-304ccf06bf45
                  amount: 10
                  costOfCredit: 10
                  effectiveDate: '2023-01-01'
                  expiryDate: '2023-01-31'
                  createdAt: '2022-10-07T14:12:08.826121Z'
                  integrationIds:
                    - service: Xero
                      id: 74ed2615-4730-49ab-9445-74f31723a206
                      isPending: false
              examples:
                CreditGrantResponse2:
                  summary: ''
                  value:
                    id: 746fc7f2-8098-4fe7-953c-7d51c580a126
                    sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
                    customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
                    name: Onboarding Credits
                    creditUnitType: CURRENCY
                    currency: GBP
                    metricId: f092246c-6b90-4106-bcca-304ccf06bf45
                    amount: 10
                    costOfCredit: 10
                    effectiveDate: '2023-01-01'
                    expiryDate: '2023-01-31'
                    createdAt: '2022-10-07T14:12:08.826121Z'
                    integrationIds:
                      - service: Xero
                        id: 74ed2615-4730-49ab-9445-74f31723a206
                        isPending: false
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    CreateCreditGrantRequest:
      required:
        - amount
        - creditUnitType
        - currency
        - customerId
        - name
        - sequenceAccountId
      type: object
      example:
        sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
        customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        name: Onboarding Credits
        creditUnitType: CURRENCY
        currency: GBP
        metricId: f092246c-6b90-4106-bcca-304ccf06bf45
        amount: 10
        costOfCredit: 10
        effectiveDate: '2023-01-01'
        expiryDate: '2023-01-31'
        createInvoice: true
      properties:
        sequenceAccountId:
          type: string
          description: Sequence account ID
          example: dce9ae85-d8d0-42b4-bcad-f221a64363c6
        customerId:
          type: string
          description: The ID of the customer credit is granted to
          example: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        name:
          type: string
          description: Name of the credit grant
          example: Onboarding Credits
        creditUnitType:
          $ref: '#/components/schemas/CreditUnitType'
          description: Type of the unit of credit
        currency:
          $ref: '#/components/schemas/Currency'
          description: Currency of cash credit (if creditUnitType is CURRENCY)
        metricId:
          type: string
          description: Metric ID (if creditUnitType is METRIC)
          example: f092246c-6b90-4106-bcca-304ccf06bf45
        amount:
          type: number
          description: Amount of units granted
          example: 10
        costOfCredit:
          type: number
          description: Cost of credit grant, to be invoiced to the customer
          example: 10
        effectiveDate:
          type: string
          description: First day credit grant can be consumed
          example: '2023-01-01'
        expiryDate:
          type: string
          description: Last day credit grant can be consumed
          example: '2023-01-31'
        createInvoice:
          type: boolean
          description: >-
            If true we will create an invoice to charge the customer for this
            grant
          example: true
    CreditGrantResponse2:
      required:
        - amount
        - createdAt
        - creditUnitType
        - customerId
        - id
        - integrationIds
        - name
        - sequenceAccountId
      type: object
      example:
        id: 746fc7f2-8098-4fe7-953c-7d51c580a126
        sequenceAccountId: dce9ae85-d8d0-42b4-bcad-f221a64363c6
        customerId: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        name: Onboarding Credits
        creditUnitType: CURRENCY
        currency: GBP
        metricId: f092246c-6b90-4106-bcca-304ccf06bf45
        amount: 10
        costOfCredit: 10
        effectiveDate: '2023-01-01'
        expiryDate: '2023-01-31'
        createdAt: '2022-10-07T14:12:08.826121Z'
        integrationIds:
          - service: Xero
            id: 74ed2615-4730-49ab-9445-74f31723a206
            isPending: false
      properties:
        id:
          type: string
          description: Credit grant ID
          example: 746fc7f2-8098-4fe7-953c-7d51c580a126
        sequenceAccountId:
          type: string
          description: Sequence account ID
          example: dce9ae85-d8d0-42b4-bcad-f221a64363c6
        customerId:
          type: string
          description: The ID of the customer credit is granted to
          example: 61b083e0-1faa-47ca-9aeb-6205da8f6c47
        name:
          type: string
          description: Name of the credit grant
          example: Onboarding Credits
        creditUnitType:
          $ref: '#/components/schemas/CreditUnitType'
          description: Type of the unit of credit
        currency:
          $ref: '#/components/schemas/Currency'
          description: Currency of cash credit (if creditUnitType is CURRENCY)
        metricId:
          type: string
          description: Metric ID (if creditUnitType is METRIC)
          example: f092246c-6b90-4106-bcca-304ccf06bf45
        amount:
          type: number
          description: Amount of units granted
          example: 10
        costOfCredit:
          type: number
          description: Cost of credit grant, to be invoiced to the customer
          example: 10
        effectiveDate:
          type: string
          description: First day credit grant can be consumed
          example: '2023-01-01'
        expiryDate:
          type: string
          description: Last day credit grant can be consumed
          example: '2023-01-31'
        createdAt:
          type: string
          description: The creation timestamp
          example: '2022-10-07T14:12:08.826121Z'
        integrationIds:
          type: array
          description: IDs in external integrations
          example:
            - service: Xero
              id: 74ed2615-4730-49ab-9445-74f31723a206
              isPending: false
          items:
            $ref: '#/components/schemas/IntegrationId'
    CreditUnitType:
      type: string
      example: CURRENCY
      enum:
        - CURRENCY
        - METRIC
    Currency:
      type: string
      example: GBP
      enum:
        - AED
        - ARS
        - AUD
        - BRL
        - BGN
        - CAD
        - CHF
        - CLP
        - CNY
        - COP
        - CZK
        - DKK
        - EGP
        - EUR
        - GBP
        - HKD
        - ILS
        - INR
        - ISK
        - JPY
        - KRW
        - MXN
        - NOK
        - NZD
        - PLN
        - SAR
        - SEK
        - SGD
        - THB
        - USD
        - UYU
        - ZAR
    IntegrationId:
      required:
        - id
        - isPending
        - service
      type: object
      example:
        service: Xero
        id: '123'
        isPending: false
      properties:
        service:
          $ref: '#/components/schemas/IntegrationService'
        id:
          type: string
          example: '123'
        isPending:
          type: boolean
          example: false
    IntegrationService:
      type: string
      example: Xero
      enum:
        - Amazon_Redshift
        - GoCardless
        - Google_BigQuery
        - Google_Sheets
        - HubSpot
        - NetSuite
        - QuickBooks_Online
        - Salesforce
        - Slack
        - Snowflake
        - Stripe
        - Xero
        - Avalara
        - Anrok
        - Attio
        - Numeral
        - Rillet
        - Sphere

````