{
  "components": {
    "schemas": {
      "Error": {
        "properties": {
          "error": {
            "description": "A stable slug",
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer": {
        "description": "An API key: sk_live_ or sk_test_",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Under /v1 a route keeps working and is retired only after twelve months' notice (GET /v1/deprecations). A key starting sk_test_ reaches the sandbox.",
    "title": "Commerce Orchestration API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/api_keys": {
      "get": {
        "operationId": "get_api_keys",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "List keys by prefix. The secret is shown only at creation.",
        "tags": [
          "API keys"
        ]
      },
      "post": {
        "operationId": "post_api_keys",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "environment": {
                    "description": "live or test",
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": [
                  "environment"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Create a key in an environment.",
        "tags": [
          "API keys"
        ]
      }
    },
    "/v1/api_keys/{id}": {
      "delete": {
        "operationId": "delete_api_keys_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Revoke a key now.",
        "tags": [
          "API keys"
        ]
      }
    },
    "/v1/api_keys/{id}/rotate": {
      "post": {
        "operationId": "post_api_keys_id_rotate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "grace_seconds": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Replace a key, the old one working through a grace of up to a week.",
        "tags": [
          "API keys"
        ]
      }
    },
    "/v1/assistant/docs": {
      "post": {
        "operationId": "post_assistant_docs",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "question": {
                    "description": "1 to 2000 characters",
                    "type": "string"
                  }
                },
                "required": [
                  "question"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Ask the docs assistant; it answers from the guides and this reference and cites them. Answers 202 with the run's id.",
        "tags": [
          "Integration"
        ]
      }
    },
    "/v1/assistant/runs/{id}": {
      "get": {
        "operationId": "get_assistant_runs_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "A run of the assistant: its status, answer and the searches it made.",
        "tags": [
          "Integration"
        ]
      }
    },
    "/v1/authorisations": {
      "post": {
        "operationId": "post_authorisations",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Hold an amount without taking it.",
        "tags": [
          "Authorisations"
        ]
      }
    },
    "/v1/authorisations/{id}": {
      "get": {
        "operationId": "get_authorisations_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read a hold.",
        "tags": [
          "Authorisations"
        ]
      }
    },
    "/v1/authorisations/{id}/capture": {
      "post": {
        "operationId": "post_authorisations_id_capture",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_paise": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Take all or part of a hold.",
        "tags": [
          "Authorisations"
        ]
      }
    },
    "/v1/authorisations/{id}/void": {
      "post": {
        "operationId": "post_authorisations_id_void",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Release a hold.",
        "tags": [
          "Authorisations"
        ]
      }
    },
    "/v1/deprecations": {
      "get": {
        "operationId": "get_deprecations",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Routes being retired, with at least twelve months' notice.",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/v1/exports/{report}": {
      "get": {
        "operationId": "get_exports_report",
        "parameters": [
          {
            "in": "path",
            "name": "report",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "csv or xlsx",
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "YYYY-MM-DD",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "YYYY-MM-DD",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "A report as a file: payments, routing or settlements.",
        "tags": [
          "Exports"
        ]
      }
    },
    "/v1/integration/check": {
      "get": {
        "operationId": "get_integration_check",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Validate gateways, webhooks, the test key and a test payment. Changes nothing.",
        "tags": [
          "Integration"
        ]
      }
    },
    "/v1/mandates": {
      "get": {
        "operationId": "get_mandates",
        "parameters": [
          {
            "description": "filter",
            "in": "query",
            "name": "customer_phone",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "at most 200",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "List mandates.",
        "tags": [
          "Mandates"
        ]
      },
      "post": {
        "operationId": "post_mandates",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Ask a customer for a recurring debit mandate.",
        "tags": [
          "Mandates"
        ]
      }
    },
    "/v1/mandates/{id}": {
      "get": {
        "operationId": "get_mandates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read a mandate.",
        "tags": [
          "Mandates"
        ]
      }
    },
    "/v1/mandates/{id}/debits": {
      "post": {
        "operationId": "post_mandates_id_debits",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Schedule a debit with at least 24 hours' notice.",
        "tags": [
          "Mandates"
        ]
      }
    },
    "/v1/mandates/{id}/refresh": {
      "post": {
        "operationId": "post_mandates_id_refresh",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Ask the gateway for the mandate's state now.",
        "tags": [
          "Mandates"
        ]
      }
    },
    "/v1/mandates/{id}/revoke": {
      "post": {
        "operationId": "post_mandates_id_revoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Revoke a mandate.",
        "tags": [
          "Mandates"
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "operationId": "get_orders",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "List orders.",
        "tags": [
          "Orders"
        ]
      },
      "post": {
        "operationId": "post_orders",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Create an order with its lines.",
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "operationId": "get_orders_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read an order.",
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/orders/{id}/cancel": {
      "post": {
        "operationId": "post_orders_id_cancel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Cancel an order.",
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/orders/{id}/refund": {
      "post": {
        "operationId": "post_orders_id_refund",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Refund an order's payment.",
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/payment_methods": {
      "get": {
        "operationId": "get_payment_methods",
        "parameters": [
          {
            "description": "the amount",
            "in": "query",
            "name": "amount_paise",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "The methods, banks, wallets and EMI tenures live for an amount right now.",
        "tags": [
          "Metadata"
        ]
      }
    },
    "/v1/payments": {
      "get": {
        "operationId": "get_payments",
        "parameters": [
          {
            "description": "at most 200",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "filter by status",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "List payments, newest first.",
        "tags": [
          "Payments"
        ]
      },
      "post": {
        "operationId": "post_payments",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_paise": {
                    "description": "required without order_id; on an order, 0 means what is still owed",
                    "type": "integer"
                  },
                  "customer_phone": {
                    "description": "E.164 or 10 digits",
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "expires_in_seconds": {
                    "type": "integer"
                  },
                  "instrument_id": {
                    "description": "a saved instrument of this customer",
                    "type": "string"
                  },
                  "metadata": {
                    "description": "your own reference, at most 20 keys, echoed on payment and refund webhooks; no personal data",
                    "type": "object"
                  },
                  "method": {
                    "description": "upi_intent, upi_qr, link, card, netbanking or wallet",
                    "type": "string"
                  },
                  "order_id": {
                    "description": "an existing order",
                    "type": "string"
                  },
                  "return_url": {
                    "description": "where the customer goes afterwards, http or https, kept for retries and offered on the pay page",
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Open a payment. With no order_id, an order for the amount is made.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/links/{code}": {
      "get": {
        "operationId": "get_payments_links_code",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read your own payment by the code in its short link (/p/{code}). Another seller's code is not found.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/{id}": {
      "get": {
        "operationId": "get_payments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read a payment with its attempts and routing decisions.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/{id}/refresh": {
      "post": {
        "operationId": "post_payments_id_refresh",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Ask the gateway for the payment's state now.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/{id}/refunds": {
      "post": {
        "operationId": "post_payments_id_refunds",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_paise": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "amount_paise"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Refund all or part of a captured payment.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/{id}/retry": {
      "post": {
        "operationId": "post_payments_id_retry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "instrument_id": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Start the next attempt with another method, within the chain's budget.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/routing/analytics": {
      "get": {
        "operationId": "get_routing_analytics",
        "parameters": [
          {
            "description": "at most 90",
            "in": "query",
            "name": "days",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Success, cost and time to outcome by gateway, method, issuer and hour.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/routing/decisions": {
      "get": {
        "operationId": "get_routing_decisions",
        "parameters": [
          {
            "description": "one payment",
            "in": "query",
            "name": "payment_id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "The decisions report, or one payment's decisions.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/routing/rules": {
      "get": {
        "operationId": "get_routing_rules",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "The active rule set, its versions and trail.",
        "tags": [
          "Routing"
        ]
      },
      "post": {
        "operationId": "post_routing_rules",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "type": "string"
                  },
                  "rules": {
                    "items": {},
                    "type": "array"
                  }
                },
                "required": [
                  "rules"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Save a draft rule set.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/routing/rules/rollback": {
      "post": {
        "operationId": "post_routing_rules_rollback",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "version": {
                    "type": "integer"
                  }
                },
                "required": [
                  "version"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Go back to an earlier version, as a new active copy.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/routing/rules/simulate": {
      "post": {
        "operationId": "post_routing_rules_simulate",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "days": {
                    "description": "at most 30",
                    "type": "integer"
                  },
                  "rules": {
                    "items": {},
                    "type": "array"
                  }
                },
                "required": [
                  "rules"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Replay a candidate set over recent decisions.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/routing/rules/{id}/activate": {
      "post": {
        "operationId": "post_routing_rules_id_activate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "activate_at": {
                    "description": "RFC 3339, omit for now",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Activate a draft now or at a time.",
        "tags": [
          "Routing"
        ]
      }
    },
    "/v1/sandbox/authorisations/{id}/approve": {
      "post": {
        "operationId": "post_sandbox_authorisations_id_approve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Approve a test hold.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/debits/{id}/execute": {
      "post": {
        "operationId": "post_sandbox_debits_id_execute",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Run a test debit now.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/gateway": {
      "post": {
        "operationId": "post_sandbox_gateway",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Take the test gateway down or bring it back.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/mandates/{id}/approve": {
      "post": {
        "operationId": "post_sandbox_mandates_id_approve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Approve a test mandate.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/payments/{id}/settle": {
      "post": {
        "operationId": "post_sandbox_payments_id_settle",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "scenario": {
                    "type": "string"
                  }
                },
                "required": [
                  "scenario"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "End a test payment as a named scenario.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/scenarios": {
      "get": {
        "operationId": "get_sandbox_scenarios",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "The outcomes a test payment can be given.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/shipments/{id}/advance": {
      "post": {
        "operationId": "post_sandbox_shipments_id_advance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Move a test parcel a step along its path.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/sandbox/webhook_endpoints/{id}/delay": {
      "post": {
        "operationId": "post_sandbox_webhook_endpoints_id_delay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "seconds": {
                    "type": "integer"
                  }
                },
                "required": [
                  "seconds"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Hold an endpoint's deliveries back.",
        "tags": [
          "Sandbox"
        ]
      }
    },
    "/v1/webhook_endpoints": {
      "get": {
        "operationId": "get_webhook_endpoints",
        "parameters": [],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "List endpoints.",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "operationId": "post_webhook_endpoints",
        "parameters": [
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "events": {
                    "description": "event types, empty for all",
                    "items": {},
                    "type": "array"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Register an endpoint. The signing secret is in this response only.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_endpoints/{id}": {
      "delete": {
        "operationId": "delete_webhook_endpoints_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Remove an endpoint.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_endpoints/{id}/rotate_secret": {
      "post": {
        "operationId": "post_webhook_endpoints_id_rotate_secret",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Replace the signing secret.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_endpoints/{id}/test": {
      "post": {
        "operationId": "post_webhook_endpoints_id_test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Send one signed test event now and report the answer.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_events": {
      "get": {
        "operationId": "get_webhook_events",
        "parameters": [
          {
            "description": "cursor",
            "in": "query",
            "name": "before_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "at most 200",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "payload search",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "event type",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "The event explorer: this environment's events, newest first.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_events/{id}": {
      "get": {
        "operationId": "get_webhook_events_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Read one event.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_events/{id}/deliveries": {
      "get": {
        "operationId": "get_webhook_events_id_deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Every delivery attempt of an event.",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhook_events/{id}/replay": {
      "post": {
        "operationId": "post_webhook_events_id_replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A repeat with the same key returns the first response.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "endpoint_id": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Success."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The error slug says why."
          }
        },
        "summary": "Send an event again.",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://billzarcart.com"
    }
  ]
}