Build payments into your product with TPE virtual. Start integrating →
Logo

Payment plans

Agree a schedule of instalments with one customer (paiement par facilité).

GET/plans

Authorization

oauth2 plans:read
AuthorizationBearer <token>

A short-lived token for one installation.

In: header

Scope: plans:read

Query Parameters

page?integer
per_page?integer

At most 100.

search?string

Text to look for in the title, the customer's name and email, and the reference.

status?string

Filter by status. late is an active plan with an unpaid instalment past its due date.

payment_instance_id?string

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": []
    }
  ]
}
POST/plans

Authorization

oauth2 plans:write
AuthorizationBearer <token>

A short-lived token for one installation.

In: header

Scope: plans:write

Header Parameters

Idempotency-Key?string

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": []
    }
  ]
}
POST/plans/preview

Authorization

oauth2 plans:write
AuthorizationBearer <token>

A 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": []
    }
  ]
}
GET/plans/{id}

Authorization

oauth2 plans:read
AuthorizationBearer <token>

A short-lived token for one installation.

In: header

Scope: plans:read

Path Parameters

id*string

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": []
    }
  ]
}
POST/plans/{id}/cancel

Authorization

oauth2 plans:write
AuthorizationBearer <token>

A short-lived token for one installation.

In: header

Scope: plans:write

Path Parameters

id*string

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": []
    }
  ]
}
POST/plans/{id}/remind

Authorization

oauth2 plans:write
AuthorizationBearer <token>

A short-lived token for one installation.

In: header

Scope: plans:write

Path Parameters

id*string

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": []
    }
  ]
}

On this page