Skip to main content

Create a unit card by redemption

Service endpoint are subject to change

Method Description#

Create a new unit card for redemption. The unit card is created without owner, and it needs to be claimed, making use of redeem endpoint. The notification to the owner is sent via SMS or e-mail.

HTTP Requestc#

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

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

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.


phone number / email required#

String

Destination to send the notification to claim the assets.


metadata optional#

Array(Objects)

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


Sample Code#

Payload example#

{
"phone":"+0035148591625",
"email": "test@olyn.com",
"name": "PRO TOUR 4000",
"media": {
"imageUrls": ["https://d1udle4ydufmy1.cloudfront.net/60a4befe2026330e72ecdb0b/original-60a4beff2026330e72ecdb0c.jpg"],
"videoUrls": []
},
"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.