Skip to main content
POST
/
api
/
v1
/
sales
/
{sale_id}
/
returns
Crear nota de crédito por devolución
curl --request POST \
  --url https://api.lapyme.com.ar/api/v1/sales/{sale_id}/returns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "items": [
    {
      "sale_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 123,
      "unit_price": 1,
      "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "discount_amount": 1,
      "discount_percentage": 50,
      "subtotal": 1,
      "tax_amount": 1,
      "total": 1
    }
  ],
  "payment_date": "2023-12-25",
  "notes": "<string>",
  "refund_amounts_by_method": {},
  "restock_inventory": true,
  "integration_source": "<string>",
  "integration_id": "<string>",
  "auto_invoicing": true,
  "skip_refund_payment": true,
  "operator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'
{
  "request_id": "<string>",
  "data": {
    "credit_note": {
      "object": "credit_note",
      "sale_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "total": 123,
      "invoice_status": "<string>",
      "invoice_number": 123,
      "formatted_invoice_number": "<string>",
      "voucher_type": "<string>"
    }
  },
  "warnings": [
    "<unknown>"
  ]
}

Authorizations

Authorization
string
header
required

Incluí tu API key en el header Authorization con el prefijo Bearer.

Headers

Idempotency-Key
string
required

Clave estable para deduplicar reintentos de la misma operación.

Path Parameters

sale_id
string<uuid>
required

ID de la venta original

Body

application/json
items
object[]
required
Minimum array length: 1
payment_date
string<date>
notes
string
refund_amounts_by_method
object
restock_inventory
boolean
integration_source
string | null
integration_id
string | null
auto_invoicing
boolean
skip_refund_payment
boolean
operator_id
string<uuid>

Response

Nota de crédito creada exitosamente

request_id
string
data
object
warnings
any[]