인보이스와 결제 상태 검색
curl --request GET \
--url https://meterengine.com/v1/invoices/search \
--header 'Authorization: Bearer <token>'const url = 'https://meterengine.com/v1/invoices/search';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"items": [
{
"invoice": {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"cutoff_at": "2023-11-07T05:31:56Z",
"finalized_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"lines": [
{
"amount": 123,
"billable_metric_code": "<string>",
"billable_metric_name": "<string>",
"dimension_values": {},
"line_type": "per_unit",
"quantity": 123,
"quantity_denominator": 123,
"quantity_numerator": 123,
"target_property": "<string>",
"tier_index": 123,
"unit_price": 123
}
],
"month": "<string>",
"supply_amount": 123,
"tax_amount": 123,
"total_amount": 123
},
"payment": {
"amount": 123,
"attempt_count": 123,
"canceled_amount": 123,
"completed_at": "2023-11-07T05:31:56Z",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_failure_code": "<string>",
"mode": "test",
"next_retry_at": "2023-11-07T05:31:56Z",
"status": "not_required"
}
}
],
"page": 123,
"size": 123,
"summary": {},
"total": 123,
"total_unfiltered": 123
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}검색과 내보내기
인보이스와 결제 상태 검색
customer_id, month, from/to(확정 시각, 날짜 종료일 포함/KST), status, mode, min_amount, max_amount, billable_metric_code, q, sort(month/customer_name/total_amount/finalized_at/invoice_number/status), order, page, size를 받는다. mode 기본은 현재 결제 설정이다. 조건 전체 금액과 결제 상태 건수는 페이지와 독립이며 pending이 있으면 outstanding_amount는 null이다. summary는 mode, invoice_count, supply_amount, tax_amount, total_amount, canceled_amount, has_pending, outstanding_amount, status_counts(결제 상태별 건수)다. from과 to는 한쪽만 줘도 되고 month와 함께 주면 둘 다 만족하는 인보이스만 나온다. 이벤트 목록과 내보내기는 from과 to를 함께 요구한다.
GET
/
v1
/
invoices
/
search
인보이스와 결제 상태 검색
curl --request GET \
--url https://meterengine.com/v1/invoices/search \
--header 'Authorization: Bearer <token>'const url = 'https://meterengine.com/v1/invoices/search';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"items": [
{
"invoice": {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"cutoff_at": "2023-11-07T05:31:56Z",
"finalized_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"lines": [
{
"amount": 123,
"billable_metric_code": "<string>",
"billable_metric_name": "<string>",
"dimension_values": {},
"line_type": "per_unit",
"quantity": 123,
"quantity_denominator": 123,
"quantity_numerator": 123,
"target_property": "<string>",
"tier_index": 123,
"unit_price": 123
}
],
"month": "<string>",
"supply_amount": 123,
"tax_amount": 123,
"total_amount": 123
},
"payment": {
"amount": 123,
"attempt_count": 123,
"canceled_amount": 123,
"completed_at": "2023-11-07T05:31:56Z",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_failure_code": "<string>",
"mode": "test",
"next_retry_at": "2023-11-07T05:31:56Z",
"status": "not_required"
}
}
],
"page": 123,
"size": 123,
"summary": {},
"total": 123,
"total_unfiltered": 123
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}인증
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
쿼리 매개변수
Maximum string length:
2000Maximum string length:
2000사용 가능한 옵션:
asc, desc 필수 범위:
1 <= x <= 2147483647필수 범위:
1 <= x <= 200Pattern:
^[0-9]{4}-(0[1-9]|1[0-2])$예시:
"2026-08"
Maximum string length:
2000Maximum string length:
2000Maximum string length:
2000Maximum string length:
2000사용 가능한 옵션:
test, live 필수 범위:
x >= 0필수 범위:
x >= 0