売上の領収書・請求書設定更新
curl --request PATCH \
--url https://api.utage-system.com/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/purchases/{purchase_id}"
payload = {
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '<string>',
receipt_name: '<string>',
receipt_description: '<string>'
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'business_id' => '<string>',
'receipt_name' => '<string>',
'receipt_description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.utage-system.com/v1/purchases/{purchase_id}"
payload := strings.NewReader("{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.utage-system.com/v1/purchases/{purchase_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}")
.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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}"
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": "bad_request",
"message": "事業者設定が登録されていないため領収書・請求書設定を変更できません"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "validation_error",
"message": "入力内容に誤りがあります",
"details": {
"business_id": [
"指定された事業者設定が存在しません"
]
}
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}売上
売上の領収書・請求書設定更新
売上の領収書・請求書設定(管理画面の操作メニュー「領収書・請求書設定」: 事業者・宛名・領収書の但し書き)を更新します。指定したフィールドのみを更新する部分更新です。business_id に null を指定するとデフォルトの事業者に戻し、receipt_name / receipt_description に null を指定すると未設定に戻します。
決済失敗の売上・金額が 0 円の売上、および事業者設定が登録されていないアカウントでは 400(bad_request)です(管理画面でも操作できません)。存在しない事業者設定IDは 422(validation_error)です。イベントの入金行の id や、商品・商品詳細・購入者のいずれかが無い売上は 404 です。
売上の領収書・請求書設定更新
curl --request PATCH \
--url https://api.utage-system.com/v1/purchases/{purchase_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/purchases/{purchase_id}"
payload = {
"business_id": "<string>",
"receipt_name": "<string>",
"receipt_description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '<string>',
receipt_name: '<string>',
receipt_description: '<string>'
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'business_id' => '<string>',
'receipt_name' => '<string>',
'receipt_description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.utage-system.com/v1/purchases/{purchase_id}"
payload := strings.NewReader("{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.utage-system.com/v1/purchases/{purchase_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}")
.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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"<string>\",\n \"receipt_name\": \"<string>\",\n \"receipt_description\": \"<string>\"\n}"
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": "bad_request",
"message": "事業者設定が登録されていないため領収書・請求書設定を変更できません"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "validation_error",
"message": "入力内容に誤りがあります",
"details": {
"business_id": [
"指定された事業者設定が存在しません"
]
}
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}PATCH
https://api.utage-system.com/v1/purchases/{purchase_id}
Body
application/json