Payments
A payment represents a charge to your customer's credit or debit card.
When you want to pay a Payment before, you must create a Source and attach it to the Payment through the authorize resource. If the Source gateway belongs to a payment gateway with single_use
usage, it should be paid through the pay resource, while if it belongs to a payment gateway with reusable
usage, it will immediately try to charge the credit or debit card of the customer.
Payment object
Attributes |
id Unique identifier of the object. |
date A positive number representing the amount to charge. |
amount A date equal to or greater than today in |
currency Three-letter ISO code for the currency of the payment. |
description A description for payment with a max length of 256 characters. |
source ID of the source with which the Payment was processed. The Source is attached through the authorize resource or the pay resource, depending on the type of charge required. |
payment_date Time at which the Payment was payed in format |
customer ID of the Customer this payment belongs to, of one exists. |
invoice ID of the Invoice this payment belongs to, of one exists. It will have this attribute when the payment is created from an invoice from the Invoices API. |
status The status of the Source, one of |
metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting an empty value to metadata. |
created Time at which the object was created in format |
updated Time at which the object was updated in format |
Create a payment
POST
https://api.piriod.com/payments/
Creates a new Payment object.
Request Body
Name | Type | Description |
---|---|---|
amount | number | A positive number representing the amount to charge. |
date | string | A date equal to or greater than today in |
description | string | A description for payment with a max length of 256 characters. |
currency | string | Three-letter ISO code for the currency of the payment. |
customer | string | ID of the Customer this payment belongs to, of one exists. |
invoice | string | ID of the Invoice this payment belongs to, of one exists. |
Retrieve a payment
GET
https://api.piriod.com/payments/{{id}}/
Retrieves a Payment object. Send via path parameters the unique Payment ID from a payment creation request and Piriod will return the Payment object information.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | ID of the Payment object. |
Destroy a payment
DELETE
https://api.piriod.com/payments/{{id}}/
Destroy a Payment object.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | ID of the Payment object. |
Authorize a payment
POST
https://api.piriod.com/payments/{{id}}/authorize/
Path Parameters
Name | Type | Description |
---|---|---|
id | string | ID of the Payment object. |
Request Body
Name | Type | Description |
---|---|---|
source | string | ID of the Source object to pay this Payment. |
Pay a payment
GET
https://api.piriod.com/payments/{{id}}/pay/
Path Parameters
Name | Type | Description |
---|---|---|
id | string | ID of the Payment object. |
Last updated