SBReceipt

SBReceipt

Receipts are the core of the Smartbills API. They are used to record a transactions, and are the main way to retrieve information about them.

Retrieve a receipt

Retrieves the details of a receipt that has previously been created. Supply the unique receipt ID that was returned from your previous request, and Smartbills will return the corresponding receipt. The same information is returned when creating or deleting the receipt.

Parameters

Parameters

  • Test
  • Test
  • Test
  • Test

Returns

{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "company": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "created_at": "2022-01-29T20:42:59.120Z",
        "slug": "string",
        "domain": "string",
        "logo": "string",
        "customer_email": "string",
        "email": "string",
        "owner": "string",
        "hq_phone_number": "string",
        "hq_address": {
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "line1": "string",
            "line2": "string",
            "city": "string",
            "state": "string",
            "stateCode": "string",
            "country": "string",
            "countryCode": "string",
            "zipCode": "string",
            "createdAt": "2022-01-29T20:42:59.120Z",
            "updatedAt": "2022-01-29T20:42:59.120Z",
            "location": {
                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "longitude": 0,
                "latitude": 0,
                "expiresAt": "2022-01-29T20:42:59.120Z"
            },
            "googlePlaceId": "string",
            "formattedAddress": "string"
        },
        "description": "string",
        "name": "string"
    },
    "items": [
        {
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "product": {
                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "company_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "name": "string",
                "slug": "string",
                "vendor": "string",
                "categories": "string",
                "created_at": "2022-01-29T20:42:59.120Z",
                "updated_at": "2022-01-29T20:42:59.120Z",
                "tags": [
                    "string"
                ],
                "published_at": "2022-01-29T20:42:59.120Z",
                "html_description": "string",
                "images": [
                    {
                        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "height": 0,
                        "width": 0,
                        "variants_id": [
                            "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                        ],
                        "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "src": "string",
                        "updated_at": "2022-01-29T20:42:59.120Z",
                        "created_at": "2022-01-29T20:42:59.120Z"
                    }
                ],
                "variants": [
                    {
                        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "initial_price": 0,
                        "price": 0,
                        "weight_unit": "string",
                        "weight": 0,
                        "updated_at": "2022-01-29T20:42:59.120Z",
                        "created_at": "2022-01-29T20:42:59.120Z",
                        "taxable": true,
                        "position": 0,
                        "name": "string",
                        "image": {
                            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                            "height": 0,
                            "width": 0,
                            "variants_id": [
                                "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                            ],
                            "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                            "src": "string",
                            "updated_at": "2022-01-29T20:42:59.120Z",
                            "created_at": "2022-01-29T20:42:59.120Z"
                        },
                        "barcode": "string",
                        "sku": "string"
                    }
                ],
                "options": [
                    {}
                ]
            },
            "price": 0,
            "variant": {
                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "initial_price": 0,
                "price": 0,
                "weight_unit": "string",
                "weight": 0,
                "updated_at": "2022-01-29T20:42:59.120Z",
                "created_at": "2022-01-29T20:42:59.120Z",
                "taxable": true,
                "position": 0,
                "name": "string",
                "image": {
                    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "height": 0,
                    "width": 0,
                    "variants_id": [
                        "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                    ],
                    "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "src": "string",
                    "updated_at": "2022-01-29T20:42:59.120Z",
                    "created_at": "2022-01-29T20:42:59.120Z"
                },
                "barcode": "string",
                "sku": "string"
            },
            "variant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "quantity": 0,
            "sub_total": 0,
            "total_discount": 0,
            "taxes": [
                {
                    "name": "string",
                    "rate": 0,
                    "total": 0,
                    "tin": "string"
                }
            ],
            "total_taxes": 0,
            "total_duties": 0,
            "total": 0
        }
    ],
    "total_items": 0,
    "sub_total": 0,
    "taxes": [
        {
            "name": "string",
            "rate": 0,
            "total": 0,
            "tin": "string"
        }
    ],
    "total_taxes": 0,
    "total_discount": 0,
    "total_duties": 0,
    "total_shipping": 0,
    "total_tip": 0,
    "total": 0,
    "currency": "string",
    "taxes_included": true,
    "store_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "receipt_metadata": {
        "landing_site": "string",
        "customer_locale": "string",
        "reffering_site": "string",
        "source_pos": "string",
        "source_name": "string",
        "tags": "string",
        "url": "string",
        "browser_metadata": {
            "accept_language": "string",
            "browser_height": 0,
            "browser_ip": "string",
            "browser_width": 0,
            "session_hash": "string",
            "user_agent": "string"
        }
    },
    "total_weight": 0,
    "order_number": "string",
    "cancel_reason": "string",
    "payment_status": "string",
    "uploaded_at": "2022-01-29T20:42:59.120Z",
    "cancelled_at": "2022-01-29T20:42:59.120Z",
    "created_at": "2022-01-29T20:42:59.120Z",
    "documents": [
        {
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "name": "string",
            "url": "string",
            "created_at": "2022-01-29T20:42:59.120Z",
            "updated_at": "2022-01-29T20:42:59.120Z",
            "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        }
    ],
    "bank_transaction": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "amount": 0,
        "categories": [
            "string"
        ],
        "date": "2022-01-29T20:42:59.120Z",
        "name": "string",
        "payment_channel": "string"
    },
    "barcode": {
        "type": 1,
        "text": "string",
        "url": "string"
    },
    "source": 0
}

Get receipts

To send a receipt to your customer, you create a Receipt object.

Parameters

Create a receipt

To send a receipt to your customer, you create a Receipt object.

import {SBClient} from "@smartbills/sdk"
 
const client = new SBClient();
await client.receipt.create({})

Parameters

Update a receipt

To send a receipt to your customer, you create a Receipt object.

Parameters

Delete a receipt

To send a receipt to your customer, you create a Receipt object.

Parameters