Chilkat Online Tools

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

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW queryParams;
    HCkHttpResponseW resp;

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

    http = CkHttpW_Create();

    queryParams = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(queryParams,L"DocumentId",L"a9d6831c554702f36fd782964ad1b4738f83ea2705eafe28d48d2cf64b331af0");
    CkJsonObjectW_UpdateString(queryParams,L"ReceiptNumber",L"1234566788");
    CkJsonObjectW_UpdateString(queryParams,L"DocumentTypeCode",L"R");
    CkJsonObjectW_UpdateString(queryParams,L"DocumentTypeName",L"Return Receipt");
    CkJsonObjectW_UpdateString(queryParams,L"DocumentTypeVersionNumber",L"1.1");
    CkJsonObjectW_UpdateInt(queryParams,L"ReceiverId",113317713);
    CkJsonObjectW_UpdateString(queryParams,L"ReceiverName",L"Taxpayer1");
    CkJsonObjectW_UpdateString(queryParams,L"Status",L"Valid");
    CkJsonObjectW_UpdateString(queryParams,L"SortBy",L"DateTimeReceived");
    CkJsonObjectW_UpdateString(queryParams,L"SortDir",L"Asc");
    CkJsonObjectW_UpdateInt(queryParams,L"PageNo",1);
    CkJsonObjectW_UpdateInt(queryParams,L"PageSize",10);

    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttpW_putAuthToken(http,L"<access_token>");

    resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://domain.com/api/v1/receiptsubmissions/:submissionUuid/details",queryParams);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        return;
    }

    wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
    wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
    CkHttpResponseW_Dispose(resp);


    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);

    }

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": [
  ]
}