Payment Request

Use Apps.Payment to create Payment Request and related QR codes. Payment Request stores information about payment intention.

The Orangepill platform's Payment Request feature, accessed via the Apps.Payment module, allows users to create and manage payment requests effectively. Each payment request must include the destination alias of the receiver, ensuring proper routing of funds. Optional fields enable users to specify the payment amount and currency, adding precision to transactions. Additionally, users can include a source alias to direct the request to a specific payer, making the process efficient for recurring or predetermined payments. To further streamline the payment process, Apps.Payment supports methods to generate and reveal QR codes representing the payment request. This QR code functionality simplifies the transaction process by allowing users to quickly and accurately share payment details, enhancing both the flexibility and reliability of handling pending payments within the platform.

Make payment

echo 'Create payment request'

curl --location --request POST 'https://api.orangepill.cloud/v1/apps/payment' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933dffabb' \
--header 'Content-Type: application/json' \
--data-raw '{
	"version": "1.0",
	"destination": {
		"alias": "@pet_shop_barney"
	},
	"amount": 100.23,
	"asset": "USD",
	"description": "Order ord_24hhh32 from WooCommerce",
	"data": {
		"system": "WOOCOMMERCE",
		"callback": "https://domain.com/orangepill/payments",
		"store": "Pet shop Barney",
		"merchant": "Pet shop Ltd.",
		"order": "ord_24hhh32"
	}   
}'

In response we get new Payment Request object.

{
	"id": "MljzDk8qxDsBkXW0wv3r",
	"version": "1.0",
	"destination": {
		"alias": "@pet_shop_barney"
	},
	"amount": 100.23,
	"asset": "USD",
	"description": "Order ord_24hhh32 from WooCommerce",
	"data": {
		"system": "WOOCOMMERCE",
		"callback": "https://domain.com/orangepill/payments",		
		"store": "Pet shop Barney",
		"merchant": "Pet shop Ltd.",
		"order": "ord_24hhh32"
	},   
	"status": "CREATED",
	"owner": "639675ab191e9023f356dfa6",
   	"created_at": 1671242774572,
   	"error": null
}

Callback

Apps.Payment supports POST REST API callback URL when Payment Request status changes. Callback URL must have public access. Information received to callback URL is the ID of updated Payment Request. Business logic behind callback URL should retrieve details about Payment Request and accept or reject payment depending on the new status. Use this feature to integrate external e-commerce or ERP system to acknowledge payment from Orangepill platform.

Example of POST REST API call to callback URL

{
   "id": "MljzDk8qxDsBkXW0wv3r"
}

Payment Status

Depending on the Payment Request version and the flow, different statuses are supported. By default, status CREATED is added to payment request. Upon receiving of total amount to destination account, payment request will be updated with status DONE.

Complete supported status list

"CREATED"
"DONE"
"PENDING"
"ACCEPTED"
"CANCELLED"
"INCOMPLETE"
"PROCESSING"
"OVERPAID"
"LATE"
"FAILED"
"REFUND"
"REFUNDED"
"ERROR"

Status changes log

History of status changes can be found in object log.

"log": [
    {
        "status": "INCOMPLETE",
        "created_at": 1634242457277
    },
    {
        "status": "DONE",
        "created_at": 1872242774572
    },

]

List of transactions related to payment request can be found in Array object related. Typical scenario where multiple transactions would be related to a payment request is when multiple payments were done to collect complete payment request amount, for example in split payment scenario.

"related": [
    {
        "type": "transaction",
        "value": "656a0fd58e907523577a53f6",
        "created_at": 1671242774572
    },
    {
        "type": "transaction",
        "value": "67523577a53f656a0fd58e90",
        "created_at": 1674277457212
    },
]

Transactions are automatically added to related Array if in it's related object contain reference to specific Apps.Payment entity.

"related": [
    {
        "type": "apps.payment",
        "value": "MljzDk8qxDsBkXW0wv3r",
        "created_at": 1872242774572
    }
]

Versions

Payment Request supports format versions, thus allowing future changes in format.

Version 1.0

FieldDescriptionExampleMandatory

version

Payment Request version

1.0

destination.alias

Payee alias

@merchant1

data.order

Related order id

623347473

source.alias

Payer alias

@user1

amount

Payment amount

100.12

asset

Payment currency

USD

description

Payment description

Order #1

tags

Array of tags

["online","sport"]

data.system

Ecommerce system that generated Payment request.

