Receipt API
Receipts API สามารถใช้เรียกดูใบเสร็จของแต่ละวันได้ ในใบเสร็จจะแสดงค่าบริการในการทำธุรกรรมและค่าธรรมเนียมการโอนเงินทั้งหมด โดยจะแสดงข้อมูลของวันล่าสุด
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
id | string | The receipt identifier matching |
livemode | boolean | Whether this is a live ( |
location | string | API path to retrieve the current |
adjustment_transaction | transaction | Balance adjustment transaction |
charge_fee | integer | Opn Payments charge fee in the smallest currency unit. |
company_address | string | Opn Payments address. |
company_name | string | Opn Payments company name. |
company_tax_id | string | Opn Payments tax ID. |
created_at | string | UTC datetime of receipt creation in ISO 8601 format ( |
credit_note | boolean | Whether this is a negative ( |
currency | string | Currency for receipt as three-letter ISO 4217 code. |
customer_address | string | Customer address. |
customer_email | string | Customer email. |
customer_name | string | Customer name. |
customer_statement_name | string | Customer statement name. |
customer_tax_id | string | Customer tax ID. |
issued_on | string | Date of receipt issue in ISO 8601 format. |
number | string | Receipt number. |
subtotal | integer | Result of |
total | integer | Result of |
transaction_fee | integer | The value of the transaction after excluding the ones that are voided. |
transfer_fee | integer | Transfer fee in smallest currency unit. |
vat | integer | Value-Added Tax (VAT) of |
voided_fee | integer | Voided fee in smallest currency unit. |
wht | integer | Withholding Tax (WHT) of |
List receipts
- GET https://api.omise.co/receiptsReturns a list of receipts belonging to your account.
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (optional, default: |
limit | integer | (optional, default: |
offset | integer | (optional, default: |
order | string | (optional, default: |
to | string | (optional) Latest UTC datetime for returned records in ISO 8601 format ( |
Example
-
List all receipts
- curl
- java
- python
- go
curl https://api.omise.co/receipts \ -u $OMISE_SECRET_KEY:
Request<ScopedList<Receipt>> request = new Receipt.ListRequestBuilder().build(); ScopedList<Receipt> receipts = client().sendRequest(request); System.out.printf("Total no. of receipts: %d", receipts.getTotal());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" receipts = omise.Receipt.retrieve()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Recipient{} list := &operations.List{Offset: 100, Limit: 20} err := client.Do(result, &operations.ListReceipts{List: *list}) if err != nil { log.Fatalln(err) } log.Println(result)
-
List all receipts by specific month
- curl
curl https://api.omise.co/receipts \ -X GET \ -d "from=2020/07/01" \ -d "to=2020/07/31" \ -d "limit=31" \ -u $OMISE_SECRET_KEY:
Retrieve a receipt
- GET https://api.omise.co/receipts/{id}Returns the receipt matching :id
.
Example
-
Retrieve a receipt
- curl
- java
- python
- go
curl https://api.omise.co/receipts/rcpt_test_58cixpsf1alqk032deb \ -u $OMISE_SECRET_KEY:
Request<Receipt> request = new Receipt.GetRequestBuilder("rcpt_59lezici7p7gt85hfwr").build(); Receipt receipt = client().sendRequest(request); System.out.printf("Retrieved receipt: %s", receipt.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" receipt = omise.Receipt.retrieve("rcpt_59lezici7p7gt85hfwr")
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Receipt{} err := client.Do(result, &operations.RetrieveReceipt{"rcpt_test_no1t4tnemucod0e51mo"}) if err != nil { log.Fatalln(err) } log.Println(result)