gigstack API
  1. Receipts
gigstack API
  • gigstack API, your fiscal infraestructure
  • Ping
    • Ping
    • Ping API (GET)
      GET
    • Ping API (POST)
      POST
    • Ping API (PUT)
      PUT
    • Ping API (DELETE)
      DELETE
  • Payments
    • Payments
    • Create a payment
      POST
    • List payments
      GET
    • Get payment by ID
      GET
  • Invoices
    • Invoices
    • Create an invoice
      POST
    • List invoices
      GET
    • Get invoice by ID
      GET
  • Clients
    • Clients
    • Create a client
      POST
    • List clients
      GET
    • Get client by ID
      GET
  • Services
    • Services
    • Create a service
      POST
    • List services
      GET
    • Get service by ID
      GET
  • Receipts
    • Receipts
    • Create a receipt
      POST
    • List receipts
      GET
    • Get receipt by ID
      GET
    • Update receipt
      PUT
    • Delete receipt
      DELETE
  • Webhooks
    • Webhooks
    • Create a webhook
    • List webhooks
    • Get webhook by ID
    • Delete webhook
  • Catalogs
    • Catalogs
    • List catalogs
    • Get catalog by ID
  • Connect
    • Connect
    • Create a team
    • List teams
    • Get team by ID
    • Update team
    • Get team onboarding URL and connection status
    • Get team members
    • Update team members
    • Remove team members
  1. Receipts

Receipts

Receipts#

The Receipts API provides full CRUD operations for receipts with client integration, allowing you to manage receipt records for all transactions.

Overview#

Use the Receipts API to:
Create receipts for payments and transactions
Track receipt status and history
Manage receipt-client relationships
Update receipt information
Delete receipt records
Generate receipt documentation

Endpoints#

POST /v2/receipts#

Create a new receipt.
Authentication Required: Yes

Request Body#

{
  "clientId": "client_123",
  "amount": 500.0,
  "currency": "MXN",
  "description": "Payment receipt for consulting services",
  "receiptNumber": "REC-2024-001",
  "issueDate": "2024-01-15T10:30:00.000Z",
  "paymentMethod": "transfer",
  "items": [
    {
      "description": "Consulting hours",
      "quantity": 5,
      "unitPrice": 100.0,
      "amount": 500.0
    }
  ],
  "metadata": {
    "paymentId": "pay_789",
    "invoiceId": "inv_456",
    "transactionRef": "TXN123456"
  }
}

Parameters#

ParameterTypeRequiredDescription
clientIdstringYesClient identifier
amountnumberYesReceipt total amount
currencystringNoCurrency code (default: MXN)
descriptionstringNoReceipt description
receiptNumberstringNoCustom receipt number
issueDatestringNoReceipt issue date (ISO 8601)
paymentMethodstringNoPayment method used
itemsarrayNoReceipt line items
metadataobjectNoAdditional receipt information

Response#

Success Response (201 Created):
{
  "data": {
    "id": "receipt_321",
    "client": {
      "rfc": "XAXX010101000",
      "name": "Cliente Example",
      "email": "cliente@example.com"
    },
    "amount": 500.0,
    "currency": "MXN",
    "description": "Payment receipt for consulting services",
    "receiptNumber": "REC-2024-001",
    "issueDate": "2024-01-15T10:30:00.000Z",
    "paymentMethod": "transfer",
    "status": "issued",
    "items": [
      {
        "description": "Consulting hours",
        "quantity": 5,
        "unitPrice": 100.0,
        "amount": 500.0
      }
    ],
    "metadata": {
      "paymentId": "pay_789",
      "invoiceId": "inv_456",
      "transactionRef": "TXN123456"
    },
    "timestamp": "2024-01-15T10:30:00.000Z"
  },
  "message": "Receipt created successfully"
}

GET /v2/receipts#

List receipts with optional filtering.
Authentication Required: Yes

Query Parameters#

ParameterTypeDescription
limitnumberNumber of results to return (default: 20, max: 100)
offsetnumberNumber of results to skip
clientIdstringFilter by client ID
statusstringFilter by receipt status
receiptNumberstringFilter by receipt number
fromstringFilter receipts from date (ISO 8601)
tostringFilter receipts to date (ISO 8601)
minAmountnumberFilter by minimum amount
maxAmountnumberFilter by maximum amount

Response#

