Payment plans
Agree a schedule of instalments with one customer (paiement par facilité).
/plansAuthorization
oauth2 plans:readA short-lived token for one installation.
In: header
Scope: plans:read
Query Parameters
At most 100.
Text to look for in the title, the customer's name and email, and the reference.
Filter by status. late is an active plan with an unpaid instalment past its due date.
Filter by payment instance.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://api.mytpe.app/api/ext/plans" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN"{
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"title": "string",
"description": "string",
"reference": "string",
"status": "active",
"currency": "string",
"total_amount": 0,
"paid_amount": 0,
"remaining": 0,
"minimum_payment": 0,
"progress": 0,
"late_count": 0,
"next": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"is_late": true
},
"customer": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"payment_blocked_reason": "instance_suspended",
"pay_slug": "string",
"installments": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sequence": 0,
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"paid_amount": 0,
"remaining": 0,
"status": "pending",
"is_late": true,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"payments": [
{
"transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",
"order_number": "string",
"amount": 0,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"cancelled_at": "2019-08-24T14:15:22Z"
}
],
"meta": {
"current_page": 0,
"last_page": 0,
"per_page": 100,
"total": 0,
"from": 0,
"to": 0,
"path": "string",
"links": []
},
"links": {
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}/plansAuthorization
oauth2 plans:writeA short-lived token for one installation.
In: header
Scope: plans:write
Header Parameters
8 to 128 characters, unique per operation within the account. Repeating it returns the first response with Idempotent-Replayed: true.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.mytpe.app/api/ext/plans" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN" \ -H "Idempotency-Key: your-unique-key" \ -H "Content-Type: application/json" \ -d '{"payment_instance_id": "your-payment-instance-id", "title": "Your title", "total_amount": 1000, "customer_name": "Your customer name", "customer_email": "customer@example.com", "installments": [{"due_on": "2030-01-15", "amount": 1000}]}'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"title": "string",
"description": "string",
"reference": "string",
"status": "active",
"currency": "string",
"total_amount": 0,
"paid_amount": 0,
"remaining": 0,
"minimum_payment": 0,
"progress": 0,
"late_count": 0,
"next": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"is_late": true
},
"customer": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"payment_blocked_reason": "instance_suspended",
"pay_slug": "string",
"installments": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sequence": 0,
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"paid_amount": 0,
"remaining": 0,
"status": "pending",
"is_late": true,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"payments": [
{
"transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",
"order_number": "string",
"amount": 0,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"cancelled_at": "2019-08-24T14:15:22Z"
}
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}/plans/previewAuthorization
oauth2 plans:writeA short-lived token for one installation.
In: header
Scope: plans:write
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.mytpe.app/api/ext/plans/preview" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"total_amount": 3000, "count": 3, "first_due_on": "2030-01-15"}'{
"data": [
{
"sequence": 0,
"label": "string",
"label_key": "string",
"label_params": {},
"due_on": "2019-08-24",
"amount": 0,
"amount_centimes": 0
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}/plans/{id}Authorization
oauth2 plans:readA short-lived token for one installation.
In: header
Scope: plans:read
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.mytpe.app/api/ext/plans/your-id" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN"{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"title": "string",
"description": "string",
"reference": "string",
"status": "active",
"currency": "string",
"total_amount": 0,
"paid_amount": 0,
"remaining": 0,
"minimum_payment": 0,
"progress": 0,
"late_count": 0,
"next": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"is_late": true
},
"customer": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"payment_blocked_reason": "instance_suspended",
"pay_slug": "string",
"installments": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sequence": 0,
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"paid_amount": 0,
"remaining": 0,
"status": "pending",
"is_late": true,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"payments": [
{
"transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",
"order_number": "string",
"amount": 0,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"cancelled_at": "2019-08-24T14:15:22Z"
}
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}/plans/{id}/cancelAuthorization
oauth2 plans:writeA short-lived token for one installation.
In: header
Scope: plans:write
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.mytpe.app/api/ext/plans/your-id/cancel" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN"{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"title": "string",
"description": "string",
"reference": "string",
"status": "active",
"currency": "string",
"total_amount": 0,
"paid_amount": 0,
"remaining": 0,
"minimum_payment": 0,
"progress": 0,
"late_count": 0,
"next": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"is_late": true
},
"customer": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"payment_blocked_reason": "instance_suspended",
"pay_slug": "string",
"installments": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sequence": 0,
"label": "string",
"due_on": "2019-08-24",
"amount": 0,
"paid_amount": 0,
"remaining": 0,
"status": "pending",
"is_late": true,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"payments": [
{
"transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",
"order_number": "string",
"amount": 0,
"paid_at": "2019-08-24T14:15:22Z"
}
],
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"cancelled_at": "2019-08-24T14:15:22Z"
}
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}/plans/{id}/remindAuthorization
oauth2 plans:writeA short-lived token for one installation.
In: header
Scope: plans:write
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.mytpe.app/api/ext/plans/your-id/remind" \ -H "Authorization: Bearer $MYTPE_ACCESS_TOKEN"{
"data": {
"reminded_at": "2019-08-24T14:15:22Z"
}
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}{
"errors": [
{
"status": "string",
"code": "string",
"title": "string",
"detail": "string",
"meta": []
}
]
}