---
updatedAt: 2026-06-30T16:05:21.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Pay invoice (offline)

Mark an invoice as paid offline.

## Overview

Record a payment made outside of Pelcro for an open invoice. Use this endpoint when customers pay by check, cash, wire transfer, or other offline methods.

**Example:** A customer mails a check for their annual subscription. When the check clears, record the offline payment to mark the invoice as paid.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "core-api",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/core"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      },
      "sec1": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/invoices/{id}/pay_offline": {
      "post": {
        "summary": "Pay invoice (offline)",
        "description": "Mark an invoice as paid offline.",
        "operationId": "api-core-pay-invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the invoice.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "site_id",
            "in": "query",
            "description": "The unique identifier of the site associated with your account.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer eyJ***"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reference"
                ],
                "properties": {
                  "reference": {
                    "type": "string",
                    "description": "The reference for the payment, usually a cheque number"
                  },
                  "payment_category": {
                    "type": "string",
                    "description": "2 for check, 3 for wire, 4 for transfer, 5 for external, 6 for cash",
                    "enum": [
                      "2",
                      "3",
                      "4",
                      "5",
                      "6"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"data\": {\n    \"id\": 1,\n    \"amount_due\": 15000,\n    \"amount_paid\": 15000,\n    \"amount_remaining\": 0,\n    \"auto_advance\": false,\n    \"billing\": \"send_invoice\",\n    \"billing_reason\": \"subscription_create\",\n    \"currency\": \"cad\",\n    \"due_date\": 1622122811,\n    \"user_id\": 4,\n    \"charge_id\": 18,\n    \"subscription_id\": 1,\n    \"user\": {\n      \"id\": 4,\n      \"display_name\": null,\n      \"email\": \"example@example.com\",\n      \"email_confirm\": false,\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\",\n      \"mail_marketing\": false,\n      \"metadata\": {\n        \"pelcro_account_id\": \"1\",\n        \"pelcro_customer_id\": \"4\"\n      },\n      \"name\": \"name\",\n      \"old_provider_id\": null,\n      \"phone\": null,\n      \"phone_confirm\": false,\n      \"salutation\": null,\n      \"title\": null,\n      \"profile_photo\": null,\n      \"default_source_id\": null,\n      \"tele_marketing\": false,\n      \"created_at\": 1619530774,\n      \"updated_at\": 1619530775,\n      \"deleted_at\": null\n    },\n    \"plan_name\": null,\n    \"product_name\": null,\n    \"ending_balance\": 0,\n    \"hosted_invoice_url\": \"hosted_invoice_url\",\n    \"invoice_pdf\": \"invoice_pdf\",\n    \"is_imported\": null,\n    \"number\": \"DD4432F2-0001\",\n    \"paid\": true,\n    \"period_start\": 1619530811,\n    \"period_end\": 1619530811,\n    \"post_payment_credit_notes_amount\": 0,\n    \"pre_payment_credit_notes_amount\": 0,\n    \"starting_balance\": 0,\n    \"status\": \"paid\",\n    \"subtotal\": 15000,\n    \"tax\": null,\n    \"total\": 15000,\n    \"finalized_at\": 1619530812,\n    \"marked_uncollectible_at\": null,\n    \"paid_at\": null,\n    \"voided_at\": null,\n    \"created_at\": 1619530811,\n    \"updated_at\": 1620327561,\n    \"deleted_at\": null\n  },\n  \"status\": \"success\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "amount_due": {
                          "type": "integer",
                          "example": 15000,
                          "default": 0
                        },
                        "amount_paid": {
                          "type": "integer",
                          "example": 15000,
                          "default": 0
                        },
                        "amount_remaining": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "auto_advance": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "billing": {
                          "type": "string",
                          "example": "send_invoice"
                        },
                        "billing_reason": {
                          "type": "string",
                          "example": "subscription_create"
                        },
                        "currency": {
                          "type": "string",
                          "example": "cad"
                        },
                        "due_date": {
                          "type": "integer",
                          "example": 1622122811,
                          "default": 0
                        },
                        "user_id": {
                          "type": "integer",
                          "example": 4,
                          "default": 0
                        },
                        "charge_id": {
                          "type": "integer",
                          "example": 18,
                          "default": 0
                        },
                        "subscription_id": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 4,
                              "default": 0
                            },
                            "display_name": {},
                            "email": {
                              "type": "string",
                              "example": "example@example.com"
                            },
                            "email_confirm": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "first_name": {
                              "type": "string",
                              "example": "first_name"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "last_name"
                            },
                            "mail_marketing": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "pelcro_account_id": {
                                  "type": "string",
                                  "example": "1"
                                },
                                "pelcro_customer_id": {
                                  "type": "string",
                                  "example": "4"
                                }
                              }
                            },
                            "name": {
                              "type": "string",
                              "example": "name"
                            },
                            "old_provider_id": {},
                            "phone": {},
                            "phone_confirm": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "salutation": {},
                            "title": {},
                            "profile_photo": {},
                            "default_source_id": {},
                            "tele_marketing": {
                              "type": "boolean",
                              "example": false,
                              "default": true
                            },
                            "created_at": {
                              "type": "integer",
                              "example": 1619530774,
                              "default": 0,
                              "format": "int64"
                            },
                            "updated_at": {
                              "type": "integer",
                              "example": 1619530775,
                              "default": 0,
                              "format": "int64"
                            },
                            "deleted_at": {}
                          }
                        },
                        "plan_name": {},
                        "product_name": {},
                        "ending_balance": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "hosted_invoice_url": {
                          "type": "string",
                          "example": "hosted_invoice_url"
                        },
                        "invoice_pdf": {
                          "type": "string",
                          "example": "invoice_pdf"
                        },
                        "is_imported": {},
                        "number": {
                          "type": "string",
                          "example": "DD4432F2-0001"
                        },
                        "paid": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "period_start": {
                          "type": "integer",
                          "example": 1619530811,
                          "default": 0
                        },
                        "period_end": {
                          "type": "integer",
                          "example": 1619530811,
                          "default": 0
                        },
                        "post_payment_credit_notes_amount": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "pre_payment_credit_notes_amount": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "starting_balance": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "paid"
                        },
                        "subtotal": {
                          "type": "integer",
                          "example": 15000,
                          "default": 0
                        },
                        "tax": {},
                        "total": {
                          "type": "integer",
                          "example": 15000,
                          "default": 0
                        },
                        "finalized_at": {
                          "type": "integer",
                          "example": 1619530812,
                          "default": 0
                        },
                        "marked_uncollectible_at": {},
                        "paid_at": {},
                        "voided_at": {},
                        "created_at": {
                          "type": "integer",
                          "example": 1619530811,
                          "default": 0,
                          "format": "int64"
                        },
                        "updated_at": {
                          "type": "integer",
                          "example": 1620327561,
                          "default": 0,
                          "format": "int64"
                        },
                        "deleted_at": {}
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"status\": 400,\n    \"message\": \"Invalid request, please try again.\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid request, please try again."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": "Unauthenticated."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "500": {
            "description": "Server error.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "php",
              "code": "use GuzzleHttp\\Client;\n\n$site_id = 0; // (int) your site id here\n$invoice_id = 0; // (int) the invoice id here\n$api_key = '' // (string) your api key here\n  \n$uri = \"invoices/{$invoice_id}/pay_invoice\";\n\n$config = [\n  'base_uri' => 'https://www.pelcro.com/api/v1/core/'\n];\n\n$client = new Client($config);\n\n$options = [\n\t'json' => [\n\t\t'site_id' => $site_id,\n\t\t'reference' => '' // the payment ref here\n\t],\n\t'headers' => [\n\t\t'Accept' => 'application/json',\n\t\t'Authorization' => 'Bearer ' . $api_key\n\t]\n];\n\n$response = $client->request('POST', $uri, $options);"
            }
          ],
          "samples-languages": [
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [List invoices](https://docs.pelcro.com/reference/api-core-list-invoices.md)
* [Get invoice](https://docs.pelcro.com/reference/get-invoice.md)
* [Void invoice](https://docs.pelcro.com/reference/api-core-void-invoice.md)
* [Update invoice](https://docs.pelcro.com/reference/update-invoice.md)
* [Mark invoice as uncollectible](https://docs.pelcro.com/reference/api-core-mark-as-uncollectible-invoices.md)
* [Create invoice](https://docs.pelcro.com/reference/create-invoice.md)
* [Apply balance to invoice](https://docs.pelcro.com/reference/api-core-apply-balance-to-invoice.md)