> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mutasib.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Suppliers API: Manage Suppliers for Your Shop

> Create, list, update, and delete supplier records scoped to a shop via the Mutasib API.

Supplier records let you link products to their source and keep contact details in one place. All supplier endpoints are scoped to a shop.

## List suppliers

**`GET /api/v1/shops/{shop_id}/suppliers`**

```bash theme={null}
curl https://api.mutasib.com/api/v1/shops/42/suppliers \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Returns an array of `SupplierOut` objects.

## Create a supplier

**`POST /api/v1/shops/{shop_id}/suppliers`**

<ParamField body="name" type="string" required>
  Supplier's business or trading name.
</ParamField>

<ParamField body="contact_name" type="string">
  Name of the primary contact person at the supplier.
</ParamField>

<ParamField body="phone" type="string">
  Supplier contact phone number.
</ParamField>

<ParamField body="email" type="string">
  Supplier contact email address.
</ParamField>

<ParamField body="address" type="string">
  Physical or mailing address for the supplier.
</ParamField>

<ParamField body="notes" type="string">
  Free-text notes about this supplier (e.g. payment terms, delivery schedule).
</ParamField>

```bash theme={null}
curl -X POST https://api.mutasib.com/api/v1/shops/42/suppliers \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Al-Fajr Distributors",
    "contact_name": "Khaled Mansour",
    "phone": "+213551234567",
    "email": "khaled@alfajr.dz",
    "address": "Zone Industrielle, Blida",
    "notes": "Delivers every Monday. Net-30 payment terms."
  }'
```

## Get a supplier

**`GET /api/v1/shops/{shop_id}/suppliers/{supplier_id}`**

```bash theme={null}
curl https://api.mutasib.com/api/v1/shops/42/suppliers/9 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Update a supplier

**`PATCH /api/v1/shops/{shop_id}/suppliers/{supplier_id}`**

Send only the fields you want to change. Accepts the same fields as `SupplierIn`.

```bash theme={null}
curl -X PATCH https://api.mutasib.com/api/v1/shops/42/suppliers/9 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "+213559876543" }'
```

## Delete a supplier

**`DELETE /api/v1/shops/{shop_id}/suppliers/{supplier_id}`**

```bash theme={null}
curl -X DELETE https://api.mutasib.com/api/v1/shops/42/suppliers/9 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Returns `204 No Content` on success.

## `SupplierOut` fields

<ResponseField name="id" type="integer">
  Unique supplier ID.
</ResponseField>

<ResponseField name="name" type="string">
  Supplier business name.
</ResponseField>

<ResponseField name="contact_name" type="string">
  Primary contact person, if set.
</ResponseField>

<ResponseField name="phone" type="string">
  Contact phone number, if set.
</ResponseField>

<ResponseField name="email" type="string">
  Contact email address, if set.
</ResponseField>

<ResponseField name="address" type="string">
  Supplier address, if set.
</ResponseField>

<ResponseField name="notes" type="string">
  Free-text notes about the supplier.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of when the supplier was added.
</ResponseField>
