2020-05-19 19:59:23 +02:00
{
"paths" : {
"/api/v1/stores/{storeId}/payment-requests" : {
"get" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Get payment requests" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to query" ,
"schema" : { "type" : "string" }
}
] ,
"description" : "View information about the existing payment requests" ,
"operationId" : "PaymentRequests_GetPaymentRequests" ,
"responses" : {
"200" : {
2022-10-25 13:37:36 +02:00
"description" : "List of payment requests" ,
2020-05-19 19:59:23 +02:00
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestDataList"
}
}
}
2022-10-25 13:37:36 +02:00
} ,
"401" : {
"description" : "Missing authorization" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ProblemDetails"
}
}
}
2020-05-19 19:59:23 +02:00
}
} ,
"security" : [
{
2022-02-02 03:12:48 -08:00
"API_Key" : [
2020-05-19 19:59:23 +02:00
"btcpay.store.canviewpaymentrequests"
] ,
"Basic" : [ ]
}
]
} ,
"post" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Create a new payment request" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to query" ,
"schema" : { "type" : "string" }
}
] ,
"description" : "Create a new payment request" ,
"operationId" : "PaymentRequests_CreatePaymentRequest" ,
"responses" : {
"200" : {
"description" : "Information about the new payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestData"
}
}
}
} ,
"400" : {
"description" : "A list of errors that occurred when creating the payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to add new payment requests"
}
} ,
"requestBody" : {
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestBaseData"
}
}
}
} ,
"security" : [
{
2022-02-02 03:12:48 -08:00
"API_Key" : [
2020-05-19 19:59:23 +02:00
"btcpay.store.canmodifypaymentrequests"
] ,
"Basic" : [ ]
}
]
}
} ,
"/api/v1/stores/{storeId}/payment-requests/{paymentRequestId}" : {
"get" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Get payment request" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to fetch" ,
"schema" : { "type" : "string" }
} ,
{
"name" : "paymentRequestId" ,
"in" : "path" ,
"required" : true ,
"description" : "The payment request to fetch" ,
"schema" : { "type" : "string" }
}
] ,
"description" : "View information about the specified payment request" ,
2020-07-24 12:46:46 +02:00
"operationId" : "PaymentRequests_GetPaymentRequest" ,
2020-05-19 19:59:23 +02:00
"responses" : {
"200" : {
"description" : "specified payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestData"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to view the specified payment request"
} ,
"404" : {
"description" : "The key is not found for this payment request"
}
} ,
"security" : [
{
2022-02-02 03:12:48 -08:00
"API_Key" : [
2020-05-19 19:59:23 +02:00
"btcpay.store.canviewpaymentrequests"
] ,
"Basic" : [ ]
}
]
} ,
"delete" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Archive payment request" ,
"description" : "Archives the specified payment request." ,
"operationId" : "PaymentRequests_ArchivePaymentRequest" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store the payment request belongs to" ,
"schema" : { "type" : "string" }
} ,
{
"name" : "paymentRequestId" ,
"in" : "path" ,
"required" : true ,
"description" : "The payment request to remove" ,
"schema" : { "type" : "string" }
}
] ,
"responses" : {
"200" : {
"description" : "The payment request has been archived"
} ,
"400" : {
"description" : "A list of errors that occurred when archiving the payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to archive the specified payment request"
} ,
"404" : {
"description" : "The key is not found for this payment request"
}
} ,
"security" : [
{
2022-11-02 18:41:19 +09:00
"API_Key" : [ "btcpay.store.canmodifypaymentrequests" ] ,
2020-05-19 19:59:23 +02:00
"Basic" : [ ]
}
]
} ,
"put" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Update payment request" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to query" ,
"schema" : { "type" : "string" }
} ,
{
"name" : "paymentRequestId" ,
"in" : "path" ,
"required" : true ,
2020-07-24 12:46:46 +02:00
"description" : "The payment request to update" ,
2020-05-19 19:59:23 +02:00
"schema" : { "type" : "string" }
}
] ,
"description" : "Update a payment request" ,
"operationId" : "PaymentRequests_UpdatePaymentRequest" ,
"responses" : {
"200" : {
"description" : "The updated payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestData"
}
}
}
} ,
"400" : {
"description" : "A list of errors that occurred when updating the payment request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"403" : {
"description" : "If you are authenticated but forbidden to update the payment request"
}
} ,
"requestBody" : {
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/PaymentRequestBaseData"
}
}
}
} ,
"security" : [
{
2022-02-02 03:12:48 -08:00
"API_Key" : [
2020-05-19 19:59:23 +02:00
"btcpay.store.canmodifypaymentrequests"
] ,
"Basic" : [ ]
}
]
}
2022-11-02 18:41:19 +09:00
} ,
"/api/v1/stores/{storeId}/payment-requests/{paymentRequestId}/pay" : {
"post" : {
"tags" : [
"Payment Requests"
] ,
"summary" : "Create a new invoice for the payment request" ,
"parameters" : [
{
"name" : "storeId" ,
"in" : "path" ,
"required" : true ,
"description" : "The store to fetch" ,
"schema" : { "type" : "string" }
} ,
{
"name" : "paymentRequestId" ,
"in" : "path" ,
"required" : true ,
"description" : "The payment request to create" ,
"schema" : { "type" : "string" }
}
] ,
"description" : "Create a new invoice for the payment request, or reuse an existing one" ,
"requestBody" : {
"description" : "Invoice creation request" ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"additionalProperties" : false ,
"properties" : {
"amount" : {
"type" : "string" ,
"format" : "decimal" ,
"minimum" : 0 ,
"exclusiveMinimum" : true ,
"description" : "The amount of the invoice. If `null` or `unspecified`, it will be set to the payment request's due amount. Note that the payment's request `allowCustomPaymentAmounts` must be `true`, or a 422 error will be sent back.'" ,
"nullable" : true ,
"example" : "0.1"
} ,
"allowPendingInvoiceReuse" : {
"type" : "boolean" ,
"nullable" : true ,
"default" : false ,
"description" : "If `true`, this endpoint will not necessarily create a new invoice, and instead attempt to give back a pending one for this payment request."
}
}
}
}
}
} ,
"responses" : {
"200" : {
"description" : "A new invoice" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/InvoiceData"
}
}
}
} ,
"422" : {
"description" : "Unable to validate the request" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ValidationProblemDetails"
}
}
}
} ,
"400" : {
"description" : "Wellknown error codes are: `archived`, `already-paid`, `expired`" ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ProblemDetails"
}
}
}
}
} ,
"security" : [
{
"API_Key" : [
"btcpay.store.canviewpaymentrequests"
] ,
"Basic" : [ ]
}
]
}
2020-05-19 19:59:23 +02:00
}
} ,
"components" : {
"schemas" : {
"PaymentRequestDataList" : {
"type" : "array" ,
"items" : {
"$ref" : "#/components/schemas/PaymentRequestData"
}
} ,
"PaymentRequestData" : {
2022-04-21 12:12:30 +09:00
"allOf" : [
{
"$ref" : "#/components/schemas/PaymentRequestBaseData"
2020-05-19 19:59:23 +02:00
} ,
2022-04-21 12:12:30 +09:00
{
"type" : "object" ,
"properties" : {
"id" : {
"type" : "string" ,
"description" : "The id of the payment request" ,
"nullable" : false
} ,
"storeId" : {
"type" : "string" ,
"description" : "The store identifier that the payment request belongs to"
} ,
"status" : {
"type" : "string" ,
"enum" : [ "Pending" , "Completed" , "Expired" ] ,
"description" : "The status of the payment request" ,
"nullable" : false
} ,
"createdTime" : {
"description" : "The creation date of the payment request" ,
"allOf" : [ { "$ref" : "#/components/schemas/UnixTimestamp" } ] ,
"nullable" : false
}
}
2020-05-19 19:59:23 +02:00
}
2022-04-21 12:12:30 +09:00
]
2020-05-19 19:59:23 +02:00
} ,
2022-11-02 18:41:19 +09:00
"PaymentRequestBaseData" : {
2020-05-19 19:59:23 +02:00
"type" : "object" ,
"additionalProperties" : false ,
"properties" : {
"amount" : {
"type" : "string" ,
"format" : "decimal" ,
"minimum" : 0 ,
"exclusiveMinimum" : true ,
2022-11-02 18:41:19 +09:00
"description" : "The amount of the payment request" ,
2020-05-19 19:59:23 +02:00
"nullable" : false
} ,
2020-05-28 16:53:50 +02:00
"title" : {
"type" : "string" ,
2022-11-02 18:41:19 +09:00
"description" : "The title of the payment request" ,
2020-05-28 16:53:50 +02:00
"nullable" : false
} ,
2020-05-19 19:59:23 +02:00
"currency" : {
"type" : "string" ,
"format" : "ISO 4217 Currency code(BTC, EUR, USD, etc)" ,
2022-01-11 12:11:11 +01:00
"description" : "The currency of the payment request. If empty, the store's default currency code will be used." ,
"nullable" : true
2020-05-19 19:59:23 +02:00
} ,
"email" : {
"type" : "string" ,
"description" : "The email used in invoices generated by the payment request" ,
"nullable" : true ,
"format" : "email"
} ,
"description" : {
"type" : "string" ,
"description" : "The description of the payment request" ,
"nullable" : true ,
"format" : "html"
} ,
"expiryDate" : {
"description" : "The expiry date of the payment request" ,
"nullable" : true ,
2022-11-02 18:41:19 +09:00
"allOf" : [ { "$ref" : "#/components/schemas/UnixTimestamp" } ]
2020-05-19 19:59:23 +02:00
} ,
"embeddedCSS" : {
"type" : "string" ,
"description" : "Custom CSS styling for the payment request" ,
"nullable" : true ,
"format" : "css" ,
"maximum" : 500
} ,
"customCSSLink" : {
"type" : "string" ,
"description" : "Custom CSS link for styling the payment request" ,
"nullable" : true ,
"format" : "uri"
} ,
"allowCustomPaymentAmounts" : {
"type" : "boolean" ,
"description" : "Whether to allow users to create invoices that partially pay the payment request " ,
"nullable" : true
2022-11-25 02:42:55 +01:00
} ,
"formId" : {
"type" : "string" ,
"description" : "Form ID to request customer data" ,
"nullable" : true
} ,
"formResponse" : {
"type" : "object" ,
"description" : "Form data response" ,
"nullable" : true
2020-05-19 19:59:23 +02:00
}
}
}
}
} ,
"tags" : [
{
2022-10-25 13:37:36 +02:00
"name" : "Payment Requests" ,
"description" : "Payment Requests operations"
2020-05-19 19:59:23 +02:00
}
]
}