Chilkat Online Tools

DataFlex / Egyptian eInvoicing SDK R1.5 / 6. Get Receipt Submission

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "DocumentId" "a9d6831c554702f36fd782964ad1b4738f83ea2705eafe28d48d2cf64b331af0" To iSuccess
    Get ComUpdateString Of hoQueryParams "ReceiptNumber" "1234566788" To iSuccess
    Get ComUpdateString Of hoQueryParams "DocumentTypeCode" "R" To iSuccess
    Get ComUpdateString Of hoQueryParams "DocumentTypeName" "Return Receipt" To iSuccess
    Get ComUpdateString Of hoQueryParams "DocumentTypeVersionNumber" "1.1" To iSuccess
    Get ComUpdateInt Of hoQueryParams "ReceiverId" 113317713 To iSuccess
    Get ComUpdateString Of hoQueryParams "ReceiverName" "Taxpayer1" To iSuccess
    Get ComUpdateString Of hoQueryParams "Status" "Valid" To iSuccess
    Get ComUpdateString Of hoQueryParams "SortBy" "DateTimeReceived" To iSuccess
    Get ComUpdateString Of hoQueryParams "SortDir" "Asc" To iSuccess
    Get ComUpdateInt Of hoQueryParams "PageNo" 1 To iSuccess
    Get ComUpdateInt Of hoQueryParams "PageSize" 10 To iSuccess

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://domain.com/api/v1/receiptsubmissions/:submissionUuid/details" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -G -d "DocumentId=a9d6831c554702f36fd782964ad1b4738f83ea2705eafe28d48d2cf64b331af0"
	-d "ReceiptNumber=1234566788"
	-d "DocumentTypeCode=R"
	-d "DocumentTypeName=Return%20Receipt"
	-d "DocumentTypeVersionNumber=1.1"
	-d "ReceiverId=113317713"
	-d "ReceiverName=Taxpayer1"
	-d "Status=Valid"
	-d "SortBy=DateTimeReceived"
	-d "SortDir=Asc"
	-d "PageNo=1"
	-d "PageSize=10"
	-H "Authorization: Bearer <access_token>"
https://domain.com/api/v1/receiptsubmissions/:submissionUuid/details

Postman Collection Item JSON

{
  "name": "6. Get Receipt Submission",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{generatedAccessToken}}",
          "type": "string"
        }
      ]
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{apiBaseUrl}}/api/v1/receiptsubmissions/:submissionUuid/details?DocumentId=a9d6831c554702f36fd782964ad1b4738f83ea2705eafe28d48d2cf64b331af0&ReceiptNumber=1234566788&DocumentTypeCode=R&DocumentTypeName=Return Receipt&DocumentTypeVersionNumber=1.1&ReceiverId=113317713&ReceiverName=Taxpayer1&Status=Valid&SortBy=DateTimeReceived&SortDir=Asc&PageNo=1&PageSize=10",
      "host": [
        "{{apiBaseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "receiptsubmissions",
        ":submissionUuid",
        "details"
      ],
      "query": [
        {
          "key": "DocumentId",
          "value": "a9d6831c554702f36fd782964ad1b4738f83ea2705eafe28d48d2cf64b331af0"
        },
        {
          "key": "ReceiptNumber",
          "value": "1234566788"
        },
        {
          "key": "DocumentTypeCode",
          "value": "R"
        },
        {
          "key": "DocumentTypeName",
          "value": "Return Receipt"
        },
        {
          "key": "DocumentTypeVersionNumber",
          "value": "1.1"
        },
        {
          "key": "ReceiverId",
          "value": "113317713"
        },
        {
          "key": "ReceiverName",
          "value": "Taxpayer1"
        },
        {
          "key": "Status",
          "value": "Valid"
        },
        {
          "key": "SortBy",
          "value": "DateTimeReceived"
        },
        {
          "key": "SortDir",
          "value": "Asc"
        },
        {
          "key": "PageNo",
          "value": "1"
        },
        {
          "key": "PageSize",
          "value": "10"
        }
      ],
      "variable": [
        {
          "key": "submissionUuid",
          "value": "RAQTYQ327VC4Q9170KJYMG5G10",
          "description": "(Required) "
        }
      ]
    }
  },
  "response": [
  ]
}