---
updatedAt: 2026-05-27T19:42:41.000Z
agentTools:
  projectIndex: https://developers.hivelocity.net/llms.txt
---

# Apply the coupon code for a service

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/credit/apply-coupon": {
      "post": {
        "operationId": "post_credit_apply_coupon_resource",
        "parameters": [
          {
            "description": "An optional fields mask",
            "in": "header",
            "name": "X-Fields",
            "schema": {
              "type": "string",
              "format": "mask"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/CartCoupon"
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credit"
                }
              }
            }
          },
          "201": {
            "description": "Successfully applied the coupon code."
          },
          "400": {
            "description": "Invalid coupon code."
          },
          "403": {
            "description": "You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission."
          }
        },
        "summary": "Apply the coupon code for a service",
        "tags": [
          "Credit"
        ]
      }
    }
  },
  "info": {
    "description": "Interact with Hivelocity",
    "title": "Hivelocity API",
    "version": "2.0"
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "description": "Endpoints to manage Credit",
      "name": "Credit"
    }
  ],
  "servers": [
    {
      "url": "https://core.hivelocity.net/api/v2"
    }
  ],
  "components": {
    "requestBodies": {
      "CartCoupon": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CartCoupon"
            }
          }
        },
        "required": true
      }
    },
    "securitySchemes": {
      "apiKey": {
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      }
    },
    "schemas": {
      "CartCoupon": {
        "properties": {
          "code": {
            "description": "Coupon code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "Credit": {
        "properties": {
          "amount": {
            "description": "The amount of credit associated with the credit ID",
            "type": "number"
          },
          "autoApply": {
            "description": "Whether credits are automatically being applied to new orders or invoices. [0 = Not Auto Apply, 1 = Auto Apply New Invoices, 2 = Auto Apply All Invoices]",
            "type": "integer"
          },
          "balance": {
            "description": "The amount of credit available for use associated with the credit ID",
            "type": "number"
          },
          "billingInfoId": {
            "description": "The Billing Info ID used to purchase the credits on this account",
            "type": "integer"
          },
          "clientId": {
            "description": "The client ID associated with the credit ID",
            "type": "integer"
          },
          "created": {
            "description": "The created date/time of the credit",
            "type": "integer"
          },
          "expirationDate": {
            "description": "The expiration date of the credit",
            "type": "integer"
          },
          "id": {
            "description": "The ID corresponding to a particular credit",
            "type": "integer"
          },
          "isHourly": {
            "description": "If credit is for hourly billing",
            "type": "boolean"
          },
          "orderId": {
            "description": "The order ID associated with the credit ID",
            "type": "integer"
          },
          "reason": {
            "description": "The reason code for the creation of the credit",
            "type": "string"
          },
          "serviceIds": {
            "description": "The list of service IDs associated with the credit ID",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "status": {
            "description": "The status of the credit",
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  }
}
```