omise v0.6.0 Omise.Receipt

Provides Receipt API interfaces.

https://www.omise.co/receipt-api

Link to this section Summary

Link to this section Types

Link to this type t()
t() :: %Omise.Receipt{charge_fee: integer(), company_address: String.t(), company_name: String.t(), company_tax_id: String.t(), credit_note: boolean(), currency: String.t(), customer_address: String.t(), customer_email: String.t(), customer_name: String.t(), customer_statement_name: String.t(), customer_tax_id: String.t(), date: String.t(), id: String.t(), location: String.t(), number: String.t(), object: String.t(), subtotal: integer(), total: integer(), transfer_fee: integer(), vat: integer(), voided_fee: integer(), wht: integer()}

Link to this section Functions

Link to this function list(params \\ [], opts \\ [])
list(Keyword.t(), Keyword.t()) ::
  {:ok, Omise.List.t()} |
  {:error, Omise.Error.t()}

List all receipts.

Returns {:ok, receipts} if the request is successful, {:error, error} otherwise.

Query Parameters:

  • offset - (optional, default: 0) The offset of the first record returned.
  • limit - (optional, default: 20, maximum: 100) The maximum amount of records returned.
  • from - (optional, default: 1970-01-01T00:00:00Z, format: ISO 8601) The UTC date and time limiting the beginning of returned records.
  • to - (optional, default: current UTC Datetime, format: ISO 8601) The UTC date and time limiting the end of returned records.

Examples

Omise.Receipt.list

Omise.Receipt.list(limit: 5)
Link to this function retrieve(id, opts \\ [])
retrieve(String.t(), Keyword.t()) ::
  {:ok, t()} |
  {:error, Omise.Error.t()}

Retrieve a receipt.

Returns {:ok, receipt} if the request is successful, {:error, error} otherwise.

Examples

Omise.Receipt.retrieve("rcpt_test_4z6p7e0m4k40txecj5o")