Skip to main content

Documentación

Mark Invoice Uncollectible

Set an invoice to uncollectible status.

This status indicates that the invoice cannot be paid by the customer.

    • invoice

    • ID of the invoice you want to mark uncollectible. String starting with invoice_.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string invoice = "invoice_91931a87d4a342362495899cdbbd9664";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("POST", $"/v1/invoices/{invoice}/mark_uncollectible");
        
                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error completing request: " + e.Message);
                    }
                }
            }
        }
    • JavaScript

      • const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const result = await makeRequest(
              'POST',
              '/v1/invoices/invoice_91931a87d4a342362495899cdbbd9664/mark_uncollectible'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
    • PHP

      • <?php
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('post', "/v1/invoices/invoice_91931a87d4a342362495899cdbbd9664/mark_uncollectible");
            var_dump($object);
        } catch(Exception $e) {
            echo "Error => $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='post', path='/v1/invoices/invoice_91931a87d4a342362495899cdbbd9664/mark_uncollectible')
        pprint(result)
  • /v1/invoices/:invoice/mark_uncollectible

  • Mark Invoice Uncollectible

  • curl -X post 'https://sandboxapi.rapyd.net/v1/invoices/invoice_9497dc5488fb27cbcc17b62d40f2b80f/mark_uncollectible' \
    -H 'access_key: your-access-key-here' \
    -H 'Content-Type: application/json' \
    -H 'idempotency: your-idempotency-parameter-here' \
    -H 'salt: your-random-string-here' \
    -H 'signature: your-calculated-signature-here' \
    -H 'timestamp: your-unix-timestamp-here'
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "4fbd2be2-60c7-4319-a975-ec108244da6d"
        },
        "data": {
            "id": "invoice_9497dc5488fb27cbcc17b62d40f2b80f",
            "attempt_count": 0,
            "billing": "pay_automatically",
            "billing_reason": "manual",
            "created_at": 1764747049,
            "currency": "USD",
            "customer": "cus_4e25112ac20e144ad073a614dc46934b",
            "description": "",
            "discount": null,
            "due_date": 1767339049,
            "days_until_due": 30,
            "metadata": {},
            "payment_method": "card_b9548d9b53a565b2315fecdc6c87f158",
            "payment": null,
            "payout": null,
            "payment_fields": null,
            "period_end": 0,
            "period_start": 0,
            "lines": [],
            "statement_descriptor": "",
            "subscription": "",
            "discount_amount": 0,
            "subtotal": 0,
            "tax": 0,
            "tax_percent": 0,
            "total": 0,
            "status": "paid",
            "payout_fields": null,
            "type": "payment"
        }
    }