# Offering-ийг бүтнээр солих

> Таны системийн удирддаг offering-ийн олонлогийг бүтнээр нь солино.

Эх: https://docs.tappay.mn/mn/reference/catalog/put-offerings/

Таны системийн удирддаг offering-ийн олонлогийг бүтнээр нь солино. Орхисон offering устна, өөр системийн offering хэвээр үлдэнэ.

`PUT /api/v1/catalog/offerings` Хувилбар 2026-09-27

### Нэвтрэлт

Secret key (Bearer)

### Header

| Нэр | Төрөл | Заавал | Утга | Тайлбар |
| - | - | - | - | - |
| `TapPay-Version` | string | үгүй | | |
| `TapPay-Timestamp` | string | үгүй | | |
| `TapPay-Nonce` | string | үгүй | | |
| `TapPay-Signature` | string | үгүй | | |

### Хүсэлтийн бие

| Нэр | Төрөл | Заавал | Утга | Тайлбар |
| - | - | - | - | - |
| `offerings` | array\<object> | тийм | | |
| `offerings[].offering_id` | string | тийм | | |
| `offerings[].location_ids` | array\<string (uuid)> | үгүй | | |
| `offerings[].category_ids` | array\<string> | үгүй | | |
| `offerings[].name` | string | тийм | | |
| `offerings[].description` | string | үгүй | | |
| `offerings[].media` | array\<object> | үгүй | | |
| `offerings[].media[].url` | string (uri) | тийм | | |
| `offerings[].media[].kind` | string | тийм | `IMAGE` | |
| `offerings[].attributes` | array\<object> | үгүй | | |
| `offerings[].attributes[].label` | string | тийм | | |
| `offerings[].attributes[].value` | string | тийм | | |
| `offerings[].sort` | integer | үгүй | | |
| `offerings[].status` | string | үгүй | `ACTIVE`, `HIDDEN` | |
| `offerings[].pricing` | object | тийм | | |
| `offerings[].pricing.model` | string | тийм | `FIXED`, `FROM`, `VARIABLE`, `ON_REQUEST` | |
| `offerings[].pricing.amount` | integer | тийм | | |
| `offerings[].pricing.unit_label` | string | үгүй | | |
| `offerings[].pricing.compare_at_amount` | integer | үгүй | | |
| `offerings[].selection` | object | үгүй | | |
| `offerings[].selection.quantity` | object | үгүй | | |
| `offerings[].selection.quantity.min` | integer | тийм | | |
| `offerings[].selection.quantity.max` | integer | тийм | | |
| `offerings[].selection.quantity.step` | integer | тийм | | |
| `offerings[].selection.variants` | array\<object> | үгүй | | |
| `offerings[].selection.variants[].variant_id` | string | тийм | | |
| `offerings[].selection.variants[].label` | string | тийм | | |
| `offerings[].selection.variants[].amount` | integer | тийм | | |
| `offerings[].selection.option_groups` | array\<object> | үгүй | | |
| `offerings[].selection.option_groups[].group_id` | string | тийм | | |
| `offerings[].selection.option_groups[].label` | string | тийм | | |
| `offerings[].selection.option_groups[].min` | integer | тийм | | |
| `offerings[].selection.option_groups[].max` | integer | тийм | | |
| `offerings[].selection.option_groups[].options` | array\<object> | тийм | | |
| `offerings[].selection.option_groups[].options[].option_id` | string | тийм | | |
| `offerings[].selection.option_groups[].options[].label` | string | тийм | | |
| `offerings[].selection.option_groups[].options[].price_delta` | integer | тийм | | |
| `offerings[].selection.option_groups[].options[].available` | boolean | үгүй | | |
| `offerings[].schedule` | object \| null | үгүй | | |
| `offerings[].schedule.mode` | string | тийм | `SLOT`, `DATE_RANGE`, `DATETIME` | |
| `offerings[].schedule.duration_minutes` | integer | үгүй | | |
| `offerings[].schedule.min_lead_minutes` | integer | үгүй | | |
| `offerings[].schedule.max_advance_days` | integer | тийм | | |
| `offerings[].fulfillment_modes` | array\<string> | үгүй | | |
| `offerings[].inputs` | array\<object> | үгүй | | |
| `offerings[].inputs[].input_id` | string | тийм | | |
| `offerings[].inputs[].type` | string | тийм | `text`, `number`, `phone`, `email`, `date`, `select`, `multi_select`, `boolean` | |
| `offerings[].inputs[].label` | string | тийм | | |
| `offerings[].inputs[].hint` | string | үгүй | | |
| `offerings[].inputs[].required` | boolean | үгүй | | |
| `offerings[].inputs[].pattern` | string | үгүй | | |
| `offerings[].inputs[].min` | number | үгүй | | |
| `offerings[].inputs[].max` | number | үгүй | | |
| `offerings[].inputs[].options` | array\<string> | үгүй | | |
| `offerings[].availability` | object | үгүй | | |
| `offerings[].availability.available` | boolean | үгүй | | |
| `offerings[].availability.stock` | integer | үгүй | | |
| `offerings[].availability.sale_hours` | unknown | үгүй | | |
| `offerings[].availability.sold_out_until` | string \| null | үгүй | | |
| `offerings[].web_step` | object \| null | үгүй | | |
| `offerings[].web_step.reason` | string | тийм | | |
| `offerings[].web_step.url` | string (uri) | тийм | | |

### Хариу 200

| Нэр | Төрөл | Заавал | Утга | Тайлбар |
| - | - | - | - | - |
| `success` | boolean | тийм | `true` | |
| `data` | object | тийм | | |
| `data.upserted` | integer | тийм | | |
| `data.deleted` | integer | тийм | | |

