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

# Issue Gift Card

> Begin a random-amount gift card issuance.

Persists the `Charge` and pending `IssuedGiftCard` synchronously (so the
row shows up in the issued list immediately with status=PENDING) and
returns the Rainforest payin config the client uses to embed the payment
terminal. The `payin.processing` webhook then activates the card.



## OpenAPI

````yaml post /billing/gift-cards/issue
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /billing/gift-cards/issue:
    post:
      tags:
        - Gift Cards
      summary: Issue Gift Card
      description: |-
        Begin a random-amount gift card issuance.

        Persists the `Charge` and pending `IssuedGiftCard` synchronously (so the
        row shows up in the issued list immediately with status=PENDING) and
        returns the Rainforest payin config the client uses to embed the payment
        terminal. The `payin.processing` webhook then activates the card.
      operationId: issue_gift_card_billing_gift_cards_issue_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IssueGiftCardRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinComponentSetupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    IssueGiftCardRequest:
      properties:
        amount:
          type: integer
          exclusiveMinimum: 0
          title: Amount
          description: Gift card value in cents.
        patientId:
          type: string
          title: Patientid
          description: >-
            Purchasing patient. Required because the charge pipeline is
            patient-scoped.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: Required when the tenant has the LOCATIONS module enabled.
        recipientPatientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Recipientpatientid
          description: Recipient patient. When omitted, the card belongs to the purchaser.
        recipientNote:
          anyOf:
            - type: string
            - type: 'null'
          title: Recipientnote
          description: >-
            Personal message from the sender included in the recipient
            notification.
        scheduledSendDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduledsenddate
          description: >-
            When set, the recipient notification is deferred until this time
            instead of sending immediately on activation.
        suppressRecipientNotification:
          type: boolean
          title: Suppressrecipientnotification
          description: >-
            When True, the recipient is not auto-notified (neither on activation
            nor via the scheduled-send heartbeat). Only meaningful when a
            recipient is set; staff can still send manually later.
          default: false
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Optional provider-entered code. Trimmed and stored uppercase when
            supplied.
      type: object
      required:
        - amount
        - patientId
      title: IssueGiftCardRequest
      description: >-
        Staff-initiated, random-amount gift card issuance from
        /settings/gift-cards.


        Runs through the regular checkout pipeline: a synthetic archived

        GiftCardItem carries the requested denomination, the Charge and pending

        IssuedGiftCard are persisted synchronously so the row appears in the

        issued list immediately, and the rainforest webhook activates the card

        once the payin lands.
    PayinComponentSetupResponse:
      properties:
        sessionKey:
          type: string
          title: Sessionkey
        payinConfigId:
          type: string
          title: Payinconfigid
        paymentMethods:
          items:
            $ref: '#/components/schemas/PaymentMethodSummary'
          type: array
          title: Paymentmethods
          default: []
        sandbox:
          type: boolean
          title: Sandbox
      type: object
      required:
        - sessionKey
        - payinConfigId
        - sandbox
      title: PayinComponentSetupResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaymentMethodSummary:
      properties:
        id:
          type: string
          title: Id
        patientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientid
        rainforestPaymentMethodId:
          anyOf:
            - type: string
            - type: 'null'
          title: Rainforestpaymentmethodid
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        last4:
          anyOf:
            - type: string
            - type: 'null'
          title: Last4
        expMonth:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expmonth
        expYear:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expyear
        accountHolderType:
          anyOf:
            - type: string
            - type: 'null'
          title: Accountholdertype
        accountNumberLast4:
          anyOf:
            - type: integer
            - type: 'null'
          title: Accountnumberlast4
        bankName:
          anyOf:
            - type: string
            - type: 'null'
          title: Bankname
        routingNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Routingnumber
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        type:
          anyOf:
            - $ref: '#/components/schemas/PaymentMethodType'
            - type: 'null'
        cardType:
          anyOf:
            - $ref: '#/components/schemas/PaymentCardType'
            - type: 'null'
        isDefault:
          type: boolean
          title: Isdefault
          default: false
        isArchived:
          type: boolean
          title: Isarchived
          default: false
        availableMerchantIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Availablemerchantids
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - patientId
        - rainforestPaymentMethodId
        - brand
        - last4
        - expMonth
        - expYear
        - accountHolderType
        - accountNumberLast4
        - bankName
        - routingNumber
        - description
        - type
      title: PaymentMethodSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PaymentMethodType:
      type: string
      enum:
        - CARD
        - ACH
        - APPLE_PAY
      title: PaymentMethodType
    PaymentCardType:
      type: string
      enum:
        - CREDIT
        - DEBIT
        - PREPAID
      title: PaymentCardType

````