---
updatedAt: 2026-05-30T03:15:38.000Z
agentTools:
  projectIndex: https://docs.frisbii.com/llms.txt
---

# Create credit

A credit is given a handle for own reference. Text will be reflected on the invoice.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "API",
    "description": "REST API to manage Frisbii resources",
    "contact": {
      "email": "support@frisbii.com"
    },
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.frisbii.com"
    }
  ],
  "paths": {
    "/v1/credit": {
      "post": {
        "tags": [
          "credit"
        ],
        "summary": "Create credit",
        "operationId": "createCreditJson",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCredit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credit"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, see error codes at https://api.frisbii.com/v1/error_codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "None or invalid credentials provided in access to secured resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized to perform resource operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource or referenced resource not found, see error codes at https://api.frisbii.com/v1/error_codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request limiting exceeded, request rate or concurrent requests, see error code 122 and 123",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal service error, error is reported automatically to Frisbii",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "required": [
          "code",
          "error",
          "http_reason",
          "http_status",
          "path",
          "request_id",
          "timestamp"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Frisbii API [error codes](https://api.frisbii.com/v1/error_codes)",
            "format": "int32",
            "example": 12
          },
          "error": {
            "type": "string",
            "description": "Short error message",
            "example": "Subscription not found"
          },
          "message": {
            "type": "string",
            "description": "Optional clarifying error message"
          },
          "path": {
            "type": "string",
            "description": "The path generating the error response",
            "example": "/v1/subscription/sub0019"
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp for the error response in ISO-8601 extended offset date-time format",
            "format": "date-time"
          },
          "http_status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "int32",
            "example": 404
          },
          "http_reason": {
            "type": "string",
            "description": "HTTP reason of the error",
            "example": "Not Found"
          },
          "request_id": {
            "type": "string",
            "description": "Request-Id for the failed request",
            "example": "f1988fc2374b4a26a51ebd876b478428"
          },
          "transaction_error": {
            "type": "string",
            "description": "Optional transaction error in the case the request involved a transaction processing. See [transaction errors](https://docs.frisbii.com/reference/transaction_errors).",
            "example": "credit_card_expired"
          }
        },
        "description": "Generic error response"
      },
      "CreditInvoice": {
        "required": [
          "amount",
          "created",
          "credit",
          "text"
        ],
        "type": "object",
        "properties": {
          "credit": {
            "minLength": 1,
            "type": "string",
            "description": "Credit handle",
            "example": "credit002"
          },
          "amount": {
            "minimum": 0,
            "type": "integer",
            "description": "The credit amount transferred to invoice",
            "format": "int32",
            "example": 10000
          },
          "created": {
            "type": "string",
            "description": "Date when credit was transferred to invoice. In [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-04-04T12:40:56.656Z"
          },
          "text": {
            "minLength": 1,
            "type": "string",
            "description": "Text describing the credit.",
            "example": "Credit for lower bandwidth"
          }
        },
        "description": "The connection between a credit and an invoice"
      },
      "CreditNoteLine": {
        "required": [
          "amount",
          "quantity",
          "text"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "minimum": 1,
            "type": "integer",
            "description": "Credit note line total amount",
            "format": "int32",
            "example": 15000
          },
          "text": {
            "minLength": 1,
            "type": "string",
            "description": "Credit note line text",
            "example": "Refund product X"
          },
          "description": {
            "type": "string",
            "description": "Order line description",
            "example": "Product X"
          },
          "quantity": {
            "type": "integer",
            "description": "Credit note line quantity",
            "format": "int32",
            "example": 1
          },
          "vat": {
            "type": "number",
            "description": "Vat for this credit note line",
            "format": "float",
            "example": 0.25
          },
          "created": {
            "type": "string",
            "description": "Creation date for this credit note line, in [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-04-04T12:40:56.656Z"
          },
          "origin": {
            "type": "string",
            "description": "Order line origin, one of the following: `plan`, `add_on`, `ondemand`, `additional_cost`, `credit`, `discount`, `setup_fee`, `surcharge_fee`, `metered_billing_product`",
            "example": "plan",
            "enum": [
              "plan",
              "add_on",
              "ondemand",
              "additional_cost",
              "credit",
              "discount",
              "setup_fee",
              "surcharge_fee",
              "metered_billing_product"
            ]
          },
          "order_line_id": {
            "type": "string",
            "description": "Reference to invoice orderline this credit note line relates to",
            "example": "7f014d7f5d9e4ee89f1741a8cfe214d7"
          },
          "amount_incl_vat": {
            "type": "integer",
            "description": "Credit note line total amount including VAT",
            "format": "int32",
            "example": 1230
          },
          "amount_ex_vat": {
            "type": "integer",
            "description": "Credit note line total amount excluding VAT",
            "format": "int32",
            "example": 1230
          },
          "unit_amount": {
            "type": "integer",
            "description": "Credit note line unit amount",
            "format": "int32",
            "example": 230
          },
          "unit_amount_vat": {
            "type": "integer",
            "description": "Credit note line vat amount",
            "format": "int32",
            "example": 230
          },
          "unit_amount_ex_vat": {
            "type": "integer",
            "description": "Credit note line unit amount excluding VAT",
            "format": "int32",
            "example": 230
          },
          "amount_incl_vat_defined": {
            "type": "boolean",
            "description": "Whether the total and units are including VAT.",
            "example": true
          },
          "period_from": {
            "type": "string",
            "description": "The start of billing period in [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-04-04T12:40:56.656Z"
          },
          "period_to": {
            "type": "string",
            "description": "The end of billing period in [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-05-04T12:40:56.656Z"
          },
          "cost_object": {
            "type": "string",
            "description": "Cost object number (Kostenträger-Nr.) this line is booked to",
            "example": "KT-4711"
          }
        },
        "description": "Credit note lines"
      },
      "InvoiceCreditNote": {
        "required": [
          "amount",
          "amount_vat",
          "created",
          "credit_note_lines",
          "currency",
          "customer",
          "id",
          "invoice"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "Credit note id",
            "example": "c33fbb06a00e4dc0b9055f6fb509c0ed"
          },
          "invoice": {
            "type": "string",
            "description": "Invoice credited by this note",
            "example": "inv-2021"
          },
          "transaction": {
            "type": "string",
            "description": "Refund transaction id if credit note has an associated refund",
            "example": "082ebeb1b5864e019b6bf13cad7c535b"
          },
          "credit": {
            "type": "string",
            "description": "Credit reference if the credit note relates to a subscription credit",
            "example": "credit-234"
          },
          "amount": {
            "type": "integer",
            "description": "Credit note amount",
            "format": "int32",
            "example": 15000
          },
          "created": {
            "type": "string",
            "description": "Creation date for note, in [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-04-04T12:40:56.656Z"
          },
          "currency": {
            "type": "string",
            "description": "Credit note currency in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) three letter alpha code",
            "example": "DKK"
          },
          "customer": {
            "minLength": 1,
            "type": "string",
            "description": "Customer handle",
            "example": "customer006"
          },
          "subscription": {
            "type": "string",
            "description": "Subscription handle, will be null for a one-time customer invoice",
            "example": "sub010"
          },
          "amount_vat": {
            "type": "integer",
            "description": "Credit note vat amount calculated as rounded summed fractional vats for each credit note lines",
            "format": "int32",
            "example": 2000
          },
          "amount_ex_vat": {
            "type": "integer",
            "description": "Credit note total amount excluding VAT calculated as summed amounts excl. vats for each credit note lines",
            "format": "int32",
            "example": 1323
          },
          "credit_note_lines": {
            "type": "array",
            "description": "Credit note lines",
            "items": {
              "$ref": "#/components/schemas/CreditNoteLine"
            }
          },
          "accounting_number": {
            "type": "string",
            "description": "Credit note accounting number",
            "example": "CN-2024-03-00005"
          },
          "debtor_id": {
            "type": "integer",
            "description": "Customer debtor id",
            "format": "int64",
            "example": 10001
          },
          "download_url": {
            "type": "string",
            "description": "Link to the credit note PDF, available if PDF generation and accounting features are enabled (only for subscription invoices, not charges). Access requires authentication. See https://docs.frisbii.com/reference/authentication. The response is a binary PDF file.",
            "example": "https://example.com/123"
          },
          "accounting_created_date": {
            "type": "string",
            "description": "When the credit note was created. A credit note is created when a non-charging invoice is cancelled or refunded. Timestamp in [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time",
            "example": "2015-04-04T12:40:56.656Z"
          },
          "cost_center": {
            "type": "string",
            "description": "Cost center for accounting purposes"
          },
          "po_number": {
            "type": "string",
            "description": "Purchase order number for accounting purposes"
          },
          "sales_rep_id": {
            "type": "string",
            "description": "Sales representative identifier",
            "example": "sales-rep-001"
          },
          "order_id": {
            "type": "string",
            "description": "Order identifier",
            "example": "order-12345"
          },
          "invoice_file_type": {
            "type": "string",
            "description": "The type of invoice file, e.g. `pdf`",
            "example": "pdf",
            "enum": [
              "pdf",
              "pdf_xml"
            ]
          }
        },
        "description": "Invoice credit notes"
      },
      "Credit": {
        "required": [
          "amount",
          "created",
          "handle",
          "pending_amount",
          "state",
          "subscription",
          "text"
        ],
        "type": "object",
        "properties": {
          "subscription": {
            "minLength": 1,
            "type": "string",
            "description": "Subscription by handle to add the credit to",
            "example": "sub000219"
          },
          "handle": {
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_\\.\\-@]*$",
            "type": "string",
            "description": "Per account unique handle for the credit. Max length 255 with allowable characters [a-zA-Z0-9_.-@].",
            "example": "credit02"
          },
          "amount": {
            "minimum": 0,
            "type": "integer",
            "description": "Credit amount in the smallest unit for the subscription currency",
            "format": "int32",
            "example": 20000
          },
          "text": {
            "minLength": 1,
            "type": "string",
            "description": "Text describing the credit. Will be on affected invoices.",
            "example": "Credit for lower bandwidth"
          },
          "state": {
            "minLength": 1,
            "type": "string",
            "description": "State of the credit, one of the following: `pending`, `transferred`, `cancelled`. Pending credits have not yet been transferred fully to invoices. Cancelled credits have been manually cancelled.",
            "example": "transferred",
            "enum": [
              "pending",
              "transferred",
              "cancelled"
            ]
          },
          "created": {
            "type": "string",
            "description": "Date when the credit was created. In [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) extended offset date-time format.",
            "format": "date-time"
          },
          "valid_from": {
            "type": "string",
            "description": "Date on the form yyyy-MM-dd from which the credit is valid. The credit will not be deducted from invoices before this date.",
            "example": "2015-07-01"
          },
          "credit_invoices": {
            "type": "array",
            "description": "List of invoices where the credit is applied",
            "items": {
              "$ref": "#/components/schemas/CreditInvoice"
            }
          },
          "pending_amount": {
            "minimum": 0,
            "type": "integer",
            "description": "Remaining amount not transferred to invoices",
            "format": "int32",
            "example": 0
          },
          "invoice_credit_note": {
            "$ref": "#/components/schemas/InvoiceCreditNote"
          }
        }
      },
      "CreateCredit": {
        "required": [
          "amount",
          "handle",
          "subscription",
          "text"
        ],
        "type": "object",
        "properties": {
          "subscription": {
            "minLength": 1,
            "type": "string",
            "description": "Subscription by handle to add the credit to",
            "example": "sub000219"
          },
          "handle": {
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_\\.\\-@]*$",
            "type": "string",
            "description": "Per account unique handle for the credit. Max length 255 with allowable characters [a-zA-Z0-9_.-@].",
            "example": "credit02"
          },
          "amount": {
            "minimum": 0,
            "type": "integer",
            "description": "Credit amount in the smallest unit for the subscription currency",
            "format": "int32",
            "example": 20000
          },
          "text": {
            "minLength": 1,
            "type": "string",
            "description": "Text describing the credit. Will be on affected invoices.",
            "example": "Credit for lower bandwidth"
          },
          "valid_from": {
            "type": "string",
            "description": "Date on the form yyyy-MM-dd from which the credit is valid. The credit will not be deducted from invoices before this date.",
            "example": "2015-07-01"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```