決済取得
curl --request GET \
--url https://api.sandbox.zafapay.com/v1/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.zafapay.com/v1/payments/{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{
"id": "tx_abc123",
"request_id": "req_xyz789",
"status": "completed",
"amount": "17.62",
"currency": "usd",
"capture_method": "automatic",
"external_id": "order_12345",
"payment_method": "card",
"amount_refunded": "0",
"original_amount": null,
"original_currency": null,
"applied_rate": null,
"card_brand": "visa",
"card_last4": "4242",
"cardholder_name": "TARO YAMADA",
"card_exp_month": 12,
"card_exp_year": 2028,
"card_country": "JP",
"card_funding": "credit",
"payment_method_id": null,
"is_recurring": false,
"customer_id": null,
"email": "customer@example.com",
"tel": null,
"product_name": null,
"error_code": null,
"refunds": [
{
"id": "orf_xyz789",
"amount": "5.50",
"status": "succeeded",
"reason": "お客様都合",
"created_at": "2024-01-15T10:35:00Z"
}
],
"metadata": {},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:31:00.000Z"
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Invalid request parameters",
"param": "amount",
"details": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"request_id": "req_abc123xyz789"
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Invalid request parameters",
"param": "amount",
"details": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"request_id": "req_abc123xyz789"
}
}Payments
決済取得
決済の詳細を取得します
GET
/
v1
/
payments
/
{id}
決済取得
curl --request GET \
--url https://api.sandbox.zafapay.com/v1/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{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.sandbox.zafapay.com/v1/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.zafapay.com/v1/payments/{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{
"id": "tx_abc123",
"request_id": "req_xyz789",
"status": "completed",
"amount": "17.62",
"currency": "usd",
"capture_method": "automatic",
"external_id": "order_12345",
"payment_method": "card",
"amount_refunded": "0",
"original_amount": null,
"original_currency": null,
"applied_rate": null,
"card_brand": "visa",
"card_last4": "4242",
"cardholder_name": "TARO YAMADA",
"card_exp_month": 12,
"card_exp_year": 2028,
"card_country": "JP",
"card_funding": "credit",
"payment_method_id": null,
"is_recurring": false,
"customer_id": null,
"email": "customer@example.com",
"tel": null,
"product_name": null,
"error_code": null,
"refunds": [
{
"id": "orf_xyz789",
"amount": "5.50",
"status": "succeeded",
"reason": "お客様都合",
"created_at": "2024-01-15T10:35:00Z"
}
],
"metadata": {},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:31:00.000Z"
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Invalid request parameters",
"param": "amount",
"details": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"request_id": "req_abc123xyz789"
}
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Invalid request parameters",
"param": "amount",
"details": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"request_id": "req_abc123xyz789"
}
}承認
アクセストークンを使用したBearer認証
パスパラメータ
トランザクションID
例:
"tx_abc123"
レスポンス
成功
トランザクションID
例:
"tx_abc123"
決済リクエストID
例:
"req_xyz789"
ステータス
利用可能なオプション:
pending, requires_action, authorized, completed, failed, canceled, partially_refunded, refunded 例:
"completed"
決済金額(文字列形式)
例:
"17.62"
通貨コード
例:
"usd"
キャプチャ方式
例:
"automatic"
加盟店側の注文ID
例:
"order_12345"
決済方法
例:
"card"
返金済み金額(文字列形式)
例:
"0"
通貨変換前の元の金額
例:
null
通貨変換前の元の通貨
例:
null
適用された為替レート
例:
null
カードブランド
例:
"visa"
カード番号の下4桁
例:
"4242"
カード名義人
例:
"TARO YAMADA"
カード有効期限(月、1〜12)
例:
12
カード有効期限(年)
例:
2028
カード発行国(ISO 3166-1 alpha-2)
例:
"JP"
カードの資金源タイプ(credit, debit, prepaid)
例:
"credit"
保存されたカードのID(pmi_xxx形式)
例:
null
リカーリング決済の場合true
例:
false
顧客ID
例:
null
顧客のメールアドレス
例:
"customer@example.com"
顧客の電話番号
例:
null
商品名
例:
null
失敗した決済の統一エラーコード(例: card_declined, insufficient_funds, expired_card)
例:
null
返金履歴
Show child attributes
Show child attributes
メタデータ
作成日時
例:
"2024-01-15T10:30:00.000Z"
更新日時
例:
"2024-01-15T10:31:00.000Z"