Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
185 lines (132 sloc) 5.09 KB

API Documentation

Official Pip API Documentation: docs.pip.cash

{% file src=".gitbook/assets/api.json" caption="Download OpenAPI Specification" %}

👋 Introduction

Welcome to the Pip API.

Our mission is to empower developers to optimise how personal information is treated by organisations.

📌 General

Server URLs

The Pip API runs at https://api.pip.cash/v1

The Pip Websocket runs at wss://ws.pip.cash/v1

All requests should be prefixed by the server URL.

Errors

The Pip API uses standard HTTP status codes to indicate success or failure. 200 represents success, 4xx represents a user error (such as a problem with your key), and 5xx represents a problem with our API.

🛒 PipTX

Cryptocurrency quotes, transaction order matching, and payment confirmation listening for ecommerce. PipTX requires only a single merchant wallet address per coin. Non-custodial. No merchant fees.

{% api-method method="post" host="https://api.pip.cash/v1" path="/quotes" %} {% api-method-summary %} GenerateQuote {% endapi-method-summary %}

{% api-method-description %} This endpoint provides cryptocurrency quotes for the purpose of transaction order matching in ecommerce against a single merchant wallet address per coin. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="amount" type="number" required=true %} The fiat amount required to convert to a cryptocurrency.

Example: 24.95 {% endapi-method-parameter %}

{% api-method-parameter name="walletAddresses" type="array" required=true %} The wallet address(es) for receiving payment.

Example: "btc": "bc1q...rq5d" {% endapi-method-parameter %}

{% api-method-parameter name="currency" type="string" required=true %} The fiat currency for conversion. Defaults to USD.

Example: "usd" {% endapi-method-parameter %}

{% api-method-parameter name="orderId" type="string" required=false %} Merchant may pass in orderID for internal reference.

Example: "WC00321" {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} Quote successfully generated. {% endapi-method-response-example-description %}

{% tabs %} {% tab title="" %}

[
    {
        "id": "3b37e990-e8b7-11e9-8514-cf0ea8e3b800",
        "ticker": "btc",
        "amount": 0.00316476,
        "currency": "usd"
    }
]

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

Request Sample

🔗Test me on Postwoman

{
	"amount": 197.99,
	"currency": "eur",
	"walletAddresses": {
		"btc": "bc1q8pwhd6uk956av4ccuv0q44a037s8gqwlhcrq5d",
		"veil": "bv1q4nelsag36hplc9yxcka8jt4z9sxxyskvcflhej",
		"dgb": "D77SMwXsHxJCBUZzQT9Z57PX1UpSLSegNB"
	}
}

Response Sample

If there were multiple walletAddresses passed into the query string parameters of the request URL then there will be multiple crypto currency ticker symbols listed with their respective quote.

The id will be used to check payment status or listen to a websocket.

The quote is returned in JSON format.

[
    {
        "id": "d554e280-e8b7-11e9-8514-cf0ea8e3b800",
        "ticker": "btc",
        "amount": 0.02754057,
        "currency": "eur"
    },
    {
        "id": "d56b0290-e8b7-11e9-8514-cf0ea8e3b800",
        "ticker": "veil",
        "amount": 2701.79173319,
        "currency": "eur"
    },
    {
        "id": "d580d480-e8b7-11e9-8514-cf0ea8e3b800",
        "ticker": "dgb",
        "amount": 34808.06251703,
        "currency": "eur"
    }
]

🔌 CheckPayments

Listen on a websocket using the id returned by the quote generation endpoint. The connection will be made using the quote ID from the response. Replace the value of quoteId with the id.

Request Sample

When a connection to the websocket is made, it will look for completed transactions in the last 60 minutes and return the status of true or false.

🔗 Test me on Postwoman

wss://ws.pip.cash/v1?quoteId=d580d480-e8b7-11e9-8514-cf0ea8e3b800

Response Sample

There is a job that runs every minute to check for transactions. If one is discovered, and a websocket connection is open, a message will be sent to update the status of the transaction.

Payment unconfirmed

{"status":"unpaid or expired"}

Payment confirmed

{"status":"paid"}

📆 Roadmap

If you're a crypto or plugin developer, please contact PipLabs on Telegram or send us an email.

  • Bitcoin (BTC) integration with API
  • Veil (VEIL) integration with API
  • DigiByte (DBG) integration with API
  • WooCommerce checkout plugin demo
  • Onboarding additional coins into API
  • Release code snippet for 'Buy Now' button and iFrame modal
  • Upgrade to single use shipping address codes with postal partner
You can’t perform that action at this time.