Send a fax from credit
send_faxUse this to send a fax from the person's Faxette credit. Only for a fax in their account that's ready to pay for: call get_fax first. Tell the person its credit_price and that it comes from their credit, and call this only once they clearly agree. If get_account shows their credit doesn't cover it, give them the status page instead, where they can buy credit or pay by card. Needs the person to sign in to Faxette; calling it while they aren't asks the app to sign them in.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The fax's id, from create_fax, get_faxes or get_fax. | |
| amount_cents | Yes | The credit_price amount_cents from get_fax that the person agreed to. If the fax's documents changed since, Faxette refuses with price_changed: call get_fax and confirm the new price. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The fax's id. Pass it to get_fax when the person is signed in. | |
| price | Yes | Before tax. Null until the pages are counted. | |
| status | Yes | draft: waiting for files, or for a file to be fixed. processing_documents: counting pages. documents_ready: ready to pay. awaiting_payment: the person is paying. scheduled: paid, about to dial. sending, delivered, failed. canceled: not paid in time. | |
| attempt | Yes | The current attempt to dial the fax number. | |
| payment | Yes | The person's payment once they start paying, by card or from their credit. amount_cents includes tax. | |
| resend_by | Yes | For a failed fax: until when the person can correct the fax number on the status page and send it again. | |
| fax_number | Yes | ||
| page_count | Yes | Null until the pages are counted. | |
| status_url | Yes | The page where the person checks the fax and pays. Give it to them. | |
| max_attempts | Yes | ||
| failure_reason | Yes | For a failed fax: temporary (busy or no answer on every attempt), wrong_number (no fax machine answered), or our_side. | |
| document_errors | Yes | Files Faxette couldn't use. position is the file's number in the fax. The person fixes them on the status page. | |
| next_attempt_at | Yes | When the next attempt dials, if the line was busy or didn't answer. | |
| checkout_available | Yes | True when the person can pay on the status page. |