Churpy_Etims (1.0)

Churpy_Etims Public API

Download OpenAPI description
Languages
Servers
Mock server
https://docs-etims.churpy.co/_mock/openapi/
API
https://etims.churpy.co/

Branches

Operations

Customers

Operations

Items

Operations

Notices

Operations

Purchases

Operations

Sales

Operations

Add sale

Request

Add sale and credit notes. The difference between a sale and a credit note is the receipt_type_code which is a required field. A sale has a receipt type code of S while a credit note has a receipt type code of R. When adding a credit note, the original invoice number is required. For a Sale: receipt_type_code is "S" For a Credit note: receipt_type_code is "R" and original_invoice_number is required. Note: original_invoice_number is a numeric value (This should be an existing eTIMS invoice number of the sale invoice you intend to credit) Note: trader_invoice_number should be unique, unless you deactivated the sale or the sale queue_status is "failed".

Bodyapplication/jsonrequired
customer_pinstring
Example: "P123456789P"
customer_namestring
Example: "John Doe"
trader_invoice_numberstringrequired

Maximum - 50 characters

Example: "12345678901"
receipt_type_codestringrequired
Example: "S"
payment_type_codestringrequired
Example: "07"
invoice_status_codestringrequired
Example: "01"
original_invoice_numbernumber

This is a required field when adding a credit note. It should be an existing eTIMS invoice number of the sale invoice you intend to credit

Example: 12
callback_urlstring
Example: "https://webhook.site"
offline_urlstring
Example: "https://etims.ke/r/business_id/trader_invoice_number"
general_invoice_detailsstring

This is the general invoice details

Example: "General invoice details"
invoice_authobject
itemsArray of objectsrequired
items[].​idstringrequired
Example: "clu6souzx00mjfasxm4s6cweg"
items[].​quantitynumberrequired
Example: 1.5
items[].​unit_pricenumberrequired

This is the unit price for the item in this invoice. Decimal places are optional (If included, it should be not more that 2 decimal places)

Example: 3500.8
items[].​discount_ratenumberrequired
Example: 0
items[].​discount_amountnumberrequired
Example: 0
items[].​metadataobject
curl -i -X POST \
  https://docs-etims.churpy.co/_mock/openapi/sales \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "customer_pin": "P123456789P",
    "customer_name": "John Doe",
    "trader_invoice_number": "12345678901",
    "receipt_type_code": "S",
    "payment_type_code": "07",
    "invoice_status_code": "01",
    "original_invoice_number": 12,
    "callback_url": "https://webhook.site",
    "offline_url": "https://etims.ke/r/business_id/trader_invoice_number",
    "general_invoice_details": "General invoice details",
    "invoice_auth": {
      "type": "REVERSE",
      "issuer": "clsal91m300o7runidp910438"
    },
    "items": [
      {
        "id": "clu6souzx00mjfasxm4s6cweg",
        "quantity": 1.5,
        "unit_price": 3500.8,
        "discount_rate": 0,
        "discount_amount": 0,
        "metadata": {
          "invoice_desc": "Churpy_Etims service 01"
        }
      }
    ]
  }'

Responses

Returns the sales record created

Bodyapplication/json
datestring
Example: "10/05/2023"
timestring
Example: "04:16:11 pm"
Churpy_Etims_idstring
Example: "clw70klzn18xwzpdhu4yujv5f"
trader_invoice_numberstring
Example: "12345678901"
receipt_numberinteger
Example: 38
serial_numberstring
Example: "KRACU0400000001"
internal_datastring
Example: null
receipt_signaturestring
Example: null
etims_urlstring
Example: null
sale_detail_urlstring(url)
Example: "https://api.etims.churpy.co/sales/clw70klzn18xwzpdhu4yujv5f"
customer_namestring
Example: "John Doe"
customer_pinstring
Example: "P123456789P"
customer_phone_numberstring
Example: "+254112685368"
customer_emailstring
Example: "info@churpy.co"
queue_statusstring
Example: "paused"
invoice_numberinteger
Example: 38
sales_tax_summaryobject
Response
application/json
{ "date": "10/05/2023", "time": "04:16:11 pm", "Churpy_Etims_id": "clw70klzn18xwzpdhu4yujv5f", "trader_invoice_number": "12345678901", "receipt_number": 38, "serial_number": "KRACU0400000001", "internal_data": null, "receipt_signature": null, "etims_url": null, "sale_detail_url": "https://api.etims.churpy.co/sales/clw70klzn18xwzpdhu4yujv5f", "customer_name": "John Doe", "customer_pin": "P123456789P", "customer_phone_number": "+254112685368", "customer_email": "info@churpy.co", "queue_status": "paused", "invoice_number": 38, "sales_tax_summary": { "taxable_amount_a": 0, "taxable_amount_b": 517.24, "taxable_amount_c": 0, "taxable_amount_d": 0, "taxable_amount_e": 0, "tax_rate_a": 0, "tax_rate_b": 16, "tax_rate_c": 0, "tax_rate_d": 0, "tax_rate_e": 8, "tax_amount_a": 0, "tax_amount_b": 82.76, "tax_amount_c": 0, "tax_amount_d": 0, "tax_amount_e": 0 } }

