İçeriğe geç
Lumean API

Açıklamalar İngilizce

Bölümün arayüzü dilinize çevrildi, ancak işlem, şema ve hata açıklamaları yalnızca Rusça ve İngilizce mevcut — burada İngilizce sürüm gösteriliyor.
POST/reseller/codes

Issue gift codes

Issues gift codes at the reseller's personal discount, paid from the reseller balance. The response carries the batch with the FULL codes.

Body: nominals — code nominals in LMC (strings or numbers), one per code.

Idempotency: send the Idempotency-Key header (1–64 characters A-Z a-z 0-9 _ . : -) so that a network retry cannot issue a second batch. A retry with the same key and the same nominals returns the original batch — 200 plus the Idempotent-Replayed: true header, and the balance is not charged again; the same key with different nominals gives 422 idempotency_key_mismatch.

Key permission: reseller.write.

Bu sayfada(4)

Parametreler

Giriş alanları doğrudan istek satırında yer alır: bir değer girin, hazır URL'yi alın. Aşağıda her parametrenin türü, zorunlu olup olmadığı ve izin verilen değerleri var.

POSThttps://api.lumean.app/api/public/reseller/codes

    İstek gövdesi

    application/jsonzorunlu

    Issuing codes from the reseller balance. The Idempotency-Key header is optional but recommended: with it a network retry cannot issue a second batch.

    Örnek gövde
    {
      "nominals": [
        1
      ]
    }

    Alanlar

    nominalszorunlu

    Code nominals in LMC, one number per code: as many codes as elements. Numbers and decimal strings are accepted; a nominal is either one of the presets from GET /reseller/settings or between min_nominal and max_nominal. The number of elements is capped by limits.max_codes_per_issue from GET /reseller.

    en az öğe: 1en fazla öğe: 1000
    array<number>
    Örnek [100,100,250]

    Olası yanıtlar

    200

    A replay by Idempotency-Key: the original batch, with the Idempotent-Replayed: true header; the balance is not charged again.

    Gövde örneği
    {
      "success": true,
      "message": "string",
      "data": {
        "uuid": "string",
        "source": "string",
        "codes_count": "string",
        "nominal_total": "string",
        "nominal_total_formatted": 1,
        "cost_total": "string",
        "cost_total_formatted": 1,
        "discount_bps": 1,
        "codes": [
          {
            "uuid": "string",
            "code_masked": "string",
            "code": "string",
            "nominal": "string",
            "nominal_formatted": 1,
            "cost": "string",
            "cost_formatted": 1,
            "discount_bps": 1,
            "source": "string",
            "funding": "string",
            "status": "string",
            "activatable_at": "string",
            "redeemed_at": "string",
            "cancelled_at": "string",
            "created_at": "string",
            "currency_asset": {
              "code": "string",
              "precision": 1
            }
          }
        ],
        "created_at": "string",
        "currency_asset": {
          "code": "string",
          "precision": 1
        }
      }
    }
    Yanıt alanları
    successzorunlu

    Success flag. Branch on the HTTP status code instead: any 2xx response carries true here, while an error comes back in a different shape that need not contain this field at all.

    boolean
    messagezorunlu

    A human-readable note in the account language. Fine to show to a user; do not parse it — the wording changes without notice and is not an error code.

    string
    datazorunlu

    The issued batch. On a replay by Idempotency-Key (code 200, header Idempotent-Replayed: true) it is the same batch as in the first response; the balance is not charged again.

    GiftCodeBatchGiftCodeBatch
    uuidzorunlu

    The batch id.

    string
    sourcezorunlu

    Always reseller — the batch was issued from the reseller balance.

    string
    codes_countzorunlu

    How many codes the batch holds.

    string
    nominal_totalzorunlu

    Sum of the code nominals, LMC minor units.

    string
    nominal_total_formattedzorunlu

    Sum of the nominals, LMC.

    number
    cost_totalisteğe bağlı

    How much was charged to the reseller balance (nominals minus the discount), LMC minor units.

    string
    cost_total_formattedisteğe bağlı

    Charged to the reseller balance, LMC.

    number
    discount_bpsisteğe bağlı

    The reseller personal discount at issue time, basis points (1000 = 10%).

    integer
    codesisteğe bağlı

    The batch codes with the FULL code value — store them: they are bearer money.

    array<GiftCode>GiftCode
    dizi öğesi
    uuidzorunlu

    Code UUID. Use it in the GET /reseller/codes/{uuid} and POST /reseller/codes/{uuid}/cancel paths.

    string
    code_maskedzorunlu

    The code with a mask, LUM-****-****-XXXX: safe to show in a UI and to write to logs.

    string
    codeisteğe bağlı

    The FULL code value — what the recipient types to redeem it. The reseller public API returns it in the list, on show and on issue. Treat it as a secret: whoever knows the code can redeem it.

    string
    nominalzorunlu

    The code’s nominal value in minor LMC units: real = nominal / 10^currency_asset.precision. This is how much LMC the redeemer receives.

    string
    nominal_formattedzorunlu

    The same nominal value in whole LMC — a number ready to display.

    number
    costisteğe bağlı

    What the code cost the reseller after the discount, in minor LMC units. Present only for reseller codes (source: reseller).

    string
    cost_formattedisteğe bağlı

    The same cost in whole LMC. Present only for reseller codes.

    number
    discount_bpsisteğe bağlı

    The reseller’s discount at the moment of issue, in basis points (100 = 1%). A later change of the personal discount does not affect this code. Present only for reseller codes.

    integer
    sourcezorunlu
    string
    fundingzorunlu
    string
    statuszorunlu
    string
    activatable_atzorunlu

    The moment from which the code can be redeemed; until then it is frozen. null means no restriction.

    string
    redeemed_atzorunlu

    When the code was redeemed. null until it is. The API never reveals who redeemed it.

    string
    cancelled_atzorunlu

    When the reseller cancelled the code. null if it was not cancelled.

    string
    created_atzorunlu

    When the code was issued.

    string
    currency_assetzorunlu

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    How many decimals LMC has: real = value / 10^precision.

    integer
    created_atzorunlu

    When the batch was issued.

    string
    currency_assetzorunlu

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    How many decimals LMC has: real = value / 10^precision.

    integer
    201

    The batch is issued. data holds the batch with the FULL codes in codes[].

    Gövde örneği
    {
      "success": true,
      "message": "string",
      "data": {
        "uuid": "string",
        "source": "string",
        "codes_count": "string",
        "nominal_total": "string",
        "nominal_total_formatted": 1,
        "cost_total": "string",
        "cost_total_formatted": 1,
        "discount_bps": 1,
        "codes": [
          {
            "uuid": "string",
            "code_masked": "string",
            "code": "string",
            "nominal": "string",
            "nominal_formatted": 1,
            "cost": "string",
            "cost_formatted": 1,
            "discount_bps": 1,
            "source": "string",
            "funding": "string",
            "status": "string",
            "activatable_at": "string",
            "redeemed_at": "string",
            "cancelled_at": "string",
            "created_at": "string",
            "currency_asset": {
              "code": "string",
              "precision": 1
            }
          }
        ],
        "created_at": "string",
        "currency_asset": {
          "code": "string",
          "precision": 1
        }
      }
    }
    Yanıt alanları
    successzorunlu

    Success flag. Branch on the HTTP status code instead: any 2xx response carries true here, while an error comes back in a different shape that need not contain this field at all.

    boolean
    messagezorunlu

    A human-readable note in the account language. Fine to show to a user; do not parse it — the wording changes without notice and is not an error code.

    string
    datazorunlu

    The issued batch. On a replay by Idempotency-Key (code 200, header Idempotent-Replayed: true) it is the same batch as in the first response; the balance is not charged again.

    GiftCodeBatchGiftCodeBatch
    uuidzorunlu

    The batch id.

    string
    sourcezorunlu

    Always reseller — the batch was issued from the reseller balance.

    string
    codes_countzorunlu

    How many codes the batch holds.

    string
    nominal_totalzorunlu

    Sum of the code nominals, LMC minor units.

    string
    nominal_total_formattedzorunlu

    Sum of the nominals, LMC.

    number
    cost_totalisteğe bağlı

    How much was charged to the reseller balance (nominals minus the discount), LMC minor units.

    string
    cost_total_formattedisteğe bağlı

    Charged to the reseller balance, LMC.

    number
    discount_bpsisteğe bağlı

    The reseller personal discount at issue time, basis points (1000 = 10%).

    integer
    codesisteğe bağlı

    The batch codes with the FULL code value — store them: they are bearer money.

    array<GiftCode>GiftCode
    dizi öğesi
    uuidzorunlu

    Code UUID. Use it in the GET /reseller/codes/{uuid} and POST /reseller/codes/{uuid}/cancel paths.

    string
    code_maskedzorunlu

    The code with a mask, LUM-****-****-XXXX: safe to show in a UI and to write to logs.

    string
    codeisteğe bağlı

    The FULL code value — what the recipient types to redeem it. The reseller public API returns it in the list, on show and on issue. Treat it as a secret: whoever knows the code can redeem it.

    string
    nominalzorunlu

    The code’s nominal value in minor LMC units: real = nominal / 10^currency_asset.precision. This is how much LMC the redeemer receives.

    string
    nominal_formattedzorunlu

    The same nominal value in whole LMC — a number ready to display.

    number
    costisteğe bağlı

    What the code cost the reseller after the discount, in minor LMC units. Present only for reseller codes (source: reseller).

    string
    cost_formattedisteğe bağlı

    The same cost in whole LMC. Present only for reseller codes.

    number
    discount_bpsisteğe bağlı

    The reseller’s discount at the moment of issue, in basis points (100 = 1%). A later change of the personal discount does not affect this code. Present only for reseller codes.

    integer
    sourcezorunlu
    string
    fundingzorunlu
    string
    statuszorunlu
    string
    activatable_atzorunlu

    The moment from which the code can be redeemed; until then it is frozen. null means no restriction.

    string
    redeemed_atzorunlu

    When the code was redeemed. null until it is. The API never reveals who redeemed it.

    string
    cancelled_atzorunlu

    When the reseller cancelled the code. null if it was not cancelled.

    string
    created_atzorunlu

    When the code was issued.

    string
    currency_assetzorunlu

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    How many decimals LMC has: real = value / 10^precision.

    integer
    created_atzorunlu

    When the batch was issued.

    string
    currency_assetzorunlu

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    How many decimals LMC has: real = value / 10^precision.

    integer
    409

    reseller_inactive — the account is blocked; reseller_insufficient_balance — the balance is not enough.

    Bu yanıtı çözümle
    Gövde örneği
    {
      "success": false,
      "message": "The pay-as-you-go quote is stale — request a fresh one.",
      "reason": "quote_mismatch",
      "error_code": "quote_mismatch",
      "actual_lmc_minor": 380000000,
      "quoted_lmc_minor": 360000000
    }
    Yanıt alanları
    successzorunlu

    Always false in error responses.

    boolean
    messagezorunlu

    Error text in the key's language (set through the X-Locale header).

    string
    reasonzorunlu

    Machine-readable failure reason — branch on this, not on the message text.

    Değerlerquote_mismatch
    string
    error_codezorunlu

    The same machine-readable code as in reason — a second name for the field. The values always match; branch on either.

    Değerlerquote_mismatch
    string
    actual_lmc_minorzorunlu

    What the top-up costs right now (LMC minor units).

    integer
    Örnek 380000000
    quoted_lmc_minorzorunlu

    The price you agreed to earlier (LMC minor units).

    integer
    Örnek 360000000
    422

    Validation error; gift_code_nominal_not_allowed, reseller_too_many_codes, idempotency_key_mismatch — the same key with different nominals.

    Bu yanıtı çözümle
    Gövde örneği
    {
      "message": "string",
      "errors": {
        "key": [
          "string"
        ]
      }
    }
    Yanıt alanları
    messagezorunlu

    Errors overview.

    string
    errorszorunlu

    A detailed description of each field that failed validation.

    object
    *isteğe bağlı
    rastgele anahtarlar
    array<string>

    Bu sayfayı yapay zekâya verin

    .md sürümünü açllm.md

    spesifikasyon 0.0.1