CStoreOffice® Support & Learning

Calling the Business Documents API

Calls to the Business Documents API must be authorized. Before making an API request, make sure you have received the authorization token. For more information, see Getting API Authorization Data.

Authorizing in the Business Documents API

To get authorized in the Business Documents API:

  1. Go to the Business Documents API:
    https://api-docs.petrosoft.cloud/?service=aws_integration_service
  2. Click the Authorize button.

  3. In the Available authorizations window, enter the authorization token. Take the value from the access_token parameter. For more information, see Getting the Authorization Token.
  4. Click Authorize.

  5. Make sure all authorize icons are locked. It means that you have been successfully authorized in the API.

Calling the Business Documents API

Depending on the level at which you are going to receive the data, you can call API in the following ways:

Calling the Business Documents API at the Account Level

To receive the documents via the Business Documents API at the account level:

  1. Select the type of the documents you need.
  2. Expand the /account-level-resources endpoint.
  3. Click Try it out.
  4. In the Parameters section > Document type identifier list, select the documentType and click Execute.
    The following document types can be selected:
  • price-book-item
  • categories
  • departments
  • price-groups
  • item-tags

    For more information about the XML documents exported depending on the selected Document type identifier, see Exported XML Files.

  1. In the Responses section > Response body field, check the list of available resources.

    You will need to use a certain resource value without the quotes. For example, master-data/20211026/ from the first line in the image above.

  2. Request the list of available documents.
  3. Expand the /business-documents endpoint.
  4. Click Try it out.
  5. In the Parameters section > Resource identifier field, enter the resource value received at the Step 1.d. above and click Execute.

  6. In the Responses section > Response body field, check the list of available documents.

    You will need to use the path value without the quotes. For example, master-data/20211026/price-book-item_20211026T044006-781024751.zip from the first line in the image above.

  7. Receive a certain document.
  8. Expand the /business-document endpoint.
  9. Click Try it out.
  10. In the Parameters section > Path to final document field, enter the path value received at the Step 2.d. above and click Execute.

  11. In the Responses section, Curl and Request URL fields, receive the final destination from where the requested document can be downloaded.

Calling the Business Documents API at the Business Unit Level

You can receive the documents at the following business levels:

  • At the station (location) level: Prepare the station (location) identifier as the input data.
  • At the company level: Prepare the company identifier as the input data.

To learn how to retrieve the station (location) or company identifiers from CStoreOffice®, see Preparing the Input Parameters for API Request.

To receive the documents via the Business Documents API at the business unit level:

  1. Select the type of the documents you need.
  2. Expand the /business-unit-level-resources endpoint.
  3. Click Try it out.
  4. In the Parameters section:
  5. In the Document type identifier list, select the documentType. The following document types can be selected:
    - cost-of-goods-sold
    - inventory-item
    - pos-journal-report
    - shift_fuel-grade-movement
    - shift_item-sales-movement
    - shift_merchandise-code-movement
    - shift_miscellaneous-summary-movement
    - invoice
    - general-journal-report
  1. In the Unique identifier of company or location field, enter the company or station (location) identifier value.
  2. Click Execute.

    For more information about the XML documents exported depending on the selected Document type identifier, see Exported XML Files.

  3. In the Responses section > Response body field, check the list of available resources.

    You will need to use a certain resource value without the quotes. For example, 2879/cost-of-goods-sold-data/20211023/ from the first line in the image above.

  4. Request the list of available documents.
  5. Expand the /business-documents endpoint.
  6. Click Try it out.
  7. In the Parameters section > Resource identifier field, enter the resource value received at the Step 1.d. above and click Execute.

  8. In the Responses section > Response body field, check the list of available documents.

    You will need to use the path value without the quotes. For example, 2879/cost-of-goods-sold-data/20211023/cost-of-goods-sold_20211023T000000.zip from the first line in the image above.

  9. Receive a certain document.
  10. Expand the /business-document endpoint.
  11. Click Try it out.
  12. In the Parameters section > Path to final document field, enter the path value received at the Step 2.d. above and click Execute.

  13. In the Responses section, Curl and Request URL fields, receive the final destination from where the requested document can be downloaded.