API Reference

API Docs of the Giftcard Module API

Authentication

In order to use the Giftcard API users must authenticate using a bearer to access the endpoints. Bearer tokens can be obtained within the Admin Area -> API Keys -> Create (on your application).

Bearer tokens can only be created and used by root administrators (users that have the admin.root permission).

Bearer tokens can be specified inside the Authorization header in your request.

Header
Value

Authorization

Bearer <your_access_token>

curl -H "Authorization: Bearer <your_access_token>" https://wemx.app/giftcard/api/v1/test

Replace <your_access_token> with your Bearer token.

circle-exclamation
chevron-right https://wemx.app/giftcards/api/v1/test Try if the Giftcard API workes Returns if the giftcard API is working hashtag

{
	"success": true,
	"message": "Gift card API is working"
}

chevron-right https://wemx.app/giftcards/api/v1/create Create a Giftcardhashtag

Create a Giftcard with given Values

giftcard_value* Numeric Value of the Giftcard giftcard_status active/inactive Status of the Giftcard buyer_id Numeric Buyer UserID for gift card management

{
	"success": true,
	"data": {
		"giftcard_code": "4GOSL-OL933-X6BH8-LODV",
		"giftcard_value": "10",
		"giftcard_status": "active",
		"buyer_id": "1",
		"updated_at": "2024-02-27T16:58:25.000000Z",
		"created_at": "2024-02-27T16:58:25.000000Z",
		"id": 16
	}
}
chevron-right https://wemx.app/giftcards/api/v1/gencode Create a nice looking codehashtag

Creates a nice looking code if you want to use a extenal thing to gen codes

{
	"success": true,
	"code": "TXO18-KS6VH-IKFH4-2580"
}
chevron-right https://wemx.app/giftcards/api/v1/validate Validates a Giftcard codehashtag

Returns a if the Giftcard is valid or invalid

giftcard_code* String Giftcardcode

That is everything that comes with API version 1 if you want that new stuff is added to the API and a new Version of the API will be developed then create a Feature request at our Github to get it added.

Last updated