Emit a health document — Credit notes
/api/v1/workspaces/{workspaceId}/credit-notesOperation ID: creditNotes.emit · Access: PAT with send scope and authorized workspace where applicable · Effect: external.
An Idempotency-Key is required. Retry the same intent with the same key and the same request bytes. Read the retry rules.
Read the credit notes workflow before this operation.
Parameters
Section titled “Parameters”| Name | In | Required | Type / allowed values |
|---|---|---|---|
workspaceId |
path | Yes | string |
idempotency-key |
header | Yes | string |
Request body
Section titled “Request body”Content type: application/json · Required: yes.
Schema: EmitCreditNoteInput. Browse schema fields.
Example: partial
Synthetic contract example. Replace identifiers and clinical data with authorized values. This example does not prove ministry acceptance.
{ "invoiceId": "invoice-demo-001", "creditNoteResolutionId": "credit-resolution-demo-001", "discrepancyResponseCode": 1, "discrepancyResponseDescription": "Devolución de servicio (ejemplo sintético)", "selectedItems": [ { "patientConsecutivo": 1, "includeAllServices": false, "selectedServices": [ { "serviceCategory": "consultas", "serviceConsecutivo": 1 } ] } ], "creditNotePayload": { "credit_note_lines": [ { "description": "Consulta de medicina general (ejemplo sintético)", "code": "890201", "invoiced_quantity": "1", "price_amount": "100000.00", "line_extension_amount": "100000.00" } ], "legal_monetary_totals": { "line_extension_amount": "100000.00", "tax_exclusive_amount": "100000.00", "tax_inclusive_amount": "100000.00", "payable_amount": "100000.00" } }}Example: total
Synthetic contract example. Replace identifiers and clinical data with authorized values. This example does not prove ministry acceptance.
{ "invoiceId": "invoice-demo-001", "creditNoteResolutionId": "credit-resolution-demo-001", "discrepancyResponseCode": 2, "discrepancyResponseDescription": "Anulación total (ejemplo sintético)", "creditNotePayload": { "credit_note_lines": [ { "description": "Consulta de medicina general (ejemplo sintético)", "code": "890201", "invoiced_quantity": "1", "price_amount": "100000.00", "line_extension_amount": "100000.00" } ], "legal_monetary_totals": { "line_extension_amount": "100000.00", "tax_exclusive_amount": "100000.00", "tax_inclusive_amount": "100000.00", "payable_amount": "100000.00" } }}Responses
Section titled “Responses”| HTTP | Content | Schema |
|---|---|---|
| 201 | application/json |
CreditNote |
| 202 | application/json |
CreditNote |
| 400 | application/json |
ApiError |
| 401 | application/json |
ApiError |
| 403 | application/json |
ApiError |
| 404 | application/json |
ApiError |
| 409 | application/json |
ApiError |
| 413 | application/json |
ApiError |
| 415 | application/json |
ApiError |
| 422 | application/json |
ApiError |
| 428 | application/json |
ApiError |
| 500 | application/json |
ApiError |
| 502 | application/json |
ApiError |
| 503 | application/json |
ApiError |
Use error.code, error.issues, and requestId for JSON errors. Error and recovery guide.
Set the connection variables from the quickstart. Set each path variable to an authorized identifier or an allowed parameter value from the table above.
Save your authorized JSON input as request.json. Use the request schema and examples above; replace synthetic data before use.
Set IDEMPOTENCY_KEY to a unique key for this intent. Preserve it and the exact request for retries.
curl --fail-with-body --request POST \ "$RIPSCLOUD_BASE_URL/api/v1/workspaces/$WORKSPACE_ID/credit-notes" \ --header "Authorization: Bearer $RIPSCLOUD_TOKEN" \ --header 'Accept: application/json' \ --header "Idempotency-Key: $IDEMPOTENCY_KEY" \ --header 'Content-Type: application/json' \ --data-binary @request.json