btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.invoices.json

1453 lines
62 KiB
JSON
Raw Normal View History

2020-07-24 12:46:46 +02:00
{
"paths": {
"/api/v1/stores/{storeId}/invoices": {
"get": {
"tags": [
"Invoices"
],
"summary": "Get invoices",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
},
{
"name": "orderId",
"in": "query",
"required": false,
"description": "Array of OrderIds to fetch the invoices for",
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"example": "1000&orderId=1001&orderId=1002"
},
{
"name": "status",
"in": "query",
"required": false,
"description": "Array of statuses of invoices to be fetched",
"schema": {
"$ref": "#/components/schemas/InvoiceStatus"
}
},
{
"name": "textSearch",
"in": "query",
"required": false,
"description": "A term that can help locating specific invoices.",
"schema": {
"type": "string"
}
},
{
"name": "startDate",
"in": "query",
"required": false,
"description": "Start date of the period to retrieve invoices",
"schema": {
"$ref": "#/components/schemas/UnixTimestamp"
}
},
{
"name": "endDate",
"in": "query",
"required": false,
"description": "End date of the period to retrieve invoices",
"schema": {
"$ref": "#/components/schemas/UnixTimestamp"
}
},
{
"name": "skip",
"in": "query",
"required": false,
"description": "Number of records to skip",
"schema": {
"nullable": true,
"type": "number"
}
},
{
"name": "take",
"in": "query",
"required": false,
"description": "Number of records returned in response",
"schema": {
"nullable": true,
"type": "number"
}
2020-07-24 12:46:46 +02:00
}
],
"description": "View information about the existing invoices",
"operationId": "Invoices_GetInvoices",
"responses": {
"200": {
"description": "List of invoices",
2020-07-24 12:46:46 +02:00
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceDataList"
}
}
}
},
"401": {
"description": "Missing authorization",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
2020-07-24 12:46:46 +02:00
}
},
"security": [
{
"API_Key": [
2020-07-24 12:46:46 +02:00
"btcpay.store.canviewinvoices"
],
"Basic": []
}
]
},
"post": {
"tags": [
"Invoices"
],
"summary": "Create a new invoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
}
],
"description": "Create a new invoice",
"operationId": "Invoices_CreateInvoice",
"responses": {
"200": {
"description": "Information about the new invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when creating the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to add new invoices"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateInvoiceRequest"
}
}
}
},
"security": [
{
"API_Key": [
2020-07-24 12:46:46 +02:00
"btcpay.store.cancreateinvoice"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/invoices/{invoiceId}": {
"get": {
"tags": [
"Invoices"
],
"summary": "Get invoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to fetch",
"schema": {
"type": "string"
}
}
],
"description": "View information about the specified invoice",
"operationId": "Invoices_GetInvoice",
"responses": {
"200": {
"description": "specified invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceData"
}
}
}
},
"403": {
2021-06-20 05:02:55 +02:00
"description": "If you are authenticated but forbidden to view the specified invoice"
2020-07-24 12:46:46 +02:00
},
"404": {
"description": "The key is not found for this invoice"
}
},
"security": [
{
"API_Key": [
2020-07-24 12:46:46 +02:00
"btcpay.store.canviewinvoices"
],
"Basic": []
}
]
},
"delete": {
"tags": [
"Invoices"
],
"summary": "Archive invoice",
"description": "Archives the specified invoice.",
"operationId": "Invoices_ArchiveInvoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store the invoice belongs to",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to remove",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "The invoice has been archived"
},
"400": {
"description": "A list of errors that occurred when archiving the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to archive the specified invoice"
},
"404": {
"description": "The key is not found for this invoice"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmodifyinvoices"
2020-07-24 12:46:46 +02:00
],
"Basic": []
}
]
},
"put": {
"tags": [
"Invoices"
],
"summary": "Update invoice",
"description": "Updates the specified invoice.",
"operationId": "Invoices_UpdateInvoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store the invoice belongs to",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to update",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "The invoice that has been updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when updating the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to update the specified invoice"
},
"404": {
"description": "The key is not found for this invoice"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateInvoiceRequest"
}
}
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmodifyinvoices"
],
"Basic": []
}
]
2020-07-27 10:43:35 +02:00
}
},
"/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods": {
"get": {
"tags": [
"Invoices"
],
"summary": "Get invoice payment methods",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to fetch",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to fetch",
"schema": {
"type": "string"
}
},
{
"name": "onlyAccountedPayments",
"in": "query",
"required": false,
"description": "If default or true, only returns payments which are accounted (in Bitcoin, this mean not returning RBF'd or double spent payments)",
"schema": {
"type": "boolean",
"default": true
}
}
],
"description": "View information about the specified invoice's payment methods",
"operationId": "Invoices_GetInvoicePaymentMethods",
"responses": {
"200": {
"description": "specified invoice payment methods data",
"content": {
"application/json": {
"schema": {
"type": "array",
"nullable": false,
"items": {
"$ref": "#/components/schemas/InvoicePaymentMethodDataModel"
}
}
}
}
},
"403": {
2021-06-20 05:02:55 +02:00
"description": "If you are authenticated but forbidden to view the specified invoice"
},
"404": {
"description": "The key is not found for this invoice"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewinvoices"
],
"Basic": []
}
]
}
},
2020-07-27 10:43:35 +02:00
"/api/v1/stores/{storeId}/invoices/{invoiceId}/status": {
"post": {
"tags": [
"Invoices"
],
"summary": "Mark invoice status",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to update",
"schema": {
"type": "string"
}
}
],
"description": "Mark an invoice as invalid or settled.",
2020-07-27 10:43:35 +02:00
"operationId": "Invoices_MarkInvoiceStatus",
"responses": {
"200": {
"description": "The updated invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when updating the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to update the invoice"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MarkInvoiceStatusRequest"
2020-07-24 12:46:46 +02:00
}
}
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmodifyinvoices"
2020-07-24 12:46:46 +02:00
],
"Basic": []
}
]
}
2020-07-27 10:43:35 +02:00
},
"/api/v1/stores/{storeId}/invoices/{invoiceId}/unarchive": {
"post": {
"tags": [
"Invoices"
],
"summary": "Unarchive invoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to update",
"schema": {
"type": "string"
}
}
],
"description": "Unarchive an invoice",
"operationId": "Invoices_UnarchiveInvoice",
"responses": {
"200": {
"description": "The unarchived invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when updating the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to update the invoice"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canmodifyinvoices"
2020-07-27 10:43:35 +02:00
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods/{paymentMethod}/activate": {
"post": {
"tags": [
"Invoices"
],
"summary": "Activate Payment Method",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to update",
"schema": {
"type": "string"
}
},
{
"name": "paymentMethod",
"in": "path",
"required": true,
"description": "The payment method to activate",
"schema": {
"type": "string"
}
}
],
"description": "Activate an invoice payment method (if lazy payments mode is enabled)",
"operationId": "Invoices_ActivatePaymentMethod",
"responses": {
"200": {
"description": ""
},
"400": {
"description": "A list of errors that occurred when updating the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to activate the invoice payment method"
}
},
"security": [
{
"API_Key": [
"btcpay.store.canviewinvoices"
],
"Basic": []
}
]
}
},
"/api/v1/stores/{storeId}/invoices/{invoiceId}/refund": {
"post": {
"tags": [
"Invoices"
],
"summary": "Refund invoice",
"parameters": [
{
"name": "storeId",
"in": "path",
"required": true,
"description": "The store to query",
"schema": {
"type": "string"
}
},
{
"name": "invoiceId",
"in": "path",
"required": true,
"description": "The invoice to refund",
"schema": {
"type": "string"
}
}
],
"description": "Refund invoice",
"operationId": "Invoices_Refund",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Name of the pull payment (Default: 'Refund' followed by the invoice id)",
"nullable": true
},
"description": {
"type": "string",
"description": "Description of the pull payment"
},
"paymentMethod": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentMethodId"
}
],
"description": "The payment method to use for the refund"
},
"refundVariant": {
"type": "string",
2023-05-11 10:33:33 +02:00
"description": "* `RateThen`: Refund the crypto currency price, at the rate the invoice got paid.\r\n* `CurrentRate`: Refund the crypto currency price, at the current rate.\r\n*`Fiat`: Refund the invoice currency, at the rate when the refund will be sent.\r\n*`OverpaidAmount`: Refund the crypto currency amount that was overpaid.\r\n*`Custom`: Specify the amount, currency, and rate of the refund. (see `customAmount` and `customCurrency`)",
"x-enumNames": [
"RateThen",
"CurrentRate",
"Fiat",
"Custom"
],
"enum": [
"RateThen",
"CurrentRate",
2023-05-11 10:33:33 +02:00
"OverpaidAmount",
"Fiat",
"Custom"
]
},
2023-05-11 10:33:33 +02:00
"subtractPercentage": {
"type": "string",
"format": "decimal",
"description": "Optional percentage by which to reduce the refund, e.g. as processing charge or to compensate for the mining fee.",
"example": "2.1"
},
"customAmount": {
"type": "string",
"format": "decimal",
"description": "The amount to refund if the `refundVariant` is `Custom`.",
"example": "5.00"
},
"customCurrency": {
"type": "string",
"description": "The currency to refund if the `refundVariant` is `Custom`",
"example": "USD"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Pull payment for refunding the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PullPaymentData"
}
}
}
},
"400": {
"description": "A list of errors that occurred when refunding the invoice",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"403": {
"description": "If you are authenticated but forbidden to refund the invoice"
}
},
"security": [
{
"API_Key": [
"btcpay.store.cancreatepullpayments"
],
"Basic": []
}
]
}
2020-07-24 12:46:46 +02:00
}
},
"components": {
"schemas": {
"InvoiceDataList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/InvoiceData"
}
},
2020-07-27 10:43:35 +02:00
"MarkInvoiceStatusRequest": {
2020-07-24 12:46:46 +02:00
"type": "object",
"additionalProperties": false,
"properties": {
"status": {
2020-07-27 10:43:35 +02:00
"nullable": false,
2020-07-24 12:46:46 +02:00
"description": "Mark an invoice as completed or invalid.",
2023-10-10 07:15:07 +02:00
"allOf": [
{
"$ref": "#/components/schemas/InvoiceStatusMark"
}
]
2020-07-27 10:43:35 +02:00
}
}
},
2020-07-24 12:46:46 +02:00
"InvoiceStatusMark": {
"type": "string",
"description": "",
"x-enumNames": [
"Invalid",
"Settled"
2020-07-24 12:46:46 +02:00
],
"enum": [
"Invalid",
"Settled"
2020-07-24 12:46:46 +02:00
]
},
"InvoiceStatus": {
"type": "string",
2023-10-10 07:15:07 +02:00
"description": "The status of the invoice",
2020-07-24 12:46:46 +02:00
"x-enumNames": [
"New",
"Processing",
2020-07-24 12:46:46 +02:00
"Expired",
"Invalid",
"Settled"
2020-07-24 12:46:46 +02:00
],
"enum": [
"New",
"Processing",
2020-07-24 12:46:46 +02:00
"Expired",
"Invalid",
"Settled"
2020-07-24 12:46:46 +02:00
]
},
2020-07-27 10:43:35 +02:00
"InvoiceAdditionalStatus": {
2020-07-24 12:46:46 +02:00
"type": "string",
2020-07-27 10:43:35 +02:00
"description": "An additional status that describes why an invoice is in its current status.",
2020-07-24 12:46:46 +02:00
"x-enumNames": [
"None",
"PaidLate",
"PaidPartial",
"Marked",
"Invalid",
"PaidOver"
],
"enum": [
"None",
"PaidLate",
"PaidPartial",
"Marked",
"Invalid",
"PaidOver"
]
},
"InvoiceDataBase": {
"properties": {
"metadata": {
"$ref": "#/components/schemas/InvoiceMetadata"
},
"checkout": {
"nullable": true,
2023-10-10 07:15:07 +02:00
"description": "Additional settings to customize the checkout flow",
"allOf": [
{
"$ref": "#/components/schemas/CheckoutOptions"
}
]
},
"receipt": {
"nullable": true,
2023-10-10 07:15:07 +02:00
"description": "Additional settings to customize the public receipt",
"allOf": [
{
"$ref": "#/components/schemas/ReceiptOptions"
}
]
}
}
},
2020-07-24 12:46:46 +02:00
"InvoiceData": {
"allOf": [
{
"$ref": "#/components/schemas/InvoiceDataBase"
2020-07-24 12:46:46 +02:00
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The identifier of the invoice"
},
"storeId": {
"type": "string",
"description": "The store identifier that the invoice belongs to"
},
2021-08-03 10:03:00 +02:00
"amount": {
"type": "string",
"format": "decimal",
"description": "The amount of the invoice. Note that the amount will be zero for a top-up invoice that is paid after invoice expiry.",
"example": "5.00"
},
"currency": {
"type": "string",
"description": "The currency of the invoice",
"example": "USD"
2021-08-03 10:03:00 +02:00
},
"type": {
2023-10-10 07:15:07 +02:00
"$ref": "#/components/schemas/InvoiceType"
2021-08-03 10:03:00 +02:00
},
"checkoutLink": {
"type": "string",
"description": "The link to the checkout page, where you can redirect the customer"
},
"createdTime": {
"description": "The creation time of the invoice",
"allOf": [
{
"$ref": "#/components/schemas/UnixTimestamp"
}
]
},
"expirationTime": {
"description": "The expiration time of the invoice",
"allOf": [
{
"$ref": "#/components/schemas/UnixTimestamp"
}
]
},
"monitoringExpiration": {
"description": "Expiration time for monitoring of the invoice for any changes",
"allOf": [
{
"$ref": "#/components/schemas/UnixTimestamp"
}
]
},
2020-07-24 12:46:46 +02:00
"status": {
2023-10-10 07:15:07 +02:00
"$ref": "#/components/schemas/InvoiceStatus"
2020-07-24 12:46:46 +02:00
},
2020-07-27 10:43:35 +02:00
"additionalStatus": {
2023-10-10 07:15:07 +02:00
"$ref": "#/components/schemas/InvoiceAdditionalStatus"
},
"availableStatusesForManualMarking": {
"type": "array",
"description": "The statuses the invoice can be manually marked as",
"items": {
"$ref": "#/components/schemas/InvoiceStatus"
}
},
"archived": {
"type": "boolean",
"description": "true if the invoice is archived"
2020-07-24 12:46:46 +02:00
}
}
}
]
},
"InvoiceMetadata": {
"type": "object",
"additionalProperties": true,
"description": "Additional information around the invoice that can be supplied. The mentioned properties are all optional and you can introduce any json format you wish. See [our documentation](https://docs.btcpayserver.org/Development/InvoiceMetadata/) for more information.",
"example": {
"orderId": "pos-app_346KRC5BjXXXo8cRFKwTBmdR6ZJ4",
"orderUrl": "https://localhost:14142/apps/346KRC5BjXXXo8cRFKwTBmdR6ZJ4/pos",
"itemDesc": "Tea shop",
"posData": {
"tip": 0.48,
"cart": [
{
"id": "pu erh",
"count": 1,
"image": "~/img/pos-sample/pu-erh.jpg",
"price": {
"type": 2,
"value": 2,
"formatted": "$2.00"
},
"title": "Pu Erh",
"inventory": null
},
{
"id": "rooibos",
"count": 1,
"image": "~/img/pos-sample/rooibos.jpg",
"price": {
"type": 2,
"value": 1.2,
"formatted": "$1.20"
},
"title": "Rooibos",
"inventory": null
}
],
"total": 3.68,
"subTotal": 3.2,
"customAmount": 0,
"discountAmount": 0,
"discountPercentage": 0
},
"receiptData": {
"Tip": "$0.48",
"Cart": {
"Pu Erh": "$2.00 x 1 = $2.00",
"Rooibos": "$1.20 x 1 = $1.20"
}
}
},
"anyOf": [
{
"title": "Order information",
"properties": {
"orderId": {
"type": "string",
"nullable": true,
"description": "Refers to the order ID from an external system, such as an e-commerce platform like WooCommerce. This property is indexed, allowing for efficient invoice searches using the `orderId`."
},
"orderUrl": {
"type": "string",
"nullable": true,
"description": "Refers to a URL linking back to the order page of the external system. This link is displayed in the invoice details view."
},
"taxIncluded": {
"type": "number",
"nullable": true,
"description": "Represents the tax amount in the invoice currency. This information will appear in the invoice details view. During invoice creation, the value is automatically rounded to significant digits and ensured not to be greater than the invoice's price."
},
"physical": {
"type": "string",
"nullable": true,
"description": "Indicates if this is a physical good; displayed in the invoice details view and in the BitPay API-compatible endpoints."
}
}
},
{
"title": "Point of Sale (Cart view)",
"properties": {
"posData": {
"type": "object",
"description": "A custom JSON object that represents information displayed in the invoice details view."
}
}
},
{
"title": "Product information",
"properties": {
"itemDesc": {
"type": "string",
"nullable": true,
"description": "When using the Point of Sale (except in keypad or cart view), this field is set to the item description of the purchased item. This information is included in the CSV invoice export feature and appears in the invoice details view."
},
"itemCode": {
"type": "string",
"nullable": true,
"description": "When using the Point of Sale (except in keypad or cart view), this field is set to the item code of the purchased item. This information is included in the CSV invoice export feature and appears in the invoice details view."
}
}
},
{
"title": "Payment request information",
"properties": {
"paymentRequestId": {
"type": "string",
"nullable": true,
"description": "In the invoice details view, a link is provided for navigating to the payment request page associated with the invoice."
}
}
},
{
"title": "Buyer informations",
"properties": {
"buyerName": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerEmail": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerCountry": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerZip": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerState": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerCity": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerAddress1": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerAddress2": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
},
"buyerPhone": {
"type": "string",
"description": "Visible in the invoice details view and in the BitPay API-compatible endpoints.",
"nullable": true
}
}
},
{
"title": "Receipt information",
"properties": {
"receiptData": {
"description": "A custom JSON object that represents information displayed on the receipt page of an invoice.",
"nullable": true
}
}
}
]
},
2020-07-24 12:46:46 +02:00
"CreateInvoiceRequest": {
"allOf": [
{
"$ref": "#/components/schemas/InvoiceDataBase"
2020-07-24 12:46:46 +02:00
},
{
"type": "object",
"additionalProperties": false,
"properties": {
2021-08-03 10:03:00 +02:00
"amount": {
"type": "string",
"format": "decimal",
"nullable": true,
"description": "The amount of the invoice. If null or unspecified, the invoice will be a top-up invoice. (ie. The invoice will consider any payment as a full payment)",
"example": "5.00"
},
"currency": {
"type": "string",
"description": "The currency of the invoice (if null, empty or unspecified, the currency will be the store's settings default)'",
"nullable": true,
"example": "USD"
2021-08-03 10:03:00 +02:00
},
"additionalSearchTerms": {
"type": "array",
"items": {
"type": "string"
},
"description": "Additional search term to help you find this invoice via text search",
"nullable": true
2020-07-24 12:46:46 +02:00
}
}
2020-07-24 12:46:46 +02:00
}
]
2020-07-24 12:46:46 +02:00
},
"UpdateInvoiceRequest": {
"type": "object",
"additionalProperties": false,
"properties": {
"metadata": {
"$ref": "#/components/schemas/InvoiceMetadata"
}
}
},
2020-07-24 12:46:46 +02:00
"CheckoutOptions": {
"type": "object",
"additionalProperties": false,
"properties": {
"speedPolicy": {
"nullable": true,
2023-10-10 07:15:07 +02:00
"allOf": [
{
"$ref": "#/components/schemas/SpeedPolicy"
}
]
2020-07-24 12:46:46 +02:00
},
"paymentMethods": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
},
"description": "A specific set of payment methods to use for this invoice (ie. BTC, BTC-LightningNetwork). By default, select all payment methods enabled in the store."
2020-07-24 12:46:46 +02:00
},
"defaultPaymentMethod": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentMethodId"
}
],
"nullable": true,
2021-09-10 06:33:31 +02:00
"description": "Default payment type for the invoice (e.g., BTC, BTC-LightningNetwork). Default payment method set for the store is used if this parameter is not specified."
},
"lazyPaymentMethods": {
"type": "boolean",
"nullable": true,
"description": "If true, payment methods are enabled individually upon user interaction in the invoice. Default to store's settings'"
},
2020-08-26 13:02:18 +02:00
"expirationMinutes": {
2020-07-24 12:46:46 +02:00
"nullable": true,
"description": "The number of minutes after which an invoice becomes expired. Defaults to the store's settings. (The default store settings is 15)",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanMinutes"
}
]
2020-07-24 12:46:46 +02:00
},
2020-08-26 13:02:18 +02:00
"monitoringMinutes": {
"type": "number",
2020-07-24 12:46:46 +02:00
"nullable": true,
"description": "The number of minutes after an invoice expired after which we are still monitoring for incoming payments. Defaults to the store's settings. (The default store settings is 1440, 1 day)",
"allOf": [
{
"$ref": "#/components/schemas/TimeSpanMinutes"
}
]
2020-07-24 12:46:46 +02:00
},
"paymentTolerance": {
2020-08-26 13:02:18 +02:00
"type": "number",
2020-07-24 12:46:46 +02:00
"format": "double",
"nullable": true,
"minimum": 0,
"maximum": 100,
"description": "A percentage determining whether to count the invoice as paid when the invoice is paid within the specified margin of error. Defaults to the store's settings. (The default store settings is 100)"
},
"redirectURL": {
"type": "string",
"nullable": true,
"description": "When the customer has paid the invoice, the URL where the customer will be redirected when clicking on the `return to store` button. You can use placeholders `{InvoiceId}` or `{OrderId}` in the URL, BTCPay Server will replace those with this invoice `id` or `metadata.orderId` respectively."
},
"redirectAutomatically": {
"type": "boolean",
"nullable": true,
"description": "When the customer has paid the invoice, and a `redirectURL` is set, the checkout is redirected to `redirectURL` automatically if `redirectAutomatically` is true. Defaults to the store's settings. (The default store settings is false)"
},
"requiresRefundEmail": {
"type": "boolean",
"nullable": true,
"description": "Invoice will require user to provide a refund email if this option is set to `true`. Has no effect if `buyerEmail` metadata is set as there is no email to collect in this case."
},
"checkoutType": {
"type": "string",
"description": "`\"V1\"`: The original checkout form \n`\"V2\"`: The new experimental checkout form. \nIf `null` or unspecified, the store's settings will be used.",
"nullable": true,
"default": null,
"enum": [
2023-10-10 07:15:07 +02:00
null,
"V1",
"V2"
]
},
"defaultLanguage": {
"type": "string",
"nullable": true,
"description": "The language code (eg. en-US, en, fr-FR...) of the language presented to your customer in the checkout page. BTCPay Server tries to match the best language available. If null or not set, will fallback on the store's default language. You can see the list of language codes with [this operation](#operation/langCodes)."
2020-07-24 12:46:46 +02:00
}
}
},
"ReceiptOptions": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"nullable": true,
"description": "A public page will be accessible once the invoice is settled. If null or unspecified, it will fallback to the store's settings. (The default store settings is true)"
},
"showQR": {
"type": "boolean",
"nullable": true,
"default": null,
"description": "Show the QR code of the receipt in the public receipt page. If null or unspecified, it will fallback to the store's settings. (The default store setting is true)"
},
"showPayments": {
"type": "boolean",
"nullable": true,
"default": null,
"description": "Show the payment list in the public receipt page. If null or unspecified, it will fallback to the store's settings. (The default store setting is true)"
}
}
},
"InvoicePaymentMethodDataModel": {
"type": "object",
"additionalProperties": false,
"properties": {
"paymentMethod": {
"$ref": "#/components/schemas/PaymentMethodId"
},
"cryptoCode": {
"type": "string",
"description": "Crypto code of the payment method (e.g., \"BTC\" or \"LTC\")",
"example": "BTC"
},
"destination": {
"type": "string",
"description": "The destination the payment must be made to"
},
"paymentLink": {
"type": "string",
"nullable": true,
"description": "A payment link that helps pay to the payment destination"
},
"rate": {
"type": "string",
"format": "decimal",
"example": "64392.23",
"description": "The rate between this payment method's currency and the invoice currency"
},
"paymentMethodPaid": {
"type": "string",
"format": "decimal",
"description": "The amount paid by this payment method"
},
"totalPaid": {
"type": "string",
"format": "decimal",
"description": "The total amount paid by all payment methods to the invoice, converted to this payment method's currency"
},
"due": {
"type": "string",
"format": "decimal",
"description": "The total amount left to be paid, converted to this payment method's currency (will be negative if overpaid)"
},
"amount": {
"type": "string",
"format": "decimal",
"description": "The invoice amount, converted to this payment method's currency"
},
"networkFee": {
"type": "string",
"format": "decimal",
"description": "The added merchant fee to pay for network costs of this payment method."
},
"payments": {
"type": "array",
"nullable": false,
"items": {
"$ref": "#/components/schemas/Payment"
},
"description": "Payments made with this payment method."
},
"activated": {
"type": "boolean",
"description": "If the payment method is activated (when lazy payments option is enabled"
},
"additionalData": {
"description": "Additional data provided by the payment method.",
"anyOf": [
{
"type": "object",
"description": "LNURL Pay information",
"properties": {
"providedComment": {
"type": "string",
"nullable": true,
"description": "The provided comment to a LNUrl payment with comments enabled",
"example": "Thank you!"
},
"consumedLightningAddress": {
"type": "string",
"nullable": true,
"description": "The consumed lightning address of a LN Address payment",
"example": "customer@example.com"
}
}
},
{
"type": "object",
"description": "No additional information"
}
]
}
}
},
"Payment": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for this payment"
},
"receivedDate": {
"description": "The date the payment was recorded",
"allOf": [
{
"$ref": "#/components/schemas/UnixTimestamp"
}
]
},
"value": {
"type": "string",
"format": "decimal",
"description": "The value of the payment"
},
"fee": {
"type": "string",
"format": "decimal",
"description": "The fee paid for the payment"
},
"status": {
2023-10-10 07:15:07 +02:00
"$ref": "#/components/schemas/PaymentStatus"
},
"destination": {
"type": "string",
"description": "The destination the payment was made to"
}
}
},
"PaymentStatus": {
"type": "string",
2023-10-10 07:15:07 +02:00
"description": "The status of the payment",
"x-enumNames": [
"Invalid",
"Processing",
"Settled"
],
"enum": [
"Invalid",
"Processing",
"Settled"
]
2021-08-03 10:03:00 +02:00
},
"InvoiceType": {
"type": "string",
2023-10-10 07:15:07 +02:00
"description": "The type of the invoice",
2021-08-03 10:03:00 +02:00
"x-enumNames": [
"Standard",
"TopUp"
],
"enum": [
"Standard",
"TopUp"
]
2020-07-24 12:46:46 +02:00
}
}
},
"tags": [
{
"name": "Invoices",
"description": "Invoice operations"
2020-07-24 12:46:46 +02:00
}
]
}