Success Response (200 OK):
{
  "data": [
    {
      "id": "receipt_321",
      "client": {
        "rfc": "XAXX010101000",
        "name": "Cliente Example"
      },
      "amount": 500.0,
      "currency": "MXN",
      "receiptNumber": "REC-2024-001",
      "status": "issued",
      "issueDate": "2024-01-15T10:30:00.000Z",
      "timestamp": "2024-01-15T10:30:00.000Z"
    }
  ],
  "message": "Receipts retrieved successfully",
  "totalResults": 1,
  "hasMore": false,
  "next": null
}

GET /v2/receipts/{receiptId}#

Get a specific receipt by ID.
Authentication Required: Yes

Response#

Success Response (200 OK):
{
  "data": {
    "id": "receipt_321",
    "client": {
      "rfc": "XAXX010101000",
      "name": "Cliente Example",
      "email": "cliente@example.com"
    },
    "amount": 500.0,
    "currency": "MXN",
    "description": "Payment receipt for consulting services",
    "receiptNumber": "REC-2024-001",
    "issueDate": "2024-01-15T10:30:00.000Z",
    "paymentMethod": "transfer",
    "status": "issued",
    "items": [
      {
        "description": "Consulting hours",
        "quantity": 5,
        "unitPrice": 100.0,
        "amount": 500.0
      }
    ],
    "metadata": {
      "paymentId": "pay_789",
      "invoiceId": "inv_456",
      "transactionRef": "TXN123456"
    },
    "timestamp": "2024-01-15T10:30:00.000Z"
  },
  "message": "Receipt retrieved successfully"
}

PUT /v2/receipts/{receiptId}#

Update an existing receipt.
Authentication Required: Yes

Request Body#

{
  "description": "Updated payment receipt for consulting services",
  "paymentMethod": "credit_card",
  "metadata": {
    "paymentId": "pay_789",
    "invoiceId": "inv_456",
    "transactionRef": "TXN123456",
    "updated": true
  }
}

Response#

Success Response (200 OK):
{
  "data": {
    "id": "receipt_321",
    "client": {
      "rfc": "XAXX010101000",
      "name": "Cliente Example"
    },
    "amount": 500.0,
    "description": "Updated payment receipt for consulting services",
    "paymentMethod": "credit_card",
    "metadata": {
      "paymentId": "pay_789",
      "invoiceId": "inv_456",
      "transactionRef": "TXN123456",
      "updated": true
    },
    "timestamp": "2024-01-15T10:30:00.000Z"
  },
  "message": "Receipt updated successfully"
}

DELETE /v2/receipts/{receiptId}#

Delete a receipt.
Authentication Required: Yes

Response#

Success Response (200 OK):
{
  "data": {
    "id": "receipt_321",
    "deleted": true
  },
  "message": "Receipt deleted successfully"
}

Receipt Status#

StatusDescription
draftReceipt is in draft state
issuedReceipt has been issued
sentReceipt has been sent to client
archivedReceipt has been archived
cancelledReceipt has been cancelled

Payment Methods#

Common payment methods include:
MethodDescription
cashCash payment
transferBank transfer
credit_cardCredit card payment
debit_cardDebit card payment
checkCheck payment
otherOther payment method

Code Examples#

Create a Receipt#

JavaScript/Node.js:
Python:

Update a Receipt#

JavaScript/Node.js:

List and Filter Receipts#

cURL:

Error Handling#

Common Error Responses#

Validation Error (400 Bad Request):
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": {
      "amount": "Amount must be greater than 0",
      "clientId": "Client ID is required",
      "receiptNumber": "Receipt number must be unique"
    }
  },
  "message": "Request validation failed"
}
Not Found Error (404 Not Found):
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Receipt not found"
  },
  "message": "The requested receipt does not exist"
}

Best Practices#

1.
Unique Receipt Numbers: Use a consistent numbering scheme
2.
Complete Information: Include all relevant transaction details
3.
Client Integration: Always associate receipts with clients
4.
Status Management: Update receipt status appropriately
5.
Metadata Usage: Store transaction references in metadata
6.
Regular Cleanup: Archive old receipts periodically

Integration Examples#

Creating Receipt from Payment#

Linking Receipt to Invoice#

Next Steps#

Process payments and create receipts
Link receipts to invoices
Manage client receipt history
Modified at 2025-06-11 05:00:55
Previous
Get service by ID
Next
Create a receipt
Built with