Create Product Items
curl --request POST \
--url https://dev.api.mufi.app/v1/products/{id}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"users": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"emails": [
"jsmith@example.com"
]
}
'import requests
url = "https://dev.api.mufi.app/v1/products/{id}/items"
payload = {
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"users": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"emails": ["jsmith@example.com"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
users: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
emails: ['jsmith@example.com']
})
};
fetch('https://dev.api.mufi.app/v1/products/{id}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.api.mufi.app/v1/products/{id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'users' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'emails' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.api.mufi.app/v1/products/{id}/items"
payload := strings.NewReader("{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.api.mufi.app/v1/products/{id}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.mufi.app/v1/products/{id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"item_id": 123,
"redemption_count": 123,
"redemption_quantity": 123,
"is_fully_redeemed": true,
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
},
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"redemption_quantity": 123
},
"redeemed_at": 123
}
]
}{
"errors": [
"<string>"
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Products Endpoints
Create Product Items
Issue product items to users by user ID or email. Users must be customers of the project. At least one of users or emails must be provided.
POST
/
v1
/
products
/
{id}
/
items
Create Product Items
curl --request POST \
--url https://dev.api.mufi.app/v1/products/{id}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"users": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"emails": [
"jsmith@example.com"
]
}
'import requests
url = "https://dev.api.mufi.app/v1/products/{id}/items"
payload = {
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"users": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"emails": ["jsmith@example.com"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
users: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
emails: ['jsmith@example.com']
})
};
fetch('https://dev.api.mufi.app/v1/products/{id}/items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.api.mufi.app/v1/products/{id}/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'users' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'emails' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.api.mufi.app/v1/products/{id}/items"
payload := strings.NewReader("{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.api.mufi.app/v1/products/{id}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.mufi.app/v1/products/{id}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"users\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"emails\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"item_id": 123,
"redemption_count": 123,
"redemption_quantity": 123,
"is_fully_redeemed": true,
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
},
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"redemption_quantity": 123
},
"redeemed_at": 123
}
]
}{
"errors": [
"<string>"
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
A JWT Access Token obtained from Google Cloud.
Path Parameters
The product ID.
Body
application/json
Issue product items to users. Provide user IDs and/or emails.
The ID of the product.
The user IDs to give product items to. At least one of users or emails must be provided.
Maximum array length:
550The user emails to give product items to. At least one of users or emails must be provided.
Maximum array length:
550Response
Product items were successfully created and given to users.
Show child attributes
Show child attributes
⌘I