{
  "openapi": "3.1.0",
  "info": {
    "title": "Fluxr DT One gateway",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://dtone.fluxr.co.za/api/v1"
    }
  ],
  "paths": {
    "/services": {
      "get": {
        "summary": "Vendor services",
        "operationId": "get_services",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: catalogue:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/countries": {
      "get": {
        "summary": "Vendor countries",
        "operationId": "get_countries",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: catalogue:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/operators": {
      "get": {
        "summary": "Vendor operators",
        "operationId": "get_operators",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: catalogue:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "get": {
        "summary": "Vendor products",
        "operationId": "get_products",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: catalogue:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ]
      }
    },
    "/quotes": {
      "post": {
        "summary": "Create an immutable five-minute quote",
        "operationId": "post_quotes",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: quotes:write",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "product_id"
                ],
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "destination_amount": {
                    "type": "string",
                    "description": "Exact decimal destination amount for ranged products; excludes budget_minor"
                  },
                  "budget_minor": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "credit_party_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "debit_party_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "sender": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "beneficiary": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "statement_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "additional_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transactions": {
      "post": {
        "summary": "Durably accept an idempotent purchase",
        "operationId": "post_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: transactions:write",
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "quote_id",
                  "reference"
                ],
                "additionalProperties": false,
                "properties": {
                  "quote_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "reference": {
                    "type": "string",
                    "maxLength": 128
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Read scoped transactions",
        "operationId": "get_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: transactions:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ]
      }
    },
    "/transactions/{id}": {
      "get": {
        "summary": "Read scoped transactions",
        "operationId": "get_transactions_id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: transactions:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/transactions/by-reference/{reference}": {
      "get": {
        "summary": "Read scoped transactions",
        "operationId": "get_transactions_by_reference_reference",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: transactions:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/transactions/{id}/fulfilment": {
      "get": {
        "summary": "Read sensitive fulfilment; no-store and audited",
        "operationId": "get_transactions_id_fulfilment",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: fulfilment:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/limits": {
      "get": {
        "summary": "Provider-spend allowance",
        "operationId": "get_limits",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: limits:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/reports/summary": {
      "get": {
        "summary": "Gross completed and reversed sales",
        "operationId": "get_reports_summary",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: reports:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/lookups/mobile-number": {
      "post": {
        "summary": "Account-scoped mobile-number lookup",
        "operationId": "post_lookups_mobile_number",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: lookups:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "mobile_number": {
                    "type": "string"
                  }
                },
                "required": [
                  "product_id",
                  "mobile_number"
                ]
              }
            }
          }
        }
      }
    },
    "/lookups/statement": {
      "post": {
        "summary": "Account-scoped statement lookup",
        "operationId": "post_lookups_statement",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: lookups:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "account_number": {
                    "type": "string"
                  },
                  "account_qualifier": {
                    "type": "string"
                  }
                },
                "required": [
                  "product_id",
                  "account_number"
                ]
              }
            }
          }
        }
      }
    },
    "/lookups/account": {
      "post": {
        "summary": "Account-scoped account lookup",
        "operationId": "post_lookups_account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: lookups:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "credit_party_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "product_id",
                  "credit_party_identifier"
                ]
              }
            }
          }
        }
      }
    },
    "/lookups/esim-benefits": {
      "post": {
        "summary": "Account-scoped esim-benefits lookup",
        "operationId": "post_lookups_esim_benefits",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: lookups:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "credit_party_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "product_id",
                  "credit_party_identifier"
                ]
              }
            }
          }
        }
      }
    },
    "/lookups/esim-status": {
      "post": {
        "summary": "Account-scoped esim-status lookup",
        "operationId": "post_lookups_esim_status",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Required ability: lookups:read",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated"
          },
          "403": {
            "description": "Token ability or vendor access denied"
          },
          "409": {
            "description": "Financial, idempotency or pause conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate or velocity limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product_id": {
                    "type": "integer"
                  },
                  "credit_party_identifier": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "product_id",
                  "credit_party_identifier"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Scoped vendor Sanctum token"
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "success",
          "message",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "data": {}
        }
      }
    }
  }
}
