売上詳細取得
curl --request GET \
--url https://api.utage-system.com/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.utage-system.com/v1/purchases/{purchase_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.utage-system.com/v1/purchases/{purchase_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.utage-system.com/v1/purchases/{purchase_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.utage-system.com/v1/purchases/{purchase_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.utage-system.com/v1/purchases/{purchase_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/purchases/{purchase_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"sales_type": "product",
"created_at": "<string>",
"updated_at": "<string>",
"product": {
"id": "<string>",
"name": "<string>"
},
"product_detail": {
"id": "<string>",
"name": "<string>"
},
"event": "<unknown>",
"amount": 123,
"payment_type": "credit_card",
"payment_provider": "none",
"status": "paid",
"is_test_mode": true,
"payment_date": "<string>",
"payment_processed_at": "<string>",
"bank_account": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>",
"account_type": "savings",
"account_number": "<string>",
"account_holder": "<string>"
},
"coupon": {
"name": "<string>",
"discount_amount": 123,
"discount_percentage": 123,
"original_amount": 123
},
"customer": {
"name": "<string>",
"mail": "<string>",
"phone": "<string>",
"zipcode": "<string>",
"pref": "<string>",
"city": "<string>",
"address": "<string>",
"building": "<string>"
},
"tracking_name": "<string>",
"first_step_tracking_name": "<string>",
"referer": "<string>",
"ip": "<string>",
"device": "mobile",
"user_agent": "<string>",
"partner": {
"name": "<string>",
"project_name": "<string>",
"reward": 123
},
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}売上
売上詳細取得
売上の詳細(管理画面「売上詳細」と「領収書・請求書設定」の内容)を取得します。一覧の項目に加えて、決済代行会社・入金日・入金反映日時・振込先口座・クーポン・登録元ページURL・IP・端末・端末詳細・パートナー(案件名・報酬を含む)・領収書・請求書設定(business_id / receipt_name / receipt_description)を返します。
対象は商品の売上だけで、sales_type は常に product です。イベントの入金行の id や、商品・商品詳細・購入者のいずれかが無い売上は 404 です。
売上詳細取得
curl --request GET \
--url https://api.utage-system.com/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.utage-system.com/v1/purchases/{purchase_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.utage-system.com/v1/purchases/{purchase_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.utage-system.com/v1/purchases/{purchase_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.utage-system.com/v1/purchases/{purchase_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.utage-system.com/v1/purchases/{purchase_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/purchases/{purchase_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"sales_type": "product",
"created_at": "<string>",
"updated_at": "<string>",
"product": {
"id": "<string>",
"name": "<string>"
},
"product_detail": {
"id": "<string>",
"name": "<string>"
},
"event": "<unknown>",
"amount": 123,
"payment_type": "credit_card",
"payment_provider": "none",
"status": "paid",
"is_test_mode": true,
"payment_date": "<string>",
"payment_processed_at": "<string>",
"bank_account": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>",
"account_type": "savings",
"account_number": "<string>",
"account_holder": "<string>"
},
"coupon": {
"name": "<string>",
"discount_amount": 123,
"discount_percentage": 123,
"original_amount": 123
},
"customer": {
"name": "<string>",
"mail": "<string>",
"phone": "<string>",
"zipcode": "<string>",
"pref": "<string>",
"city": "<string>",
"address": "<string>",
"building": "<string>"
},
"tracking_name": "<string>",
"first_step_tracking_name": "<string>",
"referer": "<string>",
"ip": "<string>",
"device": "mobile",
"user_agent": "<string>",
"partner": {
"name": "<string>",
"project_name": "<string>",
"reward": 123
},
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}