Get list of business sales

Request

Get list of business sales

Query
pagenumber

Current page. Default is 1

Example: page=1
limitnumber

Number of records per page. Default is 10

Example: limit=10
curl -i -X GET \
  'https://docs-etims.churpy.co/_mock/openapi/sales?limit=10&page=1' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

List of sales returned successfully

Bodyapplication/json
paginationobject
dataArray of objects
Response
application/json
{ "pagination": { "total_count": 106, "total_pages": 11, "limit": 10, "current_page": 1, "has_next": true }, "data": [ { … } ] }

Get sale

Request

Get specific sale by id

Path
saleIdstringrequired

Sale id

Example: clw7gacca00czeih49eq3lee5
curl -i -X GET \
  'https://docs-etims.churpy.co/_mock/openapi/sales/{saleId}' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

Returns the sales record created

Bodyapplication/json
datestring
Example: "10/05/2023"
timestring
Example: "04:16:11 pm"
Churpy_Etims_idstring
Example: "clw70klzn18xwzpdhu4yujv5f"
trader_invoice_numberstring
Example: "12345678901"
receipt_numberinteger
Example: 38
serial_numberstring
Example: "KRACU0400000001"
internal_datastring
Example: "PB3ZSZP3RZR3AUPYBYLUTFJDIA"
receipt_signaturestring
Example: "3JYZVPTPMYBGHG4A"
etims_urlstring(url)
Example: "https://etims-sbx.kra.go.ke/common/link/etims/receipt/indexEtimsReceiptData?Data=P000000001G02JHEURBU6RQAMEF3Y"
sale_detail_urlstring(url)
Example: "https://staging.api.etims.churpy.co/sales/YKSWCIiuvx"
customer_namestring
Example: "John Doe"
customer_pinstring
Example: "P123456789P"
customer_phone_numberstring
Example: "+254112685368"
customer_emailstring
Example: "info@churpy.co"
queue_statusstring
Example: "pending"
invoice_numberinteger
Example: 38
sales_tax_summaryobject
Response
application/json
{ "date": "10/05/2023", "time": "04:16:11 pm", "Churpy_Etims_id": "clw70klzn18xwzpdhu4yujv5f", "trader_invoice_number": "12345678901", "receipt_number": 38, "serial_number": "KRACU0400000001", "internal_data": "PB3ZSZP3RZR3AUPYBYLUTFJDIA", "receipt_signature": "3JYZVPTPMYBGHG4A", "etims_url": "https://etims-sbx.kra.go.ke/common/link/etims/receipt/indexEtimsReceiptData?Data=P000000001G02JHEURBU6RQAMEF3Y", "sale_detail_url": "https://staging.api.etims.churpy.co/sales/YKSWCIiuvx", "customer_name": "John Doe", "customer_pin": "P123456789P", "customer_phone_number": "+254112685368", "customer_email": "info@churpy.co", "queue_status": "pending", "invoice_number": 38, "sales_tax_summary": { "taxable_amount_a": 0, "taxable_amount_b": 517.24, "taxable_amount_c": 0, "taxable_amount_d": 0, "taxable_amount_e": 0, "tax_rate_a": 0, "tax_rate_b": 16, "tax_rate_c": 0, "tax_rate_d": 0, "tax_rate_e": 8, "tax_amount_a": 0, "tax_amount_b": 82.76, "tax_amount_c": 0, "tax_amount_d": 0, "tax_amount_e": 0 } }

Stock

Operations