💻API Documentation
API Specification Common Standards
Protocol Standards and Methods
Transfer
HTTPS enabled endpoints
Secure interactions (Payments, Customer)
Data Exchange (CRUD)
POST/GET/PUT/DELETE
Varies as per API
Data Format
application/json
All data exchanges (requests and responses made in this format)
Char Encoding
UTF-8
Signature Algorithm
HMAC-SHA512
Signature Requirement
WIP
Signature-checking is required for requesting and receiving data
Logic Judgment
Determine protocol field, service field and transaction status.
Request Header
content-type
string
Y
application/json
content type
Signature
Build the content
Sign the content
NOTE
‘\n’ is LF, ASCII value is '0x0A'
Parameter names are case-sensitive;
When checking returned data or a push notification signature, the transferred sign parameter is excluded in this signature as it is compared with the created signature.
When post the Json body, carefully check the quote, ' is not same as "
Merchant APIs
Base URL - <base_url> : api-azsit.purplepay.app
Authentication
Register as a merchant on PurplePay Dashboard with email and password
Purple Pay authentication API uses Bearer authorization. It should be included in the header
Generating JWT Token
End Point:
Method: POST
URL:
<base_url>/auth/token
Request Parameters:
Attributes (1st level)TypeRequiredDescriptionusername
string
Y
email id as the username for signing up
password
string
Y
Strong alphanumeric password with special characters
Response:
AttributesTypeRequiredDescriptionaccess_token
string/token
Y
JWT token which is to be used to authenticate every request
refresh_token
string/token
Y
Refresh token to get the new access_token before it expires
Using the JWT Token
Once you have generated a JWT access token, you can use it to authenticate your requests.
The token should be included in the
Authorization
header with theBearer
keyword, like so:Replace
<your-jwt-token>
with your actual JWT token.Remember, all API requests must be made over HTTPS. Non-secure requests will fail.
Payments Config API
It returns details of supported chains and their details.
It also returns data to support and enrich classification around the different attributes of payments such as payment type (merchant, ecommerce, P2P etc).
Endpoint:
Method: GET
URL:
<base_url>/payments/chain_config
Create Checkout API
Payments API is used to create orders and generate counterfactual payment addresses to receive payments on different chains
Endpoint:
Method: POST
URL:
<base_url>/payments/burner_address
Request Parameters:
Attributes (1st level)TypeRequiredDescriptionapi_key
UUID
Y
api_key generated after signing up as a merchant
payment_type
enum
string
[merchant pos, merchant one time, merchant ecommerce, p2p one time]
N
payment_type is one of the values received from the config api. It serves to differentiate the category of source generating the payment.
order_amount
float
Y
value of the order
currency
enum
string
[usd]
N
currently, the defualt is in US Dollar. Support for generating orders in other currency is WIP and will be launched soon.
description
string upto 500 characters
chain_id
enum
int
testnet: [80001, 81]
mainnet: [592, ]
Y
It is one of the chain ids received from chain_config. This chain id is used to create the counterfactual address on the relevant chain.
user_order_id
string
merchant generated order id
Response:
Attributes (1st level)Attributes (2nd level)Attributes (3rd level)TypeRequiredDescriptiondata
tokens
burner_address
order_amount
conversion_rate_in_usd
is_used_for_payment
transfer_to_merchant_transaction_hash
burner_contract_deploy_status
burner_contract_deploy_failure_reason
symbol
token_address
chain_id
chain_name
decimals
image_url
id
Payment Id created in Purple Pay
payment_status
string
enum
[In Progress, Completed, Partially Completed]
description
string
message
string
error
Payment Status API
The payment status and verification API tracks and updates the status of payments for the given Purple Pay order id.
Endpoint
Method: GET
URL:
<base_url>/payments/payment_verify/<payment_id>
This payment id can be purple pay payment_id or merchant user_order_id.
Request Parameters
payment_id in url path as mentioned above
Response:
Attributes (1st level)Attributes (2nd level)Attributes (3rd level)TypeRequiredDescriptiondata
id
payment_details
tokens
array of objects
burner_address
order_amount
is_used_for_payment
symbol
token_address
chain_id
chain_name
decimals
image_url
conversion_rate
transfer_to_merchant_transaction_hash
burner_contract_deploy_status
enum
string
[initiated deploy, not deploy, failure deploy, success deploy]
burner_contract_deploy_failure_reason
message
error
payment_status
Last updated