VTEX

data.callback

Status change callback URL.

https://domain.com/orangepill/payment

data.store

Store name

Pet shop Barney

data.merchant

Merchant name

Pet shop Ltd.

data.invoice

Related invoice id

INV122-3

data.cart

Related cart id

cart737743

Static Payment Requests

Static Payment Requests contain only information about the payee, the receiver of payment and lack the information about exact amounts and payment reference. Example of Static Payment Requests are QR codes exposed at Merchant stores. Payer use this Payment Request to initiate the payment flow, yet needs to add additional information about the exact amount and reference of payment.


{
	version: "1.0",
	destination: {
		alias: "@merchant_alias"
	},
	description: "Static Payment Request Example",
	data: {
		store: "Store name",
		merchant: "Merchant name",
	}
}

Dynamic Payment Requests

Dynamic Payment Requests contain both complete information about the payee and the information about exact amounts and payment reference. Example of Dynamic Payment Requests are QR codes generated at checkout process on e-commerce platforms or printed on POS devices. Payer use this Payment Request to initiate the payment flow with known total amount and reference of payment.


{
	version: "1.0",
	destination: {
		alias: "@merchant_alias"
	},
	asset: "USD",
	amount: 100.24,
	description: "Dynamic Payment Request Example",
	data: {
		store: "Store name",
		merchant: "Merchant name",
		order: "ord_uh2232i"
	}
}

Direct Payment Requests

Direct Payment Requests contain complete information about the payee, payer and the information about exact amounts and payment reference. Example of Direct Payment Requests are subscriptions and recurring payments. Payer receives notification about Payment Request and initiates the payment flow with known total amount and reference of payment.


{
	version: "1.0",
	destination: {
		alias: "@merchant_alias"
	},
	asset: "USD",
	amount: 100.24,
	description: "Dynamic Payment Request Example",
	data: {
		source: [
		   {
			alias: "@alice",
			amount: 50
	   	   },
		   {
			alias: "@bob",
			amount: 50.24
	   	   },
		],
		store: "Store name",
		merchant: "Merchant name",
		order: "ord_uh2232i"
	}
}

Create Payment Request v1.0

When creating new Apps.Payment you can use additional fields.

Use data object to add custom fields for this operation.

Use description object to add custom fields for this operation.

echo 'Create payment request'

curl --location --request POST 'https://api.orangepill.cloud/v1/apps/payment' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933dffabb' \
--header 'Content-Type: application/json' \
--data-raw '{
	"version": "1.0",
	"destination": {
		"alias": "@pet_shop_barney"
	},
	"amount": 100.23,
	"asset": "USD",
	"description": "Order ord_24hhh32 from WooCommerce",
	"data": {
		"system": "WOOCOMMERCE",
		"callback": "https://domain.com/orangepill/payments",
		"store": "Pet shop Barney",
		"merchant": "Pet shop Ltd.",
		"order": "ord_24hhh32"
	}   
}'

In response we get new Payment Request object.

{
	"id": "MljzDk8qxDsBkXW0wv3r",
	"version": "1.0",
	"destination": {
		"alias": "@pet_shop_barney"
	},
	"amount": 100.23,
	"asset": "USD",
	"description": "Order ord_24hhh32 from WooCommerce",
	"data": {
		"system": "WOOCOMMERCE",
		"callback": "https://domain.com/orangepill/payments",		
		"store": "Pet shop Barney",
		"merchant": "Pet shop Ltd.",
		"order": "ord_24hhh32"
	},   
	"status": "CREATED",
	"owner": "639675ab191e9023f356dfa6",
   	"created_at": 1671242774572,
   	"error": null
}

Payment Request Unique Code

Payment Request id is the unique identifier and code for this payment request. Use this information to share Payment request.

Payment Request Code Example

"MljzDk8qxDsBkXW0wv3r"

Get Payment Request details

You can get details of Payment Requests by providing id.

echo 'get Payment Request with id MljzDk8qxDsBkXW0wv3r'

curl --location --request GET 'https://api.orangepill.cloud/v1/apps/payment/MljzDk8qxDsBkXW0wv3r' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'

In response we get Payment Request entity.

