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

# Add payment to cart

> Add payment to cart



## OpenAPI

````yaml oms_v1 post /api-payment/payment
openapi: 3.0.0
info:
  description: Order Management System
  version: 1.0.0
  title: Orders v1 (OMS v1)
  contact:
    email: oms-team@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01-apigw.{customer_name}.fabric.zone
    description: Production
    variables:
      customer_name:
        default: yourcompany
        description: Customer name, provided by support team
security: []
tags:
  - name: Cart
    description: >-
      Cart APIs<br /><br />**Note:** These are the legacy Cart APIs. To view
      fabric's new Cart APIs, navigate to *Cart API > Cart* from the left side
      navigation pane.
  - name: Bill To
    description: Bill To APIs [Deprecated]
  - name: Ship To
    description: >-
      Ship To APIs<br /><br />**Note:** These are the legacy Ship To APIs. To
      view fabric's new Shipping APIs, navigate to *Cart API > Shipping* from
      the left side navigation pane.
  - name: Wishlist
    description: Wishlist APIs
  - name: Cart Decoupled
    description: Cart Decoupled APIs
  - name: Warehouse
    description: Warehouse APIs
  - name: Inventory
    description: Inventory APIs
  - name: Attributes
    description: >-
      Attributes APIs<br /><br />**Note:** These are the legacy Attribute APIs.
      To view fabric's new Attribute APIs, navigate to *Cart API > Attribute*
      from the left side navigation pane.
  - name: List
    description: List APIs
  - name: Tax/Address Validate
    description: Tax/Address Validate APIs
  - name: Shipping
    description: Shipping APIs
  - name: Payments
    description: Payments APIs
  - name: Order
    description: Order APIs
