### JavaScript Tag with Dynamic Data for Coupon Tracking Source: https://document.a8.net/a8docs/a8-tracking/js-tracking/a8-js-tracking An example demonstrating how to dynamically set A8.net tracking parameters, including coupon codes, using JavaScript variables. ```javascript //A8.netのトラッキング用のタグです。削除する際はマーケティング担当に確認するようお願いします。 //▼ A8.netトラッキング用タグ ****************************************▼ //▲ A8.netトラッキング用タグ ****************************************▲ ``` -------------------------------- ### Bash Request Example for A8.net Sales API Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Demonstrates how to make a GET request to the A8.net sales API using curl to retrieve daily sealed sales data. Requires PROGRAM_ID and API_KEY. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_NO= OFFSET= LIMIT= curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/sealed/today?api_key=${API_KEY}&order_no=${ORDER_NO}&offset=${OFFSET}&limit=${LIMIT}" ``` -------------------------------- ### Get Unconfirmed Sales Data Example (Bash) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Example bash script using curl to fetch unconfirmed sales data from the A8.net EC Sales API. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" DATE=`date -d '1 day ago' +%Y%m%d` ORDER_NO="" OFFSET=0 LIMIT=3000 curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/unsealed?api_key=${API_KEY}&date=${DATE}&order_no=${ORDER_NO}&offset=${OFFSET}&limit=${LIMIT}" ``` -------------------------------- ### JavaScript Tag for Coupon Code Tracking Source: https://document.a8.net/a8docs/a8-tracking/js-tracking/a8-js-tracking Example of a JavaScript snippet to be placed on a completion page to track coupon code usage with A8.net's sales tracking script. ```javascript //A8.netのトラッキング用のタグです。削除する際はマーケティング担当に確認するようお願いします。 //▼ A8.netトラッキング用タグ ****************************************▼ //▲ A8.netトラッキング用タグ ****************************************▲ ``` -------------------------------- ### A8.net Sales Tracking Function Parameters Source: https://document.a8.net/a8docs/a8-tracking/js-tracking/a8-js-tracking Defines parameters for the A8.net sales tracking script, including how to pass coupon code information for conversion tracking. ```APIDOC a8sales(options) Adds conversion tracking data to A8.net. Parameters: options: Object - Configuration object for tracking. pid: string - Required. The program ID (PGID). order_number: string - Required. The order number. currency: string - Required. The currency code (e.g., JPY). coupon: string - Optional. The coupon code used. Max 50 bytes. items: array - Optional. An array of item objects. item: object code: string - Item code. price: number - Item unit price. quantity: number - Item quantity. total_price: number - Required. The total transaction amount. ``` -------------------------------- ### JSON Response Example for A8.net Sales API Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Illustrates the structure of a successful JSON response from the A8.net sales API, detailing sales records and item information. ```json { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "deide_ymd": "2021/12/29 09:24:25", "sales_ymd": "2021/12/28 07:20:05", "as_id": "a00000000000", "order_id": "150728157995", "order_no": "so8100201001-20211228-001", "decide_flg": 1, "del_flg": 2, "del_reason": 2, "order_count": 5, "order_money": 350, "pay_money": 35, "website_name": "テストサイト", "items": [ { "code": "si1-8100201001-20211228-001", "price": 50, "quantity": 3 }, { "code": "si1-8100201001-20211228-002", "price": 100, "quantity": 2 } ] } ] } ``` -------------------------------- ### A8.net Get Today's Sealed Sales Data API Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Retrieves a list of sales data that was sealed or canceled today. This is a GET request. It can retrieve up to 10,000 records at once; adjust the data retrieval start position parameter for more records. ```APIDOC GET /v2/ins/{PROGRAM_ID}/sealed/today Description: - Retrieves a list of sales data sealed or canceled on the current day. - Maximum 10,000 records can be retrieved at once. Adjust the data retrieval start position parameter if there are more than 10,000 records. Request Parameters: - PROGRAM_ID (URL, Required): Program ID issued by A8.net. Response Fields: - status_code (Number): Status code. - message (String): Message. Note: No specific sample code provided in the source text for this GET request. ``` -------------------------------- ### Fetch Sealed Sales Data (Bash) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 This script demonstrates how to fetch sealed sales data from the A8.net API using a GET request. It utilizes `curl` to send the request with necessary parameters like PROGRAM_ID, API_KEY, and date. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID= ORDER_NO= DATE=`date ‐d '1 day ago' +%Y%m%d` OFFSET= LIMIT= 3000 curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/sealed?api_key=${API_KEY}&order_id=${ORDER_ID}&date=${DATE}&offset=${OFFSET}&limit=${LIMIT}" ``` -------------------------------- ### API: Get Daily Confirmed Sales Count (Program ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Endpoint to retrieve the count of sales confirmed on the current day for a specific program. Requires PROGRAM_ID. GET request. ```APIDOC Endpoint: /v3/ins/{PROGRAM_ID}/sealed/today/count Method: GET Description: Retrieves the count of sales confirmed on the current day for a specific program ID. Only confirmed sales data is included. Parameters: - PROGRAM_ID (URL, Required): The advertiser's program ID issued by A8.net. Cannot be null or omitted. - api_key (GET, Required): The confirmed API authentication key linked to the program ID issued by A8.net. Cannot be null or omitted. Response Fields: - status_code (Number): Status code of the operation. Refer to the status code list. - message (String): Message indicating the result of the processing. - results (Array): - ins_id (String): Program ID. - count (Number): Number of sales confirmed for the day for the corresponding program. ``` -------------------------------- ### A8.net Tag: Handle Discounts with total_price Source: https://document.a8.net/a8docs/a8-tracking/js-tracking/a8-js-tracking Configure A8.net tracking tags to prioritize `total_price` for commission calculation when discounts are applied. This involves adding the `"amount_priority" : "total_price",` parameter to the script configuration. ```javascript a8sales({ "amount_priority" : "total_price", "pid": "プログラムID", "order_number": "御社側での注文情報を識別するID", "currency": "通貨コード", "items": [ { "code": "商品を識別するコード", "price": 価格, "quantity": 個数 }, { "code": "商品を識別するコード", "price": 価格, "quantity": 個数 }, ], "total_price": 合計金額 }); ``` ```javascript a8sales({ "amount_priority" : "total_price", "pid": "s00000000062001", "order_number": "testorder_01", "currency": "JPY", "items": [ { "code": "item_a", "price": 300, "quantity": 2 }, { "code": "item_b", "price": 200, "quantity": 1 }, ], "total_price": 700 }); ``` -------------------------------- ### Contact Form 7: Normal Setup for a8.net Sales Tracking Source: https://document.a8.net/a8docs/guide/linkage/contactform7-guide This setup integrates Contact Form 7 directly with a8.net for sales tracking. It involves adding a hidden field to capture a unique identifier and a JavaScript snippet that listens for the form submission event (`wpcf7mailsent`) to send sales data to a8.net. This is suitable when no separate thank you page is used for redirection. ```html [hidden customId id:_a8_uid] ``` ```javascript document.addEventListener( 'wpcf7mailsent', function( event ) { var inputs = event.detail.inputs; for ( var i = 0; i < inputs.length; i++ ) { if ( 'customId' == inputs[i].name ) { a8sales({ "pid": "s00000000062001", //適宜変更 "order_number": inputs[i].value, //そのまま "currency": "JPY", //適宜変更 "items": [ { "code": "001", //適宜変更 "price": 200, //適宜変更 "quantity": 2 //適宜変更 }, ], "total_price": 400 //適宜変更 }); break; } } }, false ); function getUniqueStr(myStrong){ var strong = 1000; if (myStrong) strong = myStrong; return new Date().getTime().toString(16) + Math.floor(strong*Math.random()).toString(16); }; document.getElementById("_a8_uid").value = getUniqueStr(); // Include the a8sales script in your HTML body // ``` -------------------------------- ### Get Daily Confirmed Sales Count (Program ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Bash script to fetch the count of sales confirmed on the current day for a specific program ID. Requires PROGRAM_ID and API_KEY. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/sealed/today/count?api_key=${API_KEY}" ``` -------------------------------- ### Get Sealed Sales Data Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Bash script to retrieve sealed sales data. Supports filtering by date, order ID, order number, and pagination with offset and limit. Requires PROGRAM_ID and API_KEY. ```bash #!/bin/bash PROGRAM_ID="s00008100201" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" # Optional parameters # DATE="20230101" # ORDER_ID="your_order_id" # ORDER_NO="your_order_no" # OFFSET="10001" # LIMIT="10000" curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/sealed?api_key=${API_KEY}" ``` -------------------------------- ### Contact Form 7: Thank You Page Setup for a8.net Sales Tracking Source: https://document.a8.net/a8docs/guide/linkage/contactform7-guide This setup is for Contact Form 7 when a separate thank you page is used for redirection after form submission. It involves two main parts: setting a unique order number in a cookie upon form submission, and then reading this cookie on the thank you page to send sales data to a8.net. This ensures sales data is captured even after redirection. ```javascript function getUniqueStr(myStrong){ var strong = 1000; if (myStrong) strong = myStrong; return new Date().getTime().toString(16) + Math.floor(strong*Math.random()).toString(16); }; var a8uidValue = document.getElementById("_a8_uid").value = getUniqueStr(); var expire = new Date(); expire.setTime( expire.getTime() + 1 * 30 * 24 * 60 * 60 * 1000 ); document.cookie = "_a8_orderno" + "=" + encodeURIComponent(a8uidValue) + '; path=/; expires=' + expire.toUTCString(); ``` ```javascript var cookies = document.cookie; var cookieItem = cookies.split(";"); var a8OrderNo = ""; for (i = 0; i < cookieItem.length; i++) { var elem = cookieItem[i].split("="); if (elem[0].trim() == "_a8_orderno") { var a8OrderNo = decodeURIComponent(elem[1]); a8sales({ "pid": "s00000000062001", //適宜変更 "order_number": a8OrderNo, //そのまま "currency": "JPY", "items": [ { "code": "a8", //適宜変更 "price": 200, //適宜変更 "quantity": 2 //適宜変更 }, ], "total_price": 400 //適宜変更 }); } else { continue; } var dt = new Date('1999-12-31T23:59:59Z'); document.cookie = "_a8_orderno=; expires=" + dt.toUTCString(); } // Include the a8sales script in your HTML body // ``` -------------------------------- ### Contact Form 7 Setup with A8 Integration Source: https://document.a8.net/a8docs/guide/linkage/contactform7-guide Configures a web form using Contact Form 7, including hidden fields for tracking and JavaScript for generating unique IDs and setting cookies for A8.net integration. This snippet sets up the form elements and client-side logic to prepare for A8 tracking. ```html [hidden customId id:_a8_uid] [submit "Send"] ``` -------------------------------- ### Get Unsealed Count (Program ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Retrieves the number of unsealed sales data for a specific program ID. Excludes confirmed sales data. Uses GET request. ```APIDOC GET /v3/ins/{PROGRAM_ID}/unsealed/count Description: Retrieves the number of unsealed sales data for a specific program ID. Confirmed sales data is not included. Request Parameters: PROGRAM_ID (URL, Required): Program ID issued by A8.net. Set after /v3/ins/. api_key (GET, Required): API authentication key linked to the program ID issued by A8.net. Response Fields: status_code (Number): Status code. Refer to the status code list. message (String): Message. results (Array): ins_id (String): Program ID. count (Number): Number of unsealed items for the program ID. Example Request: curl "https://ecsales-api.a8.net/v3/ins/s00008100201001/unsealed/count?api_key=abcdefghijklmnopqrstuvwxyz1234567890" Example Response: { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "ins_id": "s00008100201001", "count": 15 } ] } ``` ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" curl "https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/unsealed/count?api_key=${API_KEY}" ``` -------------------------------- ### Get Unsealed Count (Advertiser ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Retrieves a list of unsealed sales counts for each program under a specified advertiser ID. Excludes confirmed sales data. Uses GET request. ```APIDOC GET /v3/sp/{SP_ID}/unsealed/count Description: Retrieves a list of unsealed sales counts for each program under the advertiser. Confirmed sales data is not included. Request Parameters: SP_ID (URL, Required): Advertiser ID issued by A8.net. Set after /v3/sp/. api_key (GET, Required): API authentication key linked to the program ID issued by A8.net. Response Fields: status_code (Number): Status code. Refer to the status code list. message (String): Message. results (Array): ins_id (String): Program ID. count (Number): Number of unsealed items for the program ID. Example Request: curl "https://ecsales-api.a8.net/v3/sp/s00008100201/unsealed/count?api_key=abcdefghijklmnopqrstuvwxyz1234567890" Example Response: { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "ins_id": "s00008100201001", "count": 15 }, { "ins_id": "s00008100201002", "count": 14 } ] } ``` ```bash #!/bin/bash SP_ID="s00008100201" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" curl "https://ecsales-api.a8.net/v3/sp/${SP_ID}/unsealed/count?api_key=${API_KEY}" ``` -------------------------------- ### API: Get Sealed Sales Data Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Endpoint to retrieve sealed sales data. GET request. Retrieves confirmed data that was sealed or canceled on or before the specified date (yesterday or earlier). Data older than 91 days cannot be retrieved. Max 10,000 records per request. ```APIDOC Endpoint: /v3/ins/{PROGRAM_ID}/sealed Method: GET Description: Retrieves sealed sales data. This endpoint fetches confirmed data that was sealed or canceled on or before the specified date. Data older than 91 days is not available. If no date is specified, it retrieves all data from yesterday or earlier. A maximum of 10,000 confirmed data records can be retrieved at once; use the offset parameter for more. Parameters: - PROGRAM_ID (URL, Required): The program ID issued by A8.net. Must be set after /v3/ins/. - api_key (GET, Required): The confirmed API authentication key linked to the program ID issued by A8.net. - date (GET, Optional): Confirmation date in yyyyMMdd format. If omitted, retrieves all data from yesterday or earlier. - order_id (GET, Optional): Order ID issued by A8.net, the unique key for sales data. - order_no (GET, Optional): Order (application) number issued by your system for each application. - offset (GET, Optional): Data retrieval start position. Defaults to 0. Allows fetching data from a specific position (e.g., from the 10001st record). - limit (GET, Optional): Data retrieval count specification. Defaults to 10000. Allows specifying a count within 10000. Response Fields: - status_code (Number): Status code. Refer to the status code list. - message (String): Message indicating the result of the processing. - results (Array): - deide_ymd (String): Confirmation date in yyyy/MM/dd format. - sales_ymd (String): Sales occurrence date in yyyy/MM/dd format. - as_id (String): Media ID managed by A8.net. - order_id (String): Order ID, the unique key for sales data issued by A8.net. - order_no (String): Order (application) number issued by your system for each application. - decide_flg (Number): Confirmation flag (0=Unconfirmed, 1=Confirmed). - order_count (Number): Number of orders. - order_money (Number): Order amount. - pay_money (Number): Commission amount. - website_name (String): Main website name of the media. ``` -------------------------------- ### API: Get Daily Confirmed Sales Count (Advertiser ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Endpoint to retrieve the count of sales confirmed on the current day for a specific advertiser (SP_ID). Requires SP_ID. GET request. ```APIDOC Endpoint: /v3/sp/{SP_ID}/sealed/today/count Method: GET Description: Retrieves the count of sales confirmed on the current day for a specific advertiser (SP_ID). Only confirmed sales data is included. Parameters: - SP_ID (URL, Required): The advertiser ID issued by A8.net. Cannot be null or omitted. - api_key (GET, Required): The confirmed API authentication key linked to the program ID issued by A8.net. Cannot be null or omitted. Response Fields: - status_code (Number): Status code of the operation. Refer to the status code list. - message (String): Message indicating the result of the processing. - results (Array): - ins_id (String): Program ID. - count (Number): Number of sales confirmed on the day for the corresponding program. ``` -------------------------------- ### Get Daily Confirmed Sales Count (Advertiser ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Bash script to fetch the count of sales confirmed on the current day for a specific advertiser (SP_ID). Requires SP_ID and API_KEY. ```bash #!/bin/bash SP_ID="s00008100201" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" curl "https://ecsales-api.a8.net/v3/sp/${SP_ID}/sealed/today/count?api_key=${API_KEY}" ``` -------------------------------- ### A8.net Tag: Stop Console Logging Source: https://document.a8.net/a8docs/a8-tracking/js-tracking/a8-js-tracking Disable console log output from A8.net tracking scripts by adding the `data-a8stoplog="1"` attribute to the script tags. ```javascript ``` ```javascript ``` -------------------------------- ### Fetch Today's Sealed Sales Data (Bash) Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Fetches today's confirmed sales data from the A8.net API using a bash script. Requires PROGRAM_ID and API_KEY. Supports optional ORDER_NO and OFFSET parameters for filtering and pagination. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_NO="" OFFSET="" curl "https://ecsales-api.a8.net/v2/ins/${PROGRAM_ID}/sealed/today?api_key=${API_KEY}&order_no=${ORDER_NO}&offset=${OFFSET}" ``` -------------------------------- ### A8.net Sales Data API Reference Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Comprehensive API documentation for A8.net sales data operations, including modifying, confirming, and canceling sales, as well as retrieving daily sealed data. Details parameters, request/response formats, and usage. ```APIDOC API Endpoints for A8.net Sales Data Management: 1. **Modify Sales Data** * **Endpoint**: POST /v3/ins/{PROGRAM_ID}/order/{ORDER_ID}/modify * **Description**: Modifies sales data for a specific order. Allows updating item details like code, price, quantity, and reason code. * **Request Parameters**: * `PROGRAM_ID` (URL, Required): Program ID issued by A8.net. * `api_key` (JSON, Required): API authentication key tied to the program ID. * `order_id` (URL, Required): Unique key for sales data from A8.net. * `items` (JSON, Required): An array of item details. Each item object must contain: * `code` (JSON, Required): Code to identify the product in your system. * `price` (JSON, Optional): Unit price. Either `price` or `quantity` must be provided. * `quantity` (JSON, Optional): Number of items. Either `price` or `quantity` must be provided. * `reason_code` (JSON, Required): Code indicating the reason for modification (1: Out of stock, 2: Return, 3: Additional order, 4: Order amount change, 5: Unit price change, 6: Other). * **Response Fields**: * `status_code` (Number): Status code of the operation. * `message` (String): Message describing the result of the operation. * **Example Request Body**: ```json { "api_key": "YOUR_API_KEY", "items": [ { "code": "item123", "price": 100, "quantity": 2, "reason_code": 1 }, { "code": "item456", "price": 150, "quantity": 0, "reason_code": 2 } ] } ``` 2. **Confirm Sales Data (Decide)** * **Endpoint**: POST /v3/ins/{PROGRAM_ID}/order/{ORDER_ID}/decide * **Description**: Confirms a single unconfirmed sales record. This operation changes the status of the sales data to confirmed. * **Request Parameters**: * `PROGRAM_ID` (URL, Required): Program ID issued by A8.net. * `api_key` (JSON, Required): API authentication key tied to the program ID. * `order_id` (URL, Required): Unique key for sales data from A8.net. * **Response Fields**: * `status_code` (Number): Status code of the operation. * `message` (String): Message describing the result of the operation. * **Example Request Body**: ```json { "api_key": "YOUR_API_KEY" } ``` 3. **Cancel Sales Data** * **Endpoint**: POST /v3/ins/{PROGRAM_ID}/order/{ORDER_ID}/cancel * **Description**: Cancels a single unconfirmed sales record. Requires a reason code for the cancellation. * **Request Parameters**: * `PROGRAM_ID` (URL, Required): Program ID issued by A8.net. * `api_key` (JSON, Required): API authentication key tied to the program ID. * `order_id` (URL, Required): Unique key for sales data from A8.net. * `reason_code` (JSON, Required): Code indicating the reason for cancellation (1: Out of stock, 2: Return, 3: Additional order, 4: Order amount change, 5: Unit price change, 6: Other). * **Response Fields**: * `status_code` (Number): Status code of the operation. * `message` (String): Message describing the result of the operation. * **Example Request Body**: ```json { "api_key": "YOUR_API_KEY", "reason_code": 1 } ``` 4. **Get Today's Sealed Sales Data** * **Endpoint**: GET /v3/sealed/today * **Description**: Retrieves a list of sales data that were confirmed or canceled on the current day. A maximum of 10,000 records can be retrieved at once; use parameters to paginate if more data is available. * **Query Parameters**: * `PROGRAM_ID` (URL, Required): Program ID issued by A8.net. * `api_key` (URL, Required): API authentication key tied to the program ID. * `start_position` (URL, Optional): Parameter to change the data retrieval start position for fetching more than 10,000 records. * **Response Fields**: * `status_code` (Number): Status code of the operation. * `message` (String): Message describing the result of the operation. * (Additional fields for sales data list would be present here, not detailed in the source text). * **Note**: The source text does not provide a full example request or response body for this endpoint, only its description and purpose. ``` -------------------------------- ### A8.net Order Decide API Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Confirms a single pending sales data record. This is a POST request requiring the program ID, API key, and order ID. ```APIDOC POST /v2/ins/{PROGRAM_ID}/order/{ORDER_ID}/decide Description: - Uses JSON data for POST processing. - Confirms one pending sales data record. Request Parameters: - PROGRAM_ID (URL, Required): Program ID issued by A8.net. - api_key (JSON, Required): API authentication key linked to the program ID issued by A8.net. - order_id (URL, Required): Unique key for sales data issued by A8.net. Response Fields: - status_code (Number): Status code. - message (String): Message. Notes: - PROGRAM_ID must be set after /ins/. Null or omission is not allowed. - api_key cannot be null or omitted. - order_id cannot be null or omitted. - The URL must end with /decide. Example Request: ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 JSONREQ="{\"api_key\":\"${API_KEY}\"}" curl -X POST -H "Content‐type: application/json" -d "${JSONREQ}" "https://ecsales ‐api.a8.net/v2/ins/${PROGRAM_ID}/order/${ORDER_ID}/decide" ``` Example Response: ```json { "status_code": 10000, "message": "処理が成功しました。" } ``` ``` -------------------------------- ### Response for Daily Confirmed Sales Count (Program ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 JSON response structure for the daily confirmed sales count API, indicating status, message, and results including ins_id and count. ```json { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "ins_id":"s00008100201001", "count":15 } ] } ``` -------------------------------- ### Confirm Sales Data (Bash/curl) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 This snippet shows how to confirm a single unconfirmed sales record using a bash script and curl. It requires the program ID, API key, and order ID to process the POST request. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 JSONREQ="{\"api_key\":\"${API_KEY}\"}" curl ‐X POST ‐H "Content‐type: application/json" ‐d "${JSONREQ}" "https://ecsales‐api.a8.net/v3/ins/${PROGRAM_ID}/order/${ORDER_ID}/decide" ``` -------------------------------- ### Response for Daily Confirmed Sales Count (Advertiser ID) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 JSON response structure for the daily confirmed sales count API by advertiser, showing status, message, and results with ins_id and count. ```json { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "ins_id":"s00008100201001", "count":15 }, { "ins_id":"s00008100201002", "count":14 } ] } ``` -------------------------------- ### Revive Sales Data (Bash) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 This script shows how to perform a revival operation on sales data using a POST request to the A8.net API. It allows changing the confirmed status of a sales record back to unconfirmed for the current day's data. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 JSONREQ="{\"api_key\":\"${API_KEY}\"}" curl ‐X POST ‐H "Content‐type: application/json" ‐d "${JSONREQ}" "https://ecsales‐api.a8.net/v3/ins/${PROGRAM_ID}/order/${ORDER_ID}/revival" ``` -------------------------------- ### A8.net Order Modify API Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Allows modification of existing sales order data. Requires program ID, API key, order ID, and item details including code, price, quantity, and reason code. Supports updating item prices and quantities. ```APIDOC POST /v2/ins/{PROGRAM_ID}/order/{ORDER_ID}/modify Request Parameters: - api_key (JSON, Required): API authentication key issued by A8.net. - order_id (URL, Required): Unique key for sales data issued by A8.net. - items (JSON, Required): Array of item details. - code (JSON, Required): Company system's product code. - price (JSON, Optional): Unit price. Either 'price' or 'quantity' is required. - quantity (JSON, Optional): Number of items. Either 'price' or 'quantity' is required. - reason_code (JSON, Required): Reason code for modification (1: Out of stock, 2: Return, 3: Additional order, 4: Order amount change, 5: Unit price change, 6: Other). Response Fields: - status_code (Number): Status code (refer to status code list). - message (String): Message. Example Request: ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 ITEM_CODE_1="si1‐8100201001‐20211229‐001" PRICE_1=100 QUANTITY_1=2 REASON_1=1 ITEM_CODE_2="si1‐8100201001‐20211229‐002" PRICE_2=150 QUANTITY_2=0 REASON_2=2 JSONREQ="{\"api_key\":\"${API_KEY}\", \"items\":[ {\"code\": \"${ITEM_CODE_1}\”,\”price\":\"${PRICE_1}\", \"quantity\":\"${QUANTITY_1}\", \"reason_code\":\"${REASON_1}\”}, {\"code\": \"${ITEM_CODE_2}\”,\”price\":\"${PRICE_2}\", \"quantity\":\"${QUANTITY_2}\", \"reason_code\":\"${REASON_2}\”} ]}" curl -X POST -H "Content - type: application/json" -d "${JSONREQ}" "https://ecsales - api.a8.net/v2/ins/${PROGRAM_ID}/order/${ORDER_ID}/modify" ``` Example Response: ```json { "status_code": 10000, "message": "処理が成功しました。" } ``` ``` -------------------------------- ### A8.net Order Cancel API Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Cancels a single pending sales data record. This is a POST request requiring the program ID, API key, order ID, and a reason code. ```APIDOC POST /v2/ins/{PROGRAM_ID}/order/{ORDER_ID}/cancel Description: - Uses JSON data for POST processing. - Cancels one pending sales data record. Request Parameters: - PROGRAM_ID (URL, Required): Program ID issued by A8.net. - api_key (JSON, Required): API authentication key linked to the program ID issued by A8.net. - order_id (URL, Required): Unique key for sales data issued by A8.net. - reason_code (JSON, Required): Reason code for cancellation (1: Out of stock, 2: Return, 3: Additional order, 4: Order amount change, 5: Unit price change, 6: Other). Response Fields: - status_code (Number): Status code. - message (String): Message. Example Request: ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 REASON=1 JSONREQ="{\"api_key\":\"${API_KEY}\", \"reason_code\":\"${REASON}\"}" curl -X POST -H "Content‐type: application/json" -d "${JSONREQ}" "https://ecsales -api.a8.net/v2/ins/${PROGRAM_ID}/order/${ORDER_ID}/cancel" ``` Example Response: ```json { "status_code": 10000, "message": "処理が成功しました。" } ``` ``` -------------------------------- ### Revive (Cancel) Same-Day Sales Data (Bash) Source: https://document.a8.net/a8docs/ecsales-api/v2/ecsales-api-v2 Cancels the confirmed status of a single sales data entry from the same day using a POST request to the A8.net API. Requires PROGRAM_ID and ORDER_ID. The API key is sent in the JSON body. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID="150729160161" JSONREQ="{\"api_key\":\"${API_KEY}\"}" curl -X POST -H "Content-type: application/json" -d "${JSONREQ}" "https://ecsales-api.a8.net/v2/ins/${PROGRAM_ID}/order/${ORDER_ID}/revival" ``` -------------------------------- ### Response for Sealed Sales Data Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 JSON response structure for sealed sales data, including status, message, and a list of sales records with details like deide_ymd, sales_ymd, order_id, and amounts. ```json { "status_code": 10000, "message": "処理が成功しました。", "results": [ { "deide_ymd": "2023/01/01", "sales_ymd": "2022/12/31", "as_id": "media123", "order_id": "a8_order_xyz", "order_no": "company_order_123", "decide_flg": 1, "order_count": 1, "order_money": 5000, "pay_money": 500, "website_name": "Example Media" } ] } ``` -------------------------------- ### Modify Sales Data (Bash/curl) Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 This snippet demonstrates how to modify sales data for a specific order using a bash script and curl. It includes parameters for program ID, API key, order ID, item details (code, price, quantity), and reason code. ```bash #!/bin/bash PROGRAM_ID="s00008100201001" API_KEY="abcdefghijklmnopqrstuvwxyz1234567890" ORDER_ID=150729160161 ITEM_CODE_1=si1‐8100201001‐20211229‐001 PRICE_1=100 QUANTITY_1=2 REASON_1=1 ITEM_CODE_2=si1‐8100201001‐20211229‐002 PRICE_2=150 QUANTITY_2=0 REASON_2=2 JSONREQ="{\"api_key\":\"${API_KEY}\", \"items\":[ {\"code\": \"${ITEM_CODE_1}\",\"price\":\"${PRICE_1}\", \"quantity\":\"${QUANTITY_1}\", \"reason_code\":\"${REASON_1}\"}, {\"code\": \"${ITEM_CODE_2}\",\"price\":\"${PRICE_2}\", \"quantity\":\"${QUANTITY_2}\", \"reason_code\":\"${REASON_2}\"} ]}" curl ‐X POST ‐H "Content‐type: application/json" ‐d "${JSONREQ}" "https://ecsales‐api.a8.net/v3/ins/${PROGRAM_ID}/order/${ORDER_ID}/modify" ``` -------------------------------- ### A8.net EC Sales API - Confirmation/Cancellation Endpoints Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Details endpoints for modifying, confirming, canceling, and reviving sales data. These operations are performed via POST requests to a specific order ID. ```APIDOC Base URL for specific order operations: https://ecsales-api.a8.net/v3/ins/${PROGRAM_ID}/order/${ORDER_ID} Processing Endpoints (POST): 1. **Sales Modification Processing** * POST /modify * Performs modification processing for sales data. 2. **Sales Confirmation Processing** * POST /decide * Performs confirmation processing for sales data. 3. **Sales Cancellation Processing** * POST /cancel * Performs cancellation processing for sales data. 4. **Today's Sealed Cancellation Processing** * POST /revival * Performs revival processing for today's sealed cancellation. Notes: * ${PROGRAM_ID} is the program ID issued by A8.net. * ${ORDER_ID} is the unique key for sales data issued by A8.net. * API authentication key is required for these operations. * Availability of confirmation APIs may be affected during daily processing (UTC+9, 23:30 - 01:00). * Access from registered IPs only is permitted. ``` -------------------------------- ### A8.net EC Sales API - List Retrieval Endpoints Source: https://document.a8.net/a8docs/ecsales-api/v3/ecsales-api-v3 Provides details on endpoints for retrieving various sales lists, including unconfirmed, today's confirmed, and previous confirmed sales data. Supports filtering by program ID, advertiser ID, date, and order details. ```APIDOC Base URL: https://ecsales-api.a8.net/v3 List Retrieval Endpoints: 1. **Unconfirmed Sales Data Retrieval** * GET /ins/${PROGRAM_ID}/unsealed * Retrieves a list of unconfirmed sales data for a specific program. * Parameters: * PROGRAM_ID (URL, Required): Program ID issued by A8.net. * api_key (GET, Required): API authentication key linked to the program ID. * date (GET, Optional): Sales occurrence date in yyyyMMdd format. If not specified, retrieves all data. * order_id (GET, Optional): Unique key for sales data issued by A8.net. * order_no (GET, Optional): Company system's order (application) number for each application. * offset (GET, Optional): Data retrieval start position (default: 0). Allows retrieving data from an arbitrary position. * limit (GET, Optional): Number of data items to retrieve (default: 10000). Can specify up to 10000 items. * optional_fields (GET, Optional): Specify return of optional response fields (e.g., order_click_date). * Response Fields: * status_code (Number) * message (String) * results (Array): * sales_ymd (String): Sales occurrence date (yyyy/MM/dd HH:MI:SS). * order_click_date (String, Optional): Click date/time (yyyy/MM/dd HH:MI:SS). Included if specified in optional_fields. * as_id (String): Media ID managed by A8.net. * order_id (String): Unique key for sales data issued by A8.net. * order_no (String): Company system's order (application) number. * decide_flg (Number): Confirmation flag (0=Unconfirmed, 1=Confirmed). * order_count (Number): Total order quantity. * order_money (Number): Total order amount. * pay_money (Number): Total successful reward amount. * website_name (String): Main website name of the media. * items (Array): * code (String): Product code issued by the company system. * price (Number): Product unit price. * reward_fair_money (Number): Reward-eligible sales amount per product. * pay_money (Number): Successful reward amount per product. * quantity (Number): Product quantity. 2. **Unconfirmed Count Retrieval** * GET /ins/${PROGRAM_ID}/unsealed/count * Retrieves the count of unconfirmed sales data for a specific program. * GET /sp/${SP_ID}/unsealed/count * Retrieves the count of unconfirmed sales data for all programs under an advertiser. 3. **Today's Confirmed Sales Data Retrieval** * GET /ins/${PROGRAM_ID}/sealed/today * Retrieves a list of sales data confirmed today for a specific program. * GET /ins/${PROGRAM_ID}/sealed/today/count * Retrieves the count of sales data confirmed today for a specific program. * GET /sp/${SP_ID}/sealed/today/count * Retrieves the count of sales data confirmed today for all programs under an advertiser. 4. **Yesterday or Earlier Confirmed Sales Data Retrieval** * GET /ins/${PROGRAM_ID}/sealed * Retrieves a list of sales data confirmed yesterday or earlier for a specific program. Notes: * ${PROGRAM_ID} should be the program ID issued by A8.net. * ${SP_ID} should be the advertiser ID issued by A8.net. * Maximum retrieval is 10,000 items. Use the offset parameter for more. * API authentication key is required. ```