{
	"id": "MljzDk8qxDsBkXW0wv3r",
	"version": "1.0",
	"destination": {
		"alias": "@pet_shop_barney"
	},
	"amount": 100.23,
	"asset": "USD",
	"description": "Order ord_24hhh32 from WooCommerce",
	"data": {
		"system": "WOOCOMMERCE",
		"callback": "https://domain.com/orangepill/payments",		
		"store": "Pet shop Barney",
		"merchant": "Pet shop Ltd.",
		"order": "ord_24hhh32"
	},   
	"status": "CREATED",
	"owner": "639675ab191e9023f356dfa6",
   	"created_at": 1671242774572,
   	"error": null
}

Delete Payment Request

To delete Payment Request use following call.

echo 'Delete payment request'

curl --location --request DELETE 'https://api.orangepill.cloud/v1/apps/payment/MljzDk8qxDsBkXW0wv3r' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \

In response we get id of deleted Payment Request object.

"MljzDk8qxDsBkXW0wv3r"

List Payment Requests

You can list all Payment Requests or filter them using query method..

echo 'list Payment Requests with status DONE'

curl --location --request GET 'https://api.orangepill.cloud/v1/apps/payment?query={"status":"DONE"}' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'

In response we get array of Payment Requests.

[
	{
		"id": "MljzDk8qxDsBkXW0wv3r",
		"version": "1.0",
		"destination": {
			"alias": "@pet_shop_barney"
		},
		"amount": 100.23,
		"asset": "USD",
		"description": "Order ord_24hhh32 from WooCommerce",
		"data": {
			"system": "WOOCOMMERCE",
			"callback": "https://domain.com/orangepill/payments",			
			"store": "Pet shop Barney",
			"merchant": "Pet shop Ltd.",
			"order": "ord_24hhh32"
		},   
		"status": "DONE",
		"owner": "639675ab191e9023f356dfa6",
	   	"created_at": 1671242774572,
	   	"error": null
	},
	{
		"id": "XW0wv3rzDk8jqxDMlsBk",
		"version": "1.0",
		"destination": {
			"alias": "@pet_shop_barney"
		},
		"amount": 200.23,
		"asset": "USD",
		"description": "Order ord_36yhgh11 from WooCommerce",
		"data": {
			"system": "WOOCOMMERCE",
			"callback": "https://domain.com/orangepill/payments",			
			"store": "Pet shop Barney",
			"merchant": "Pet shop Ltd.",
			"order": "ord_36yhgh11"
		},   
		"status": "DONE",
		"owner": "639675ab191e9023f356dfa6",
	   	"created_at": 1712427674572,
	   	"error": null
	}
]

Generate QR Code

You can encode Payment Request Unique Code as QR code.

Use endpoint GET /v1/apps/payment/:payment_requst_unique_code/qr/:format/:width to get image of QR code form Orangepill platform.

Supported formats are png and base64.

Use parameter width to define the size of QR code.

PNG format of QR Code

echo 'Generate 200x200px PNG QR code for Payment Request Code BJgJVrqEnQIpYpQpLxrY'

curl --location --request GET 'https://api.orangepill.cloud/v1/apps/payment/BJgJVrqEnQIpYpQpLxrY/qr/png/200' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'

In response we get binary PNG format of QR code.

�PNG


