{
  "openapi": "3.0.1",
  "info": {
    "title": "Claim Settlement - ingestion",
    "description": "The endpoint dispensing systems post remittance advice to. Authentication is the X-Api-Key header issued per pharmacy; the payload does not name the pharmacy, so it cannot name the wrong one.",
    "version": "v1"
  },
  "paths": {
    "/v1/push": {
      "post": {
        "tags": [
          "Push"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushPayload"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PushPayload"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PushPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PushClaim": {
        "type": "object",
        "properties": {
          "claimId": {
            "type": "integer",
            "format": "int64"
          },
          "scriptId": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "medicalAidCode": {
            "type": "string",
            "nullable": true
          },
          "ramsNumber": {
            "type": "string",
            "nullable": true
          },
          "amountClaimed": {
            "type": "number",
            "format": "double"
          },
          "paymentExcl": {
            "type": "number",
            "format": "double"
          },
          "paymentVat": {
            "type": "number",
            "format": "double"
          },
          "authorization": {
            "type": "string",
            "nullable": true
          },
          "switchRef": {
            "type": "string",
            "nullable": true
          },
          "claimedAt": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushClaimLine": {
        "type": "object",
        "properties": {
          "claimLineId": {
            "type": "integer",
            "format": "int64"
          },
          "claimId": {
            "type": "integer",
            "format": "int64"
          },
          "nappiCode": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "paymentExcl": {
            "type": "number",
            "format": "double"
          },
          "paymentVat": {
            "type": "number",
            "format": "double"
          },
          "lineNumber": {
            "type": "integer",
            "format": "int32"
          },
          "externalStatus": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushControlAccount": {
        "type": "object",
        "properties": {
          "controlAccountId": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "accountBalance": {
            "type": "number",
            "format": "double"
          },
          "modifiedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushLedgerPosting": {
        "type": "object",
        "properties": {
          "postingId": {
            "type": "integer",
            "format": "int64"
          },
          "scriptId": {
            "type": "integer",
            "format": "int64"
          },
          "transactionType": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "postedAt": {
            "type": "string",
            "format": "date-time"
          },
          "controlAccountId": {
            "type": "integer",
            "format": "int32"
          },
          "reversed": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushMedicalAid": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushPayload": {
        "type": "object",
        "properties": {
          "senderVersion": {
            "type": "string",
            "nullable": true
          },
          "windowFrom": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "windowTo": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushScript"
            },
            "nullable": true
          },
          "claims": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushClaim"
            },
            "nullable": true
          },
          "claimLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushClaimLine"
            },
            "nullable": true
          },
          "ledgerPostings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushLedgerPosting"
            },
            "nullable": true
          },
          "controlAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushControlAccount"
            },
            "nullable": true
          },
          "medicalAids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushMedicalAid"
            },
            "nullable": true
          },
          "pharmacies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PushPharmacy"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushPharmacy": {
        "type": "object",
        "properties": {
          "branchCode": {
            "type": "string",
            "nullable": true
          },
          "pharmacyName": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PushScript": {
        "type": "object",
        "properties": {
          "scriptId": {
            "type": "integer",
            "format": "int64"
          },
          "scriptNumber": {
            "type": "integer",
            "format": "int32"
          },
          "medicalAidCode": {
            "type": "string",
            "nullable": true
          },
          "scriptState": {
            "type": "string",
            "nullable": true
          },
          "dispensedAt": {
            "type": "string",
            "format": "date-time"
          },
          "claimDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}