{
  "info": {
    "name": "Parcel_Integration",
    "schema": "{{postmanCollectionUrl}}",
    "description": "Parcel/document package signing flow. Sanitized public template: replace variables such as {{relyingPartyId}}, {{clientCertificate}}, {{callbackUrl}}, {{email}}, {{phone}}, {{personalIdentifier}}, {{documentBase64}} before use."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://cqes-rpuat.b-trust.bg"
    },
    {
      "key": "acceptLanguage",
      "value": "bg"
    },
    {
      "key": "relyingPartyId",
      "value": ""
    },
    {
      "key": "clientCertificate",
      "value": ""
    },
    {
      "key": "callbackUrl",
      "value": ""
    },
    {
      "key": "email",
      "value": ""
    },
    {
      "key": "phone",
      "value": ""
    },
    {
      "key": "personalIdentifier",
      "value": ""
    },
    {
      "key": "documentBase64",
      "value": ""
    },
    {
      "key": "uuid",
      "value": ""
    },
    {
      "key": "sessionId",
      "value": ""
    },
    {
      "key": "resultId",
      "value": ""
    },
    {
      "key": "signSessionId",
      "value": ""
    },
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "signatureId",
      "value": ""
    },
    {
      "key": "relyingPartyID",
      "value": "",
      "type": "string"
    },
    {
      "key": "X-CLIENT-CERT",
      "value": "",
      "type": "string"
    },
    {
      "key": "certId",
      "value": "",
      "type": "string"
    },
    {
      "key": "personalNumber",
      "value": "",
      "type": "string"
    },
    {
      "key": "documentNumber",
      "value": "",
      "type": "string"
    },
    {
      "key": "successUrl",
      "value": "",
      "type": "string"
    },
    {
      "key": "cancelUrl",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. Check client",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/sign/checkclient?countryCode=BG&personalIdentifier={{personalIdentifier}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "sign",
            "checkclient?countryCode=BG&personalIdentifier={{personalIdentifier}}"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "2. Send parcel sign request",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/sign/parcel",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "sign",
            "parcel"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"recipient\": {\n    \"email\": \"{{email}}\",\n    \"phone\": \"{{phone}}\",\n    \"personalIdentifier\": \"{{personalIdentifier}}\"\n  },\n  \"callbackUrl\": \"{{callbackUrl}}\",\n  \"documents\": [\n    {\n      \"fileName\": \"document.pdf\",\n      \"contentAsBase64\": \"{{documentBase64}}\",\n      \"mimeType\": \"APPLICATION_PDF\",\n      \"signatureType\": \"PADES_BASELINE_B\"\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "3. Get parcel details",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/sign/parcel/{{uuid}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "sign",
            "parcel",
            "{{uuid}}"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "4. Download signed parcel",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/sign/parcel/download?uuid={{uuid}}",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "sign",
            "parcel",
            "download?uuid={{uuid}}"
          ]
        },
        "description": ""
      },
      "response": []
    },
    {
      "name": "5. Reject parcel sign request",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept-language",
            "value": "{{acceptLanguage}}",
            "type": "text"
          },
          {
            "key": "relyingPartyID",
            "value": "{{relyingPartyId}}",
            "type": "text"
          },
          {
            "key": "X-CLIENT-CERT",
            "value": "{{clientCertificate}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "https://cqes-rpuat.b-trust.bg/signing-api/v2/sign/parcel/reject",
          "protocol": "https",
          "host": [
            "cqes-rpuat",
            "b-trust",
            "bg"
          ],
          "path": [
            "signing-api",
            "v2",
            "sign",
            "parcel",
            "reject"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"uuid\": \"{{uuid}}\",\n  \"reason\": \"Отказ на пратка\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    }
  ]
}