action squareup_create_terminal_refund { label: "CreateTerminalRefund" description: "Creates a request to refund an Interac payment completed on a Square Terminal." provider: squareup method: POST path: "/v2/terminals/refunds" encoding: json input: { type: "object" required: ["idempotency_key"] properties: { idempotency_key: { type: "string" description: "A unique string that identifies this `CreateRefund` request. Keys can be any valid string but\nmust be unique for every `CreateRefund` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information." } refund: { type: "object" required: ["amount_money", "payment_id"] properties: { amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } app_id: { type: "string" description: "The ID of the application that created the refund." } cancel_reason: { type: "string" description: "Present if the status is `CANCELED`." } created_at: { type: "string" description: "The time when the `TerminalRefund` was created, as an RFC 3339 timestamp." } deadline_duration: { type: "string" description: "The RFC 3339 duration, after which the refund is automatically canceled.\nA `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation.\n\nMaximum: 5 minutes" } device_id: { type: "string" description: "The unique ID of the device intended for this `TerminalRefund`.\nThe Id can be retrieved from /v2/devices api." } id: { type: "string" description: "A unique ID for this `TerminalRefund`." } location_id: { type: "string" description: "The location of the device where the `TerminalRefund` was directed." } order_id: { type: "string" description: "The reference to the Square order ID for the payment identified by the `payment_id`." } payment_id: { type: "string" description: "The unique ID of the payment being refunded." } reason: { type: "string" description: "A description of the reason for the refund.\nNote: maximum 192 characters" } refund_id: { type: "string" description: "The reference to the payment refund created by completing this `TerminalRefund`." } status: { type: "string" description: "The status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCELED`, or `COMPLETED`." } updated_at: { type: "string" description: "The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp." } } } } } output: { type: "object" properties: { errors: { type: "array" description: "Information about errors encountered during the request." items: { type: "object" description: "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information." required: ["category", "code"] properties: { category: { type: "string" description: "The high-level category for the error." } code: { type: "string" description: "The specific code of the error." } detail: { type: "string" description: "A human-readable description of the error for debugging purposes." } field: { type: "string" description: "The name of the field provided in the original request (if any) that\nthe error pertains to." } } } } refund: { type: "object" required: ["amount_money", "payment_id"] properties: { amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } app_id: { type: "string" description: "The ID of the application that created the refund." } cancel_reason: { type: "string" description: "Present if the status is `CANCELED`." } created_at: { type: "string" description: "The time when the `TerminalRefund` was created, as an RFC 3339 timestamp." } deadline_duration: { type: "string" description: "The RFC 3339 duration, after which the refund is automatically canceled.\nA `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation.\n\nMaximum: 5 minutes" } device_id: { type: "string" description: "The unique ID of the device intended for this `TerminalRefund`.\nThe Id can be retrieved from /v2/devices api." } id: { type: "string" description: "A unique ID for this `TerminalRefund`." } location_id: { type: "string" description: "The location of the device where the `TerminalRefund` was directed." } order_id: { type: "string" description: "The reference to the Square order ID for the payment identified by the `payment_id`." } payment_id: { type: "string" description: "The unique ID of the payment being refunded." } reason: { type: "string" description: "A description of the reason for the refund.\nNote: maximum 192 characters" } refund_id: { type: "string" description: "The reference to the payment refund created by completing this `TerminalRefund`." } status: { type: "string" description: "The status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCELED`, or `COMPLETED`." } updated_at: { type: "string" description: "The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp." } } } } } }