Skip to main content
POST
/
admin
/
api
/
v1
/
offers
/
{offer_id}
cURL
curl --request POST \
  --url https://merits.blockscout.com/admin/api/v1/offers/{offer_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "details": {},
  "price": "<string>",
  "weight": 123,
  "valid_since": "<string>",
  "valid_until": "<string>",
  "redemptions_limit": 123,
  "min_passport_score": "<string>",
  "is_hidden": true,
  "is_unique_per_address": true,
  "is_auto_filled": true
}
'
import requests

url = "https://merits.blockscout.com/admin/api/v1/offers/{offer_id}"

payload = {
    "details": {},
    "price": "<string>",
    "weight": 123,
    "valid_since": "<string>",
    "valid_until": "<string>",
    "redemptions_limit": 123,
    "min_passport_score": "<string>",
    "is_hidden": True,
    "is_unique_per_address": True,
    "is_auto_filled": True
}
headers = {
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    details: {},
    price: '<string>',
    weight: 123,
    valid_since: '<string>',
    valid_until: '<string>',
    redemptions_limit: 123,
    min_passport_score: '<string>',
    is_hidden: true,
    is_unique_per_address: true,
    is_auto_filled: true
  })
};

fetch('https://merits.blockscout.com/admin/api/v1/offers/{offer_id}', 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://merits.blockscout.com/admin/api/v1/offers/{offer_id}",
  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([
    'details' => [
        
    ],
    'price' => '<string>',
    'weight' => 123,
    'valid_since' => '<string>',
    'valid_until' => '<string>',
    'redemptions_limit' => 123,
    'min_passport_score' => '<string>',
    'is_hidden' => true,
    'is_unique_per_address' => true,
    'is_auto_filled' => true
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "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://merits.blockscout.com/admin/api/v1/offers/{offer_id}"

	payload := strings.NewReader("{\n  \"details\": {},\n  \"price\": \"<string>\",\n  \"weight\": 123,\n  \"valid_since\": \"<string>\",\n  \"valid_until\": \"<string>\",\n  \"redemptions_limit\": 123,\n  \"min_passport_score\": \"<string>\",\n  \"is_hidden\": true,\n  \"is_unique_per_address\": true,\n  \"is_auto_filled\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<api-key>")
	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://merits.blockscout.com/admin/api/v1/offers/{offer_id}")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"details\": {},\n  \"price\": \"<string>\",\n  \"weight\": 123,\n  \"valid_since\": \"<string>\",\n  \"valid_until\": \"<string>\",\n  \"redemptions_limit\": 123,\n  \"min_passport_score\": \"<string>\",\n  \"is_hidden\": true,\n  \"is_unique_per_address\": true,\n  \"is_auto_filled\": true\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://merits.blockscout.com/admin/api/v1/offers/{offer_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"details\": {},\n  \"price\": \"<string>\",\n  \"weight\": 123,\n  \"valid_since\": \"<string>\",\n  \"valid_until\": \"<string>\",\n  \"redemptions_limit\": 123,\n  \"min_passport_score\": \"<string>\",\n  \"is_hidden\": true,\n  \"is_unique_per_address\": true,\n  \"is_auto_filled\": true\n}"

response = http.request(request)
puts response.read_body
{}
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "@type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Authentication token, prefixed by Bearer: Bearer

Path Parameters

offer_id
string
required

Body

application/json
details
object
price
string
weight
integer<int32>
valid_since
string
valid_until
string
redemptions_limit
integer<int32>
min_passport_score
string
is_hidden
boolean
is_unique_per_address
boolean
is_auto_filled
boolean

Response

A successful response.

The response is of type object.