paths:
  /api-payment/payment:
    post:
      tags:
        - Payments
      summary: Add payment to cart
      description: Add payment to cart
      operationId: addPaymentToCart
      parameters:
        - in: header
          name: x-api-key
          schema:
            type: string
            example: 0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - cartId
                - paymentDetails
                - billToAddress
              properties:
                cartId:
                  type: string
                  minLength: 24
                  maxLength: 24
                paymentDetails:
                  type: object
                  required:
                    - transactionDetails
                    - amount
                    - currency
                  properties:
                    transactionDetails:
                      type: object
                      required:
                        - paymentType
                        - paymentToken
                      properties:
                        paymentType:
                          type: string
                          enum:
                            - CARD_STRIPE
                            - CARD_ADYEN
                            - CARD_AUTHORIZENET
                            - CARD_PAYPAL
                            - CARD_CYBERSOURCE
                        paymentToken:
                          type: string
                    amount:
                      type: number
                    currency:
                      type: string
                      minLength: 3
                      maxLength: 3
                billToAddress:
                  type: object
                  required:
                    - name
                    - phone
                    - email
                    - street1
                    - city
                    - state
                    - country
                    - zipCode
                  properties:
                    name:
                      type: object
                      required:
                        - first
                        - last
                      properties:
                        first:
                          type: string
                          example: John
                        last:
                          type: string
                          example: Smith
                    email:
                      type: string
                      format: email
                      minLength: 5
                      example: user1@gmail.com
                    phone:
                      type: object
                      properties:
                        number:
                          type: string
                          example: '3334445555'
                        kind:
                          type: string
                          example: Mobile
                    street1:
                      type: string
                      example: 1000 main street
                    street2:
                      type: string
                      example: 1000 main street
                    city:
                      type: string
                      example: Seattle
                    state:
                      type: string
                      example: WA
                    country:
                      type: string
                      example: US
                    zipCode:
                      type: string
                      example: '98101'
            examples:
              Add payment to cart stripe:
                value:
                  cartId: 60b90dd7308ded0008ee3c5d
                  paymentDetails:
                    transactionDetails:
                      paymentType: CARD_STRIPE
                      paymentToken: token-ads8f97o234jk324
                    amount: 50.25
                    currency: USD
                  billToAddress:
                    name:
                      first: John
                      last: Smith
                    email: ohnsmith@gmail.com
                    phone:
                      number: '07780811973'
                      kind: mobile
                    street1: 600 Congress Ave
                    street2: suite 219
                    city: Austin
                    state: Tx
                    country: US
                    zipCode: '10033'
              Add payment to cart Braintree Token:
                value:
                  cartId: 60b90dd7308ded0008ee3c5d
                  paymentDetails:
                    transactionDetails:
                      paymentType: CARD_ADYEN
                      paymentToken: token-ads8f97o234jk324
                    amount: 50.25
                    currency: USD
                  billToAddress:
                    name:
                      first: John
                      last: Smith
                    email: ohnsmith@gmail.com
                    phone:
                      number: '07780811973'
                      kind: mobile
                    street1: 600 Congress Ave
                    street2: suite 219
                    city: Austin
                    state: Tx
                    country: US
                    zipCode: '10033'
              Add payment to cart Cybersource:
                value:
                  cartId: 60b90dd7308ded0008ee3c5d
                  paymentDetails:
                    transactionDetails:
                      paymentType: CARD_AUTHORIZENET
                      paymentToken: token-ads8f97o234jk324
                    amount: 50.25
                    currency: USD
                  billToAddress:
                    name:
                      first: John
                      last: Smith
                    email: ohnsmith@gmail.com
                    phone:
                      number: '07780811973'
                      kind: mobile
                    street1: 600 Congress Ave
                    street2: suite 219
                    city: Austin
                    state: Tx
                    country: US
                    zipCode: '10033'
      responses:
        '200':
          description: Added Payment to cart
          content:
            application/json:
              schema:
                allOf:
                  - allOf:
                      - type: object
                        required:
                          - billToAddress
                        properties:
                          billToAddress:
                            type: object
                            required:
                              - name
                              - phone
                              - email
                              - street1
                              - city
                              - state
                              - country
                              - zipCode
                            properties:
                              name:
                                type: object
                                required:
                                  - first
                                  - last
                                properties:
                                  first:
                                    type: string
                                    example: John
                                  last:
                                    type: string
                                    example: Smith
                              email:
                                type: string
                                format: email
                                minLength: 5
                                example: user1@gmail.com
                              phone:
                                type: object
                                properties:
                                  number:
                                    type: string
                                    example: '3334445555'
                                  kind:
                                    type: string
                                    example: Mobile
                              street1:
                                type: string
                                example: 1000 main street
                              street2:
                                type: string
                                example: 1000 main street
                              city:
                                type: string
                                example: Seattle
                              state:
                                type: string
                                example: WA
                              country:
                                type: string
                                example: US
                              zipCode:
                                type: string
                                example: '98101'
                      - type: object
                        properties:
                          _id:
                            type: string
                            example: 5fee9d59f2f08a1b3cbdea08
                          createdAt:
                            type: string
                            example: '2020-12-31T02:09:53.914Z'
                          updatedAt:
                            type: string
                            example: '2020-12-31T02:09:53.914Z'
                      - type: object
                        properties:
                          paymentDetails:
                            type: object
                            properties:
                              transactionDetails:
                                type: object
                                properties:
                                  paymentType:
                                    type: string
                                    enum:
                                      - CARD_STRIPE
                                      - CARD_ADYEN
                                      - CARD_AUTHORIZENET
                                    example: CARD_STRIPE
                                  paymentToken:
                                    type: string
                                    example: pi_1IyMGc2YBvYaVyBQNkOiCE3E
                              paymentStatus:
                                type: object
                                properties:
                                  cardHolderFullName:
                                    type: string
                                    example: First Last
                                  paymentMethod:
                                    type: string
                                    example: visa
                                  last4:
                                    type: string
                                    example: '4242'
                                  amountCapturable:
                                    type: number
                                    example: 99900
                                  status:
                                    type: string
                                    example: succeeded
                              amount:
                                type: number
                                example: 999
                              currency:
                                type: string
                                example: USD
                          version:
                            type: number
                            example: 0
                          cartId:
                            type: string
                            example: 60b90dd7308ded0008ee3c5d
                  - type: object
                    properties:
                      isValid:
                        type: boolean
                        example: true
        '400':
          $ref: '#/components/responses/GenericClientError'
        '403':
          $ref: '#/components/responses/MissingXApiKeyHeader'
        '500':
          $ref: '#/components/responses/GenericServerError'
components:
  responses:
    GenericClientError:
      description: A generic client error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string
    MissingXApiKeyHeader:
      description: Missing x-api-key in header
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                description: The error message
                example: Forbidden
                type: string
    GenericServerError:
      description: A generic server error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string

````