deleteCustomersCustomerDiscount
Delete a customer discount
Details
- Method:
DELETE - Path:
/v1/customers/{customer}/discount - Operation ID:
DeleteCustomersCustomerDiscount
Parameters
{
"customer": {
"description": "",
"required": true,
"location": "path",
"type": "string"
}
}Response Schema
{
"description": "",
"properties": {
"checkout_session": {
"description": "The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"customer": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/customer"
},
{
"$ref": "#/components/schemas/deleted_customer"
}
],
"description": "The ID of the customer associated with this discount.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/customer"
},
{
"$ref": "#/components/schemas/deleted_customer"
}
]
}
},
"customer_account": {
"description": "The ID of the account representing the customer associated with this discount.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"deleted": {
"description": "Always true for a deleted object",
"enum": [
true
],
"type": "boolean"
},
"id": {
"description": "The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.",
"maxLength": 5000,
"type": "string"
},
"invoice": {
"description": "The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"invoice_item": {
"description": "The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"object": {
"description": "String representing the object's type. Objects of the same type share the same value.",
"enum": [
"discount"
],
"type": "string"
},
"promotion_code": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/promotion_code"
}
],
"description": "The promotion code applied to create this discount.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/promotion_code"
}
]
}
},
"source": {
"description": "",
"properties": {
"coupon": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/coupon"
}
],
"description": "The coupon that was redeemed to create this discount.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/coupon"
}
]
}
},
"type": {
"description": "The source type of the discount.",
"enum": [
"coupon"
],
"type": "string"
}
},
"required": [
"type"
],
"title": "DiscountSource",
"type": "object",
"x-expandableFields": [
"coupon"
]
},
"start": {
"description": "Date that the coupon was applied.",
"format": "unix-time",
"type": "integer"
},
"subscription": {
"description": "The subscription that this coupon is applied to, if it is applied to a particular subscription.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"subscription_item": {
"description": "The subscription item that this coupon is applied to, if it is applied to a particular subscription item.",
"maxLength": 5000,
"nullable": true,
"type": "string"
}
},
"required": [
"deleted",
"id",
"object",
"source",
"start"
],
"title": "DeletedDiscount",
"type": "object",
"x-expandableFields": [
"customer",
"promotion_code",
"source"
],
"x-resourceId": "deleted_discount"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('stripe')
# Call this tool
result = await agent.call_tool('deleteCustomersCustomerDiscount', {
# Add required parameters here
})