### Алдаа

| Код | Status | Мессеж |
| - | - | - |
| [`AUTH-001`](https://docs.tappay.mn/mn/errors.md#AUTH-001) | 401 | API key байхгүй, буруу эсвэл хүчингүй болсон байна. |
| [`EVT-206`](https://docs.tappay.mn/mn/errors.md#EVT-206) | 401 | Production key sandbox-д хүлээн авахгүй. Sandbox key (sk_test\_/pk_test\_) ашиглана уу. |
| [`EVT-207`](https://docs.tappay.mn/mn/errors.md#EVT-207) | 401 | Sandbox key production-д хүлээн авахгүй. Production key (sk_live\_/pk_live\_) ашиглана уу. |
| [`AUTH-018`](https://docs.tappay.mn/mn/errors.md#AUTH-018) | 403 | Хүсэлт түлхүүрийн зөвшөөрөгдсөн IP жагсаалтад ороогүй хаягаас ирсэн. |
| [`AUTH-058`](https://docs.tappay.mn/mn/errors.md#AUTH-058) | 403 | API key-д энэ үйлдэлд шаардлагатай scope байхгүй байна. |
| [`SIG-002`](https://docs.tappay.mn/mn/errors.md#SIG-002) | 401 | Хүсэлтийн цагийн тэмдэг зөвшөөрөгдсөн хугацааны гадна байна. |
| [`SIG-003`](https://docs.tappay.mn/mn/errors.md#SIG-003) | 401 | Хүсэлтийн гарын үсэг байхгүй эсвэл таарахгүй байна. |
| [`SIG-005`](https://docs.tappay.mn/mn/errors.md#SIG-005) | 409 | Энэ хүсэлтийн nonce өмнө нь ашиглагдсан байна. |
| [`VAL-014`](https://docs.tappay.mn/mn/errors.md#VAL-014) | 400 | TapPay-Version header нь мэдэгдэх API хувилбар биш байна. |
| [`BIZ-004`](https://docs.tappay.mn/mn/errors.md#BIZ-004) | 403 | Terminal идэвхгүй байна. |
| [`BIZ-005`](https://docs.tappay.mn/mn/errors.md#BIZ-005) | 403 | Мерчантын данс энэ хүсэлтийг зөвшөөрөх төлөвт байхгүй байна. |
| [`CAT-005`](https://docs.tappay.mn/mn/errors.md#CAT-005) | 422 | Каталогийн талбар эсвэл offering буруу. |
| [`CAT-008`](https://docs.tappay.mn/mn/errors.md#CAT-008) | 404 | Каталогийн мөр, салбар эсвэл offering олдсонгүй. |
| [`CAT-004`](https://docs.tappay.mn/mn/errors.md#CAT-004) | 422 | Offering-ийн тоо каталогийн хязгаараас хэтэрсэн. |
| [`CAT-006`](https://docs.tappay.mn/mn/errors.md#CAT-006) | 422 | Хувьсах үнэтэй offering-д урьдчилсан зөвшөөрөл (pre-auth) идэвхтэй байх шаардлагатай. |
| [`CAT-010`](https://docs.tappay.mn/mn/errors.md#CAT-010) | 403 | Offering-ийг өөр систем удирддаг. |

Playground-д туршиж үзэх: https://docs.tappay.mn/mn/reference/catalog/put-offerings/

```bash title="curl"
curl -sS -X PUT "https://api.tappay.mn/api/v1/catalog/offerings" \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "TapPay-Version: 2026-09-27" \
  -H "Content-Type: application/json" \
  -d '{"offerings":[{"offering_id":"latte-m","name":"Latte (M)","pricing":{"model":"FIXED","amount":9000},"fulfillment_modes":["PICKUP"]}]}'
```

```js title="Node.js"
import { TapPay } from '@tappay-mn/node';

const tappay = new TapPay({ apiKey: 'sk_test_YOUR_SECRET_KEY' });
const result = await tappay.catalog.putOfferings({
  body: {
    offerings: [
      {
        offering_id: 'latte-m',
        name: 'Latte (M)',
        pricing: {
          model: 'FIXED',
          amount: 9000,
        },
        fulfillment_modes: ['PICKUP'],
      },
    ],
  },
});
console.log(JSON.stringify(result));
```

```php title="PHP"
<?php
require 'vendor/autoload.php';

use TapPay\TapPay;

$tappay = new TapPay(['apiKey' => 'sk_test_YOUR_SECRET_KEY']);
$result = $tappay->catalog->putOfferings([
    'body' => [
        'offerings' => [
            [
                'offering_id' => 'latte-m',
                'name' => 'Latte (M)',
                'pricing' => [
                    'model' => 'FIXED',
                    'amount' => 9000,
                ],
                'fulfillment_modes' => ['PICKUP'],
            ],
        ],
    ],
]);
echo json_encode($result);
```

```python title="Python"
import json
import tappay

client = tappay.TapPay("sk_test_YOUR_SECRET_KEY")
result = client.catalog.put_offerings({
    "body": {
        "offerings": [
            {
                "offering_id": "latte-m",
                "name": "Latte (M)",
                "pricing": {
                    "model": "FIXED",
                    "amount": 9000,
                },
                "fulfillment_modes": ["PICKUP"],
            },
        ],
    },
})
print(json.dumps(result))
```

```json title="Response"
{
  "success": true,
  "data": {
    "upserted": 1,
    "deleted": 0
  }
}
```
