ChargeAfter Charges API

The Charges API from ChargeAfter — 8 operation(s) for charges.

OpenAPI Specification

chargeafter-charges-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Charge Charges API
  description: Welcome to ChargeAfter API reference! This API is implemented in a RESTful state of mind, it has straight-forward, resource-oriented endpoints, and produces standard HTTP response codes to communicate back the result of operations. To get started please contact ChargeAfter support to get your API keys, and get an access to your testing and live environments.
  termsOfService: https://chargeafter.com/privacy-policy
  contact:
    name: Customer Support
    email: support@chargeafter.com
  version: 1.2.45+20181a21407d1df1b163085f2b159570f697241a
servers:
- url: https://api-sandbox.ca-dev.co
  description: Sandbox Environment
- url: https://api.chargeafter.com
  description: Production Environment
security:
- apiKey: []
tags:
- name: Charges
paths:
  /v2/post-sale/charges:
    post:
      tags:
      - Charges
      summary: Create a new Charge
      description: 'Creates a new charge by initiating a new authorize transaction.

        Use the returned ChargedId for other post-sale operations'
      parameters:
      - name: settle
        in: query
        description: "(Optional)\n            \nA flag indicating whether a settle request should be sent to the lender as well."
        schema:
          type: boolean
          description: "(Optional)\n            \nA flag indicating whether a settle request should be sent to the lender as well."
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.NewChargeFromConfirmationBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.NewChargeFromConfirmationBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.NewChargeFromConfirmationBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.NewChargeFromConfirmationBodyDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeCreationResponseDto'
        '202':
          description: Charge created, failed to settle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeCreationResponseDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2002</i> - charge already has assigned confirmation</li><li><i>2004</i> - confirmation not found</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2002'
                    description: charge already has assigned confirmation
                  - code: '2004'
                    description: confirmation not found
        '401':
          description: Unauthorized
        '404':
          description: Confirmation not found
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/{chargeid}:
    get:
      tags:
      - Charges
      summary: Get details of a Charge
      description: Fetching updated information of an existing Charge
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
            text/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
        '401':
          description: Unauthorized
        '404':
          description: Charge not found
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
    patch:
      tags:
      - Charges
      summary: Update a Charge
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.UpdateChargeBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.UpdateChargeBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.UpdateChargeBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.UpdateChargeBodyDto'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
            text/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
        '401':
          description: Unauthorized
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/{chargeid}/settles:
    post:
      tags:
      - Charges
      summary: Settle a Charge
      description: 'Complete a payment transaction by settling a charge.

        This action confirms the secure transfer of funds according to the authorized terms.'
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.SettleActionBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.SettleActionBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.SettleActionBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.SettleActionBodyDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.SettleChargeResponseDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li><li><i>2006</i> - Operation is not permitted at this stage</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
                  - code: '2006'
                    description: Operation is not permitted at this stage
        '401':
          description: Unauthorized
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/{chargeid}/refunds:
    post:
      tags:
      - Charges
      summary: Refund a Charge
      description: 'Process a refund for a previously settled amount.

        This action facilitates the return of funds to the customer for various reasons, such as returned goods or canceled services.'
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.RefundActionBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.RefundActionBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.RefundActionBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.RefundActionBodyDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.RefundResponseDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li><li><i>2006</i> - Operation is not permitted at this stage</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
                  - code: '2006'
                    description: Operation is not permitted at this stage
        '401':
          description: Unauthorized
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/{chargeid}/voids:
    post:
      tags:
      - Charges
      summary: Void a Charge
      description: 'Cancel and invalidate an authorized charge before it is settled.

        This action prevents the charge from being completed or appearing on the customer''s statement.

        Use voiding for transactions that need to be canceled early in the process.'
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.VoidChargeActionBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.VoidChargeActionBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.VoidChargeActionBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.VoidChargeActionBodyDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.VoidChargeResponseDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li><li><i>2006</i> - Operation is not permitted at this stage</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
                  - code: '2006'
                    description: Operation is not permitted at this stage
        '401':
          description: Unauthorized
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/voids/async:
    post:
      tags:
      - Charges
      parameters: []
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeVoidAsyncBodyDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeVoidAsyncBodyDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeVoidAsyncBodyDto'
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeVoidAsyncBodyDto'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeAfter.PostsaleAdapter.WebApi.Contracts.ChargeVoidAsyncResponseDto'
        '400':
          description: Bad Request:<br/><ul><li><i>2001</i> - charge not found</li></ul>
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '2001'
                    description: charge not found
        '401':
          description: Unauthorized
        '422':
          description: Input Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      properties:
                        field:
                          type: string
                        validationState:
                          type: string
                        error:
                          type: string
                example:
                  RequestId: Unique RequestId
                  Message: Input Validation Failure
                  Errors:
                  - Field: RequestField1
                    ValidationState: Invalid
                    Error: RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters.
        '500':
          description: General Server Error
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    type: string
                    description: Associated request id
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code
                        description:
                          type: string
                          description: Error description
                example:
                  requestId: Unique RequestId
                  errors:
                  - code: '1000'
                    description: Unknown error occurred
  /v2/post-sale/charges/{chargeid}/transactions/synthetic:
    post:
      tags:
      - Charges
      summary: Create a synthetic transaction
      description: Creating a transaction without communication with lender
      parameters:
      - name: chargeid
        in: path
        description: The charge ID as received in the response of the original charge operation.
        required: true
        schema:
          minLength: 1
          type: string
          description: The charge ID as received in the response of the original charge operation.
      requestBody:

# --- truncated at 32 KB (69 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/chargeafter/refs/heads/main/openapi/chargeafter-charges-api-openapi.yml