Skip to main content

Create a unit card by owner

Service endpoint are subject to change

Method Description#

Create a new unit card for a given user.

HTTP Request#

POST https://api.olyn.com/v1/unit-cards
note

This method allows for batch action. Send a request to create multiple unit-cards for the same owner.

POST https://api.olyn.com/v1/unit-cards/_actions/batch

URL Parameters#

None

Body Parameters#

name required#

String

The name of the unit card. This can be any string.


media required#

Object

A nested object, containing two sub-arrays. imageUrls and videoUrls. Each sub-array contains a list of urls of each subject for that unit-card.


owner required#

String

The owner of the unit card. Must be in the format of provider|id. For example, globalid|123abc


publicKey required#

String

The owner public key from Solana blockchain in base 58 format. For example, 7b1dDYEL5pd5mSiJG3zW1bwZpY4qJKSwDqKADUoiM6ui


metadata optional#

Array(Objects)

Any hash of custom key-value pairs. Also allows for metaType and visibility flags


Sample Code#

Payload example#

{
"name": "PRO TOUR 4000",
"media": {
"imageUrls": ["https://d1udle4ydufmy1.cloudfront.net/60a4befe2026330e72ecdb0b/original-60a4beff2026330e72ecdb0c.jpg"],
"videoUrls": []
},
"owner": "roly|5fbfaa8e1f68b121686fa7c5",
"publicKey": "7b1dDYEL5pd5mSiJG3zW1bwZpY4qJKSwDqKADUoiM6ui",
"metadata": [
{
"key": "itemMetadata",
"value": {
"id": "141249953214522980",
"variant_id": 40660648558782,
"title": "PRO TOUR 4000",
"sku": "",
"variant_title": null
}
},
{
"key": "productId",
"value": "141249953214522980",
"metaType": "RETAIL_IDENTIFIER"
},
{
"key": "retialPrice",
"value": [0.0, "USD"],
"metaType": "PRICE",
"visibility": "PRIVATE"
}
]
}
url = "https://api.olyn.com/v1/unit-cards"
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Returns#

Returns a Unit Card object.

note

Returns an array of Unit Card objects if accessed using batch action.