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

# Post cartcheckout



## OpenAPI

````yaml /openapi/openapi.yaml post /cart/checkout
openapi: 3.0.3
info:
  title: Golan Sertifikasi API
  version: 1.0.0
  description: >-
    Public REST API for Golan Sertifikasi web and mobile clients. All monetary
    values are integer IDR. Authenticate with Google ID token exchange; use the
    short-lived bearer token returned by the API.
servers:
  - url: /api/v1
security:
  - bearerAuth: []
paths:
  /cart/checkout:
    post:
      tags:
        - Commerce
      operationId: checkoutCart
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-Coupon-Code
          in: header
          required: false
          schema:
            type: string
            maxLength: 64
      responses:
        '201':
          description: Paid order after confirmed wallet capture.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '202':
          description: >-
            Order remains pending while Finance status is reconciled; poll the
            returned order_id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientBalance'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          description: >-
            Coupon is expired, inactive, ineligible, already reserved to its
            limit, or invalid for the basket.
        '503':
          $ref: '#/components/responses/PaymentPending'
components:
  schemas:
    Order:
      type: object
      required:
        - order_id
        - purchaser_id
        - status
        - amount_idr
        - items
      properties:
        order_id:
          type: string
        purchaser_id:
          type: string
        idempotency_key:
          type: string
        status:
          type: string
          enum:
            - pending
            - paid
            - expired
            - cancelled
            - partially_refunded
            - refunded
        payment_source:
          type: string
          enum:
            - wallet
        finance_reservation_id:
          type: string
          nullable: true
        subtotal_idr:
          type: integer
          format: int64
          minimum: 0
        discount_idr:
          type: integer
          format: int64
          minimum: 0
        coupon_code:
          type: string
        coupon_discount_idr:
          type: integer
          format: int64
          minimum: 0
        tax_name:
          type: string
        tax_rate:
          type: number
          format: double
          minimum: 0
        tax_idr:
          type: integer
          format: int64
          minimum: 0
        amount_idr:
          type: integer
          format: int64
          minimum: 1
        tax_policy_version:
          type: string
        created_at:
          type: string
          format: date-time
        paid_at:
          type: string
          format: date-time
          nullable: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
    OrderItem:
      type: object
      required:
        - order_item_id
        - order_id
        - course_id
        - course_type
        - title
        - price_idr
      properties:
        order_item_id:
          type: string
        order_id:
          type: string
        course_id:
          type: string
        course_type:
          type: string
          enum:
            - regular
            - bnsp
        title:
          type: string
        creator_instructor_id:
          type: string
          nullable: true
        original_price_idr:
          type: integer
          format: int64
          minimum: 0
        discount_idr:
          type: integer
          format: int64
          minimum: 0
        coupon_discount_idr:
          type: integer
          format: int64
          minimum: 0
        price_idr:
          type: integer
          format: int64
          minimum: 1
        tax_name:
          type: string
        tax_rate:
          type: number
          format: double
          minimum: 0
        tax_idr:
          type: integer
          format: int64
          minimum: 0
        tax_policy_version:
          type: string
        catalog_version:
          type: string
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          enum:
            - unauthorized
            - forbidden
            - invalid_google_credential
            - auth_not_configured
            - account_unavailable
            - self_referral
            - not_found
            - tax_policy_unavailable
            - finance_policy_unapproved
            - insufficient_balance
            - wallet_on_hold
            - reservation_pending
            - payment_pending
            - dependency_unavailable
            - payment_unavailable
            - push_unavailable
            - media_unavailable
            - upload_too_large
            - amount_mismatch
            - invalid_status
            - invalid_coupon
            - gateway_request_failed
            - gateway_verification_failed
            - conflict
            - invalid_request
            - idempotency_key_required
            - invalid_idempotency_key
            - internal_error
        message:
          type: string
        request_id:
          type: string
  responses:
    BadRequest:
      description: Invalid request body or query parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InsufficientBalance:
      description: Wallet available funds are insufficient.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Idempotency key conflict or reservation pending.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentPending:
      description: >-
        Finance status is uncertain and no pollable order snapshot is available;
        retry using the same Idempotency-Key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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