IHDR���X��IDATx�~��IDAT��Qn#������~?OIIvE���KCU���Z
U��j5T�j���PU���VCU���Z
U��j5T�j���PU���VCU���Z
U��j5T��Ň$�7R�+	w�ܑ�OP9%�.�������PU���VCU���Z
U�z�e*ߒ�;�p��*w%�	�+Ix7�oI·U��j5T�j��Ջ_ 	O�|�ʻ%�.�+I8%�rE�[����O�j5T�j���PU��1I8�\I�)	WTNI8%�.��oCU���Z
U��j5T��E�����]*�r%	u�PU���VCU���Z��T~#���pJ·�ܥrJ��'T����VCU���Z
U��j��˒�%��)	'�+I8�\I�I���nI�_4T�j���PU���V/>D�P����ʕ$�T�R�I*w����j5T�j���PU��?,	'����	*�$\Q�#	WTNI��+I8����-*�2T�j���PU���VCU�^|YN*�$ܥ�	I8�\I�IxB唄+*O$�.��l���PU���VCU�^�1*w%�rJ��S����p��]Ix"	'�OH�*�$\Qy���VCU���Z
U��j���T�P����TNI8�|��I�+	'��TNI8�\I�]*��PU���VCU���Z���$<�rJ•$�T�P�����]I8�ܕ���pR������U��j5T�j��ՋI�]*��rG��ܥrG�����D�����D���eCU���Z
U��j5T���\I�)	'�+I8�\I�I�$�T~��)	w%�'%��I����VCU���Z
U�z�!I��rJ�]*w����	I8��T�E�J�R9%�[�pR����VCU���Z
U��j��CT�R9%��)	O�ܕ�+*w$᧩���������VCU���Z
U����EI8�<��+*?)	w���pE�ݒp��)	WT����VCU���Z
U����IxB�J�M��pR����ʕ$�TNI��rJ·�\I�I唄+*�6T�j���PU���VCU��?�BI��rJ��;�pE�ݒp�ʕ$�$�S�R�m��Z
U��j5T�*��$�.�S>A�$<��-I��rJ·�<��+*�6T�j���PU���VCU�^|��*ߒ�+*O���pE唄'T�Ry"	�$\Q9%��-CU���Z
U��j��C���|K�P����ʷ$�r��]*�$\Qy���VCU���Z
U�z�e*ߒ���rJ•$�T>!	O�<��+*w�|�PU���VCU���Z
U�z�$�	�'T�$��T�$ᔄ+*�$�T�J·$�	�w�j5T�j���PU��R9%��Ix*	'�S�R�����)	WT�H�I�[��Z
U��j5T�j��Ջ"	����ʕ$�T�$ᔄ�TNI�+	'�+Ix�$\Qy���VCU���Z
U�z���$�+I8�\I�_�rW>A��j5T�j���PU�_���B�	��TNIxB�J�R�#	WTNI�����)	WT�m���PU���VCU���Z���KCU���Z
U��j5T�j���PU���VCU���Z
U��j5T�j���PU���VCU���Z
U��j�iH�A��CIEND�B`�

base4 format of QR code

echo 'Generate 200x200px base4 QR code for Payment Request Code BJgJVrqEnQIpYpQpLxrY'

curl --location --request GET 'https://api.orangepill.cloud/v1/apps/payment/BJgJVrqEnQIpYpQpLxrY/qr/base64/200' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'

In response we get base64 format of QR code PNG image.

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAklEQVR4AewaftIAAAXiSURBVO3BUW4j0REEwawG73/l9H4/TwMDDElJdkXEf6iqS0NVrYaqWg1VtRqqajVU1WqoqtVQVauhqlZDVa2GqloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTV6sWHJOE3UrkrCXep3JGET1A5JeEulbuS8BupvNtQVauhqlZDVa2GqloNVbV68WUq35KEO5Jwl8oTKncl4QmVK0l4N5VvScK3DFW1GqpqNVTVaqiq1YtfIAlPqHyCyrsl4S6VK0k4JeGkckXlW5LwhMpPGqpqNVTVaqiq1VBVqxf1MUk4qVxJwikJV1ROSTgl4S6V+m9DVa2GqloNVbUaqmo1VNXqRa2S8ITKXSrvpnIlCXXPUFWroapWQ1WthqpavfgFVH4jlbuScErCt6jcpXJKwhWVJ1T+sqGqVkNVrYaqWg1VtRqqavXiy5LwlyXhisopCSeVK0k4qVxJwh1JuKLybkn4XzRU1WqoqtVQVauhqlYvPkTlr1C5koSTypUknFTuUvlJKnep/L8Yqmo1VNVqqKrVUFWr+A8/LAknlbuS8AkqpyRcUbkjCVdUTkn4FpUrSTipnJLwLSrfMlTVaqiq1VBVq6GqVkNVrV58WRJOKqck3KXyCUk4qVxJwhNJeELllIQrKk8k4S6Vv2yoqtVQVauhqlZDVa1e/DEqdyXhpHJKwhWVUxKuqJyScJfKXUl4IgknlU9IwhMqpyRcUXm3oapWQ1WthqpaDVW1Gqpq9eLLVO5QuZKEu1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UTkl4QuVKEu5SuSMJV1ROSbiShJPKKQlXVN5tqKrVUFWroapWQ1WthqpaxX+oqktDVa2GqloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTVaqiq1VBVq6GqVkNVrYaqWg1VtRqqavUfaQVIm0GP+0MAAAAASUVORK5CYII="

Reveal QR Code

You can use Orangepill API to reveal the image of QR code and decode the Payment Request Unique Code.

You must provide QR code in base64 format.

echo 'Reveal Payment Request Unique Code from QR image'

curl --location --request POST 'https://api.orangepill.cloud/v1/apps/payment/qr/reveal' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json' \
--data-raw '{
	"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAklEQVR4AewaftIAAAXiSURBVO3BUW4j0REEwawG73/l9H4/TwMDDElJdkXEf6iqS0NVrYaqWg1VtRqqajVU1WqoqtVQVauhqlZDVa2GqloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTV6sWHJOE3UrkrCXep3JGET1A5JeEulbuS8BupvNtQVauhqlZDVa2GqloNVbV68WUq35KEO5Jwl8oTKncl4QmVK0l4N5VvScK3DFW1GqpqNVTVaqiq1YtfIAlPqHyCyrsl4S6VK0k4JeGkckXlW5LwhMpPGqpqNVTVaqiq1VBVqxf1MUk4qVxJwikJV1ROSTgl4S6V+m9DVa2GqloNVbUaqmo1VNXqRa2S8ITKXSrvpnIlCXXPUFWroapWQ1WthqpavfgFVH4jlbuScErCt6jcpXJKwhWVJ1T+sqGqVkNVrYaqWg1VtRqqavXiy5LwlyXhisopCSeVK0k4qVxJwh1JuKLybkn4XzRU1WqoqtVQVauhqlYvPkTlr1C5koSTypUknFTuUvlJKnep/L8Yqmo1VNVqqKrVUFWr+A8/LAknlbuS8AkqpyRcUbkjCVdUTkn4FpUrSTipnJLwLSrfMlTVaqiq1VBVq6GqVkNVrV58WRJOKqck3KXyCUk4qVxJwhN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oqtWLIgmfkISTypUknFSuJOGUhLtUTkm4KwknlStJeLckXFF5t6GqVkNVrYaqWg1VtXrxC6j8JJUrSTipXEnCX6ZyVxI+QeW3GapqNVTVaqiq1VBVqxdfloS/QuUJlbtUTkl4QuVKEu5SuSMJV1ROSbiShJPKKQlXVN5tqKrVUFWroapWQ1WthqpaxX+oqktDVa2GqloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTVaqiq1VBVq6GqVkNVrYaqWg1VtRqqavUfaQVIm0GP+0MAAAAASUVORK5CYII="
}'

In response we get Payment Request Unique Code.

"BJgJVrqEnQIpYpQpLxrY"

Make payment

To make payment and change status of the Payment Request, you must create transaction of type payment and reference Payment Request in related object.

Transaction can be in any currency. After the transaction is processed, amount in transaction asset is calculated and compared to amount in Payment Request currency. If transaction amount is equal or greater than the amount of Payment Request, status will be changed to COMPLETED. If amount of transaction is less then amount in Payment Request, status will be changed to INCOMPLETE.

After the Payment Request status is changed, Orangepill core will call callback URL.

echo 'Pay with transaction'

curl --location --request POST 'https://api.orangepill.cloud/v1/transaction' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933dffabb' \
--header 'Content-Type: application/json' \
--data-raw '{
"source": {
    "account": "6695b47a6b1b76f77fc2116a"
},
"destination": {
	"alias": "@merchantalias"
},
"type": "payment",
"value": 5000,
"asset": "YOUR_POINTS",
"related": [{
    "type": "apps.payment",
    "value": "BJgJVrqEnQIpYpQpLxrY"
}],
"description": "Cart from WooCommerce",
"data": {}
}'

In response we get new Transaction object.

{
    "id": "6698da2675e2ef1c0a7b18c7",
    "source": {
        "account": "6695b47a6b1b76f77fc2116a",
        "owner": "65c395e9765ee9ee257bd765",
        "holder": "6695b47974444801383847a2"
    },
    "destination": {
        "account": "6667c8baddbdb1bfe0b3e312",
        "alias": "LUISA_POSTRES_YOUR_POINTS",
        "owner": "65c395e9765ee9ee257bd765",
        "holder": "6667c87d3e551062b39dafb1"
    },
    "value": "5000",
    "asset": "YOUR_POINTS",
    "data": {},
    "type": "payment",
    "related": [
        {
            "type": "apps.payment",
            "value": "BJgJVrqEnQIpYpQpLxrY",
            "created_at": 1721141056486
        }
    ],
    "holder": "65c395e9765ee9ee257bd766",
    "owner": "65c395e9765ee9ee257bd765",
    "created_at": 1721293350429,
    "external": [],
    "status": "PROCESSING",
    "error": null,
    "amount": "5000"
}

Last updated