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

# Subscription Order Status Transition

> Subscription order status transition

## Overview

This page documents the `POST /open/v1/order/complete` endpoint. The full schema, parameters, and examples are rendered from the linked OpenAPI definition above.

## Notes

* Authentication uses the standard GatePay signed headers.
* This page documents the standard merchant endpoint.
* For shared signing rules, see [/api-reference/version/100/en/common/securityAndSignature](/api-reference/version/100/en/common/securityAndSignature).


## OpenAPI

````yaml /api-reference/version/100/en/openapi/subscription/orderComplete-openapi.json POST /open/v1/order/complete
openapi: 3.1.0
info:
  title: GatePay API
  description: GatePay Payment Platform API Documentation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io/pay-subscription
security: []
paths:
  /open/v1/order/complete:
    post:
      summary: Complete Subscription Order
      description: Subscription order status transition
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
      requestBody:
        description: Subscription order status transition request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionPlanRequest'
            examples:
              basicExample:
                summary: Basic Example
                value:
                  merchantSubscriptionOrderNo: test01
                  operationType: CANCEL
                  reason: Cancel order
        required: true
      responses:
        '200':
          description: Subscription order status transition successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionPlanResponse'
              examples:
                successResponse:
                  summary: Success Response
                  value:
                    code: '0'
                    message: ''
                    data: null
                    success: true
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: Merchant client ID, obtained from GatePay platform application
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: HMAC-SHA256 signature, used to verify request legitimacy
      schema:
        type: string
        example: >-
          672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: >-
        Timestamp (milliseconds), time difference with server cannot exceed 5
        minutes
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: Random number, used to prevent replay attacks
      schema:
        type: string
        example: '9578'
  schemas:
    CreateSubscriptionPlanRequest:
      type: object
      required:
        - operationType
      properties:
        subscriptionOrderNo:
          type: string
          description: >-
            Subscription order number (choose one with
            merchantSubscriptionOrderNo)
          example: SUB_20240101_001
        merchantSubscriptionOrderNo:
          type: string
          description: >-
            Merchant subscription order number (choose one with
            subscriptionOrderNo)
          example: MSUB_20240101_001
        operationType:
          type: string
          description: 'Operation type: FINISH (complete) / CANCEL (cancel)'
          enum:
            - FINISH
            - CANCEL
          example: FINISH
        reason:
          type: string
          description: Operation reason, maximum 100 characters
          maxLength: 100
          example: User actively cancels subscription
    CreateSubscriptionPlanResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code, 0 indicates success
          example: '0'
        message:
          type: string
          description: Response description, empty when successful
          example: ''
        success:
          type: boolean
          description: Whether the request was successful
          example: true
        data:
          type: object
          description: Response data
          properties:
            result:
              type: string
              description: ok indicates success
              example: ok

````