{
  "openapi": "3.1.0",
  "info": {
    "title": "Peyeli synthetic evaluation API",
    "version": "1.2.0",
    "description": "Selected source-reviewed shapes; executable only against the supplied local synthetic sandbox. Not a supported live partner API, provider sandbox, authentication grant, production assurance or release approval. Synthetic list dates are UTC, unlike the documented application predicate."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:3061",
      "description": "Loopback synthetic sandbox only; no authentication, funds or providers."
    }
  ],
  "security": [],
  "paths": {
    "/api/v1/orgs/{org}/payment-intents": {
      "post": {
        "operationId": "createIntent",
        "summary": "createIntent",
        "description": "Evaluation simulation. Application authority: payment.create. Required; organization + operation containing actor identity + key.",
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "org_synthetic"
            },
            "description": "Synthetic organization. Real tenant access requires separate approval."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
            },
            "description": "Same key/body replays; a changed canonical JSON body conflicts."
          }
        ],
        "responses": {
          "201": {
            "description": "Synthetic success.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              },
              "idempotent-replayed": {
                "description": "true on replay",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentView"
                }
              }
            }
          },
          "400": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-application-authority": "payment.create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIntent"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listIntents",
        "summary": "listIntents",
        "description": "Evaluation simulation. Application authority: payment.view. ",
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "org_synthetic"
            },
            "description": "Synthetic organization. Real tenant access requires separate approval."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "requires_payment",
                "processing",
                "requires_review",
                "succeeded",
                "failed",
                "canceled",
                "expired"
              ]
            },
            "description": "status"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "q"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 50,
              "description": "Maximum 200 without from/to; maximum 1000 with a valid paired range."
            },
            "description": "limit"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Paired dates required, from <= to. Synthetic UTC; application Port-au-Prince predicate differs as documented."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Paired dates required, from <= to. Synthetic UTC; application Port-au-Prince predicate differs as documented."
          }
        ],
        "responses": {
          "200": {
            "description": "Synthetic success.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentList"
                }
              }
            }
          },
          "400": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-application-authority": "payment.view"
      }
    },
    "/api/v1/orgs/{org}/payment-intents/{pi}": {
      "get": {
        "operationId": "getIntent",
        "summary": "getIntent",
        "description": "Evaluation simulation. Application authority: payment.view. ",
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "org_synthetic"
            },
            "description": "Synthetic organization. Real tenant access requires separate approval."
          },
          {
            "name": "pi",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pi_synthetic_[0-9]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Synthetic success.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentDetail"
                }
              }
            }
          },
          "400": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-application-authority": "payment.view"
      }
    },
    "/api/v1/orgs/{org}/payment-intents/{pi}/attempts": {
      "post": {
        "operationId": "startAttempt",
        "summary": "startAttempt",
        "description": "Evaluation simulation. Application authority: payment.collect. Required; operation includes intent and actor identity. Submission is not financial confirmation.",
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "org_synthetic"
            },
            "description": "Synthetic organization. Real tenant access requires separate approval."
          },
          {
            "name": "pi",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pi_synthetic_[0-9]+$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
            },
            "description": "Same key/body replays; a changed canonical JSON body conflicts."
          }
        ],
        "responses": {
          "201": {
            "description": "Attempt submitted; not financial confirmation.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              },
              "idempotent-replayed": {
                "description": "true on replay",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttemptCreated"
                }
              }
            }
          },
          "400": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-application-authority": "payment.collect",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAttempt"
              }
            }
          }
        }
      }
    },
    "/api/v1/orgs/{org}/payment-intents/{pi}/cancel": {
      "post": {
        "operationId": "cancelIntent",
        "summary": "cancelIntent",
        "description": "Evaluation simulation. Application authority: payment.cancel. Required; application/json body required; unresolved attempt blocks cancellation.",
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "const": "org_synthetic"
            },
            "description": "Synthetic organization. Real tenant access requires separate approval."
          },
          {
            "name": "pi",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pi_synthetic_[0-9]+$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
            },
            "description": "Same key/body replays; a changed canonical JSON body conflicts."
          }
        ],
        "responses": {
          "200": {
            "description": "Synthetic success.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              },
              "idempotent-replayed": {
                "description": "true on replay",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentView"
                }
              }
            }
          },
          "400": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Selected possible error; not a guarantee every operation produces every code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-application-authority": "payment.cancel",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Money": {
        "type": "object",
        "required": [
          "amountMinor",
          "assetId"
        ],
        "properties": {
          "amountMinor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*|-[1-9][0-9]*)$"
          },
          "assetId": {
            "type": "string"
          }
        }
      },
      "PositiveMoney": {
        "type": "object",
        "required": [
          "amountMinor",
          "assetId"
        ],
        "properties": {
          "amountMinor": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "assetId": {
            "type": "string",
            "description": "Existing electronic asset compatible with target environment; not physical cash.",
            "const": "asset_synthetic_htg"
          }
        }
      },
      "CreateIntent": {
        "type": "object",
        "required": [
          "amount",
          "orderReference"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/PositiveMoney"
          },
          "orderReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "\\S",
            "description": "Nonblank; raw length checked before trimming."
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "expiresInMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 10080,
            "default": 30,
            "description": "Omitted or null defaults to 30."
          }
        }
      },
      "IntentView": {
        "type": "object",
        "required": [
          "id",
          "amount",
          "orderReference",
          "description",
          "status",
          "settlementStatus",
          "providerConnectionId",
          "expiresAt",
          "confirmedAt",
          "createdBy",
          "createdAt",
          "environment"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "orderReference": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "requires_payment",
              "processing",
              "requires_review",
              "succeeded",
              "failed",
              "canceled",
              "expired"
            ]
          },
          "settlementStatus": {
            "type": "string"
          },
          "providerConnectionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "confirmedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "environment": {
            "type": "string"
          }
        }
      },
      "IntentList": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/IntentView"
                },
                {
                  "type": "object",
                  "required": [
                    "provider",
                    "providerLabel"
                  ],
                  "properties": {
                    "provider": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "providerLabel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "IntentDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/IntentView"
          },
          {
            "type": "object",
            "required": [
              "attempts",
              "receipt"
            ],
            "properties": {
              "attempts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "providerReference",
                    "providerTransactionId",
                    "failureReason",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "providerReference": {
                      "type": "string"
                    },
                    "providerTransactionId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failureReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              },
              "receipt": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "required": [
                      "id",
                      "number",
                      "confirmedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "number": {
                        "type": "string"
                      },
                      "confirmedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      "StartAttempt": {
        "type": "object",
        "required": [
          "providerConnectionId"
        ],
        "properties": {
          "providerConnectionId": {
            "type": "string",
            "const": "connection_synthetic"
          }
        }
      },
      "AttemptCreated": {
        "type": "object",
        "required": [
          "attemptId",
          "providerReference"
        ],
        "properties": {
          "attemptId": {
            "type": "string"
          },
          "providerReference": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "requestId"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "x-application-authentication": "Verified application cookie session; current active organization membership and operation checks. No partner API-key or OAuth product is established by this snapshot."
}
