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

# Authorize a Credit Card

> Places a hold on a credit card without moving any money. The authorized amount is reserved
against the cardholder's available credit, and no funds reach the merchant until the
authorization is captured via the capture endpoint.

Use this when the final amount is not yet known or goods have not shipped. Capture the
authorization once you are ready to collect. An authorization that is never captured is
released by the card issuer on its own schedule, so capture promptly — typically within 24
hours — to avoid the hold expiring.

The `transaction_number` in the response is your handle on the authorization: pass it as
`data.transaction_id` to the capture endpoint to collect, or to the void endpoint to release.

**Releasing the hold.** If the sale falls through, release the held funds instead of
capturing by calling the void endpoint — `PATCH /api/transaction/void`:

```json
{ "data": { "sid": 1234567, "transaction_type": "CC", "transaction_id": "1234567890" } }
```

`data.transaction_type` must be `CC`. Voiding is gated by its own separate API key
permission, not by this one, so make sure your key carries it if you need to release holds.

**Two ways to supply the card, pick one.** Either send a `token` from the tokenize-card
endpoint, or send the raw card fields — `card_number`, `expiration_date`, `cardholder_name` and
`billing_address.zip`, all four of which are required only when no `token` is present, and
ignored when one is. Sending raw card data requires PCI compliance (an AoC on file with Dime
Payments); a token does not, because no card number is transmitted.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/transaction/authorize
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Chargeback management
    description: ''
  - name: Document management
    description: ''
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Held funds
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Subscription Plans management
    description: >-

      Merchant-facing API for subscription plans (recurring offerings customers

      subscribe to). The merchant is identified by `data.sid`; the token must
      carry

      the matching `subscription-plan:*` ability. Mirrors the recurring-payment
      and

      invoice API controllers.
  - name: Subscriptions management
    description: >-

      Merchant-facing API for individual customer subscriptions (enrollments in
      a

      plan). The merchant is identified by `data.sid`; the token must carry the

      matching `subscription:*` ability. Lifecycle transitions delegate to the

      {@see \App\Actions\Subscription} action classes so the matching
      `SUBSCRIPTION_*`

      webhook always fires. Mirrors the recurring-payment and subscription-plan
      API

      controllers.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/transaction/authorize:
    post:
      tags:
        - Transaction management
      summary: Authorize a Credit Card
      description: >-
        Places a hold on a credit card without moving any money. The authorized
        amount is reserved

        against the cardholder's available credit, and no funds reach the
        merchant until the

        authorization is captured via the capture endpoint.


        Use this when the final amount is not yet known or goods have not
        shipped. Capture the

        authorization once you are ready to collect. An authorization that is
        never captured is

        released by the card issuer on its own schedule, so capture promptly —
        typically within 24

        hours — to avoid the hold expiring.


        The `transaction_number` in the response is your handle on the
        authorization: pass it as

        `data.transaction_id` to the capture endpoint to collect, or to the void
        endpoint to release.


        **Releasing the hold.** If the sale falls through, release the held
        funds instead of

        capturing by calling the void endpoint — `PATCH /api/transaction/void`:


        ```json

        { "data": { "sid": 1234567, "transaction_type": "CC", "transaction_id":
        "1234567890" } }

        ```


        `data.transaction_type` must be `CC`. Voiding is gated by its own
        separate API key

        permission, not by this one, so make sure your key carries it if you
        need to release holds.


        **Two ways to supply the card, pick one.** Either send a `token` from
        the tokenize-card

        endpoint, or send the raw card fields — `card_number`,
        `expiration_date`, `cardholder_name` and

        `billing_address.zip`, all four of which are required only when no
        `token` is present, and

        ignored when one is. Sending raw card data requires PCI compliance (an
        AoC on file with Dime

        Payments); a token does not, because no card number is transmitted.
      operationId: authorizeACreditCard
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example: []
                  properties:
                    amount:
                      type: number
                      description: The amount to authorize. Must be greater than 0.
                      example: 100.5
                    sid:
                      type: number
                      description: ID of merchant account processing the authorization.
                      example: 1234567
                    phone:
                      type: string
                      description: >-
                        The customer's phone number in e164 format. Creates or
                        matches a customer record.
                      example: '+17701234567'
                    customer_uuid:
                      type: string
                      description: >-
                        The UUID of an existing customer record, used instead of
                        data.phone.
                      example: 60dac128-28da-41ae-8632-aee299de13fd
                    email:
                      type: string
                      description: 'The email of a customer. Max: 50.'
                      example: john@example.com
                      nullable: true
                    memo:
                      type: string
                      description: >-
                        A string containing memo related information, such as an
                        invoice ID. Max: 120.
                      example: order 1234
                      nullable: true
                    token:
                      type: string
                      description: >-
                        A token from the tokenize-card endpoint, standing in for
                        a stored card. Required when the raw card fields are not
                        sent.
                      example: abc123def456
                    cardholder_name:
                      type: string
                      description: >-
                        The name of the cardholder. Required when no data.token
                        is sent. Max: 50.
                      example: John Doe
                    card_number:
                      type: number
                      description: >-
                        The credit card number. Required when no data.token is
                        sent; ignored when one is. Min: 15. Max: 16.
                      example: 1231231231231200
                    expiration_date:
                      type: string
                      description: >-
                        Expiration date of the card, in the form mm/YYYY.
                        Required when no data.token is sent; ignored when one
                        is.
                      example: 01/2030
                    cvv:
                      type: number
                      description: >-
                        The card's CVV. Optional even when sending raw card
                        data, though issuers may decline more often without it.
                        Min: 3, Max: 4.
                      example: 123
                      nullable: true
                    billing_address:
                      type: object
                      description: ''
                      example: []
                      properties:
                        first_name:
                          type: string
                          description: 'The first name. Max: 50.'
                          example: John
                          nullable: true
                        last_name:
                          type: string
                          description: 'The last name. Max: 50.'
                          example: Doe
                          nullable: true
                        addr1:
                          type: string
                          description: 'The cardholder''s address line 1. Max: 55.'
                          example: 1234 Main St
                          nullable: true
                        addr2:
                          type: string
                          description: 'The cardholder''s address line 2. Max: 55.'
                          example: Suite 100
                          nullable: true
                        city:
                          type: string
                          description: 'The cardholder''s city. Max: 55.'
                          example: Atlanta
                          nullable: true
                        state:
                          type: string
                          description: >-
                            Two-character state code; a full name such as
                            "Virginia" is accepted and stored as its code.
                          example: NY
                          nullable: true
                        zip:
                          type: string
                          description: >-
                            The cardholder's ZIP, or Canadian postal code (A1A
                            1A1). Required when no data.token is sent.
                          example: '10001'
                    shipping_address:
                      type: object
                      description: ''
                      example: []
                      properties:
                        addr1:
                          type: string
                          description: 'optional The first address line. Max: 55.'
                          example: 123 A Street
                          nullable: true
                        addr2:
                          type: string
                          description: 'optional The second address line. Max: 50.'
                          example: Suite 123
                          nullable: true
                        city:
                          type: string
                          description: 'optional The city. Max: 50.'
                          example: Alpharetta
                        state:
                          type: string
                          description: >-
                            optional Two-character state code; a full name such
                            as "Virginia" is accepted and stored as its code.
                          example: GA
                        zip:
                          type: string
                          description: >-
                            optional A 5-digit ZIP or a Canadian postal code
                            (A1A 1A1).
                          example: '12345'
                  required:
                    - amount
                    - sid
      responses:
        '200':
          description: Successful Authorization
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    transaction_type: Credit Card
                    transaction_status: Pending
                    transaction_status_description: Pending
                    transaction_number: '1234567890'
                    transaction_date: '2020-01-01'
                    fund_date: ''
                    settle_date: ''
                    amount: '100.50'
                    description: a memo concerning this transaction
                    status_code: '00'
                    status_text: APPROVAL
                    email: email@email.com
                    phone: '+17701234567'
                    customer_uuid: 66f1c230-1337-5g59-b43c-1bcb83adfaaa
                    multi_use_token: abcdefg123456790
                    pending: true
                    transaction_info_id: ''
                    parent_transaction_info_id: ''
                    billing_address:
                      first_name: John
                      last_name: Doe
                      addr1: 123 Main St
                      addr2: Suite 100
                      city: New York
                      state: NY
                      zip: '10001'
                    shipping_address:
                      addr1: 12 Street Ave
                      addr2: Suite 123
                      city: Boulder
                      state: CO
                      zip: '80302'
                properties:
                  data:
                    type: object
                    properties:
                      transaction_type:
                        type: string
                        example: Credit Card
                        description: ACH or Credit Card.
                      transaction_status:
                        type: string
                        example: Pending
                        description: The status of the authorization.
                      transaction_status_description:
                        type: string
                        example: Pending
                        description: The description of the transaction status.
                      transaction_number:
                        type: string
                        example: '1234567890'
                        description: >-
                          The identifier to pass to the capture and void
                          endpoints as data.transaction_id.
                      transaction_date:
                        type: string
                        example: '2020-01-01'
                        description: The date the authorization was processed.
                      fund_date:
                        type: string
                        example: ''
                        description: Not applicable until the authorization is captured.
                      settle_date:
                        type: string
                        example: ''
                        description: Not applicable until the authorization is captured.
                      amount:
                        type: string
                        example: '100.50'
                        description: The amount authorized, in USD.
                      description:
                        type: string
                        example: a memo concerning this transaction
                        description: The original memo field.
                      status_code:
                        type: string
                        example: '00'
                        description: Response code from processor.
                      status_text:
                        type: string
                        example: APPROVAL
                        description: Response text from processor.
                      email:
                        type: string
                        example: email@email.com
                        description: >-
                          The email address of a customer record, if one was
                          created/provided.
                      phone:
                        type: string
                        example: '+17701234567'
                        description: >-
                          The phone number of a customer record, if one was
                          created/provided.
                      customer_uuid:
                        type: string
                        example: 66f1c230-1337-5g59-b43c-1bcb83adfaaa
                        description: >-
                          The unique UUID of the merchant's customer, only if a
                          customer record was created.
                      multi_use_token:
                        type: string
                        example: abcdefg123456790
                        description: A token used to charge against a stored credit card.
                      pending:
                        type: boolean
                        example: true
                        description: The pending status of the authorization.
                      transaction_info_id:
                        type: string
                        example: ''
                        description: >-
                          The transaction's info id that can be used in requests
                          to other API endpoints to look up a specific
                          transaction.
                      parent_transaction_info_id:
                        type: string
                        example: ''
                        description: >-
                          The transaction's parent's info id that can be used in
                          requests to other API endpoints to look up a specific
                          transaction.
                      billing_address:
                        type: object
                        properties:
                          first_name:
                            type: string
                            example: John
                            description: The first name field.
                          last_name:
                            type: string
                            example: Doe
                            description: The last name field.
                          addr1:
                            type: string
                            example: 123 Main St
                            description: The first address line.
                          addr2:
                            type: string
                            example: Suite 100
                            description: The second address line.
                          city:
                            type: string
                            example: New York
                            description: The city field.
                          state:
                            type: string
                            example: NY
                            description: The state field.
                          zip:
                            type: string
                            example: '10001'
                            description: The zip field.
                      shipping_address:
                        type: object
                        properties:
                          addr1:
                            type: string
                            example: 12 Street Ave
                            description: The first address line.
                          addr2:
                            type: string
                            example: Suite 123
                            description: The second address line.
                          city:
                            type: string
                            example: Boulder
                            description: The city field.
                          state:
                            type: string
                            example: CO
                            description: The state field.
                          zip:
                            type: string
                            example: '80302'
                            description: The zip field.
        '400':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: Failed validation
                    type: object
                    example:
                      errors:
                        data.amount:
                          - The data.amount field is required.
                    properties:
                      errors:
                        type: object
                        properties:
                          data.amount:
                            type: array
                            example:
                              - The data.amount field is required.
                            items:
                              type: string
                  - description: Processor declined the authorization
                    type: object
                    example:
                      data:
                        transaction_type: Credit Card
                        transaction_status: ''
                        transaction_status_description: ''
                        transaction_number: ''
                        amount: '100.50'
                        status_code: '05'
                        status_text: DECLINE
                        pending: false
                    properties:
                      data:
                        type: object
                        properties:
                          transaction_type:
                            type: string
                            example: Credit Card
                            description: ACH or Credit Card.
                          transaction_status:
                            type: string
                            example: ''
                            description: The status of the authorization.
                          transaction_status_description:
                            type: string
                            example: ''
                            description: The description of the transaction status.
                          transaction_number:
                            type: string
                            example: ''
                            description: >-
                              The identifier to pass to the capture and void
                              endpoints as data.transaction_id.
                          amount:
                            type: string
                            example: '100.50'
                            description: The amount authorized, in USD.
                          status_code:
                            type: string
                            example: '05'
                            description: Response code from processor.
                          status_text:
                            type: string
                            example: DECLINE
                            description: Response text from processor.
                          pending:
                            type: boolean
                            example: false
                            description: The pending status of the authorization.
        '401':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: Token unauthorized
                    type: object
                    example:
                      data:
                        message: Permission Denied.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Permission Denied.
                  - description: Invalid merchant or affiliate association
                    type: object
                    example:
                      data:
                        message: Not associated with Affiliate
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Not associated with Affiliate
        '403':
          description: Merchant not PCI compliant
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Merchant is not PCI Compliant
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Merchant is not PCI Compliant
        '404':
          description: Invalid sid
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: No such Merchant
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: No such Merchant
        '422':
          description: Expired token
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: >-
                      Token expired. Please retokenize, or provide the card
                      details.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: >-
                          Token expired. Please retokenize, or provide the card
                          details.
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.