{
  "openapi": "3.1.0",
  "info": {
    "title": "Pay API",
    "version": "",
    "x-feedbackLink": {}
  },
  "x-externalLinks": [
    {
      "label": "Homepage",
      "url": "https://deliverectdevportal.lovable.app/"
    },
          {
      "label": "API Status",
      "url": "https://status.deliverect.com/"
    }
  ],
  "servers": [
    {
      "description": "Staging Environment",
      "url": "https://api.staging.deliverect.com"
    }
  ],
  "tags": [
    {
      "name": "Pay API - Endpoints",
      "description": "Pay API - Endpoints"
    },
    {
      "name": "Partner Webhooks & Events",
      "description": "Partner Webhooks & Events"
    }
  ],
  "x-topics": [
      {
      "title": "Get Started",
      "content": {
        "$ref": "./content/getStarted"
      }
    },
        {
      "title": "Certification",
      "content": {
        "$ref": "./content/certificationProcess"
      }
    },
    {
      "title": "IP Whitelisting",
      "content": {
        "$ref": "./content/ipWhitelisting"
      }
    },
    {
      "title": "HMAC Authentication",
      "content": {
        "$ref": "./content/hmacAuthentication"
      }
    }
  ],
  "paths": {
    "/pay/events/{{integrationName}}/gatewayProfiles/{{gatewayProfileId}}": {
      "post": {
        "summary": "Payment Events",
        "operationId": "users_taoufiqqyes_deliverect_bruno_pay_api_pay_api_partner_webhooks_events_payment_events_bru",
        "description": "",
        "tags": [
          "Pay API - Endpoints"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/payment_events"
        },
        "security": [
          {
            "payment_events": []
          }
        ]
      }
    },
    "/pay/channel/{{channelLinkId}}/gatewayProfiles": {
      "get": {
        "summary": "Get Payment Gateways",
        "operationId": "users_taoufiqqyes_deliverect_bruno_pay_api_pay_api_channel_endpoints_get_payment_gateways_bru",
        "description": "",
        "tags": [
          "Pay API - Endpoints"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "get_payment_gateways": []
          }
        ]
      }
    },
    "/pay/channel/{{channelLinkId}}/payments/{{paymentId}}": {
      "get": {
        "summary": "Get Payment",
        "operationId": "users_taoufiqqyes_deliverect_bruno_pay_api_pay_api_channel_endpoints_get_payment_bru",
        "description": "",
        "tags": [
          "Pay API - Endpoints"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "get_payment": []
          }
        ]
      }
    },
    "/pay/channel/{{channelLinkId}}/payments/request": {
      "post": {
        "summary": "Request Payment",
        "operationId": "users_taoufiqqyes_deliverect_bruno_pay_api_pay_api_channel_endpoints_request_payment_bru",
        "description": "",
        "tags": [
          "Pay API - Endpoints"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/request_payment"
        },
        "security": [
          {
            "request_payment": []
          }
        ]
      }
    },
    "/yourwebhookurl/payments/profile/register": {
      "post": {
        "summary": "Register Profile",
        "responses": {
          "default": {
            "description": "Register Profile"
          }
        },
        "tags": [
          "Partner Webhooks & Events"
        ]
      }
    },
    "/yourwebhookurl/payments/request": {
      "post": {
        "summary": "Request Payment",
        "responses": {
          "default": {
            "description": "Request Payment"
          }
        },
        "tags": [
          "Partner Webhooks & Events"
        ]
      }
    },
    "/yourwebhookurl/payments/refund": {
      "post": {
        "summary": "Refund Payment",
        "responses": {
          "default": {
            "description": "Refund Payment"
          }
        },
        "tags": [
          "Partner Webhooks & Events"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Staging Environment",
      "url": "https://api.staging.deliverect.com"
    }
  ],
  "components": {
    "schemas": {
      "payment_events": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "gatewayId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "method": {
            "type": "string"
          }
        }
      },
      "refund_payment": {
        "type": "object",
        "properties": {
          "paymentId": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          }
        }
      },
      "register_profile": {
        "type": "object",
        "properties": {
          "gatewayProfileId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "webhookUrl": {
            "type": "string"
          }
        }
      },
      "get_payment_url": {
        "type": "object",
        "properties": {
          "returnUrl": {
            "type": "string"
          },
          "logoUrl": {
            "type": "string"
          }
        }
      },
      "request_payment": {
        "type": "object",
        "properties": {
          "gatewayProfileId": {
            "type": "string"
          },
          "mode": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "returnUrl": {
                "type": "string"
              },
              "logoUrl": {
                "type": "string"
              }
            }
          },
          "amount": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "payableReference": {
            "type": "string"
          },
          "payer": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "reference": {
                "type": "string"
              },
              "ip": {
                "type": "string"
              }
            }
          },
          "payable": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "properties": {
                  "0": {
                    "type": "object",
                    "properties": {
                      "quantity": {
                        "type": "number"
                      },
                      "plu": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "unitPrice": {
                        "type": "number"
                      },
                      "total": {
                        "type": "number"
                      },
                      "taxTotal": {
                        "type": "number"
                      },
                      "discountTotal": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          },
          "billingAddress": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "stateOrProvince": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "street": {
                "type": "string"
              },
              "houseNumber": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "payment_events": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/payment_events"
            }
          }
        },
        "description": "",
        "required": true
      },
      "refund_payment": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/refund_payment"
            }
          }
        },
        "description": "",
        "required": true
      },
      "register_profile": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/register_profile"
            }
          }
        },
        "description": "",
        "required": true
      },
      "get_payment_url": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/get_payment_url"
            }
          }
        },
        "description": "",
        "required": true
      },
      "request_payment": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/request_payment"
            }
          }
        },
        "description": "",
        "required": true
      }
    },
    "securitySchemes": {
      "payment_events": {
        "type": "http",
        "scheme": "bearer"
      },
      "get_payment_profile": {
        "type": "http",
        "scheme": "bearer"
      },
      "get_payment_url": {
        "type": "http",
        "scheme": "bearer"
      },
      "refund_payment": {
        "type": "http",
        "scheme": "bearer"
      },
      "get_payment_gateways": {
        "type": "http",
        "scheme": "bearer"
      },
      "get_payment": {
        "type": "http",
        "scheme": "bearer"
      },
      "request_payment": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
