Skip to main content

Create a Scheduled Payment

Use this endpoint to create a new scheduled payment.

POST
/users/{user_guid}/scheduled_payments

Parameters

FieldRequiredType

amount

The amount of the scheduled_payment.

Required
Decimal

description

A human-readable description of the scheduled_payment, for example, Power bill.

Required
String

is_completed

This indicates whether the scheduled_payment has been paid or not.

Optional
Boolean

is_recurring

This indicates whether the scheduled_payment will be recurring.

Optional
Boolean

merchant_guid

The unique identifier for the merchant identified in the scheduled_payment.

Optional
Boolean

occurs_on

The date on which the payment is scheduled to occur.

Required
Boolean

recurrence_day

Required when is_recurring is true. An error will be returned if is_recurring is not true. The day of recurrence. See Recurrence Types and Days for more info.

Optional
Boolean

recurrence_type

Required when is_recurring is true. An error will be returned if is_recurring is not true. The type of recurrence schedule. See Recurrence Types and Days for more info.

Optional
Boolean

transaction_type

The type of transaction. This will be either CREDIT or DEBIT.

Required
Boolean

Request sample

Language:shell

_13
curl -L -X POST 'https://int-api.mx.com/users/USR-11141024-90b3-1bce-cac9-c06ced52ab4c/scheduled_payments' \
_13
-u 'client_id:api_key' \
_13
-H 'Accept: application/vnd.mx.api.v1+json' \
_13
-H 'Content-Type: application/json' \
_13
-d '{
_13
"scheduled_payment": {
_13
"amount": 45.63,
_13
"description": "Power bill",
_13
"is_completed": false,
_13
"occurs_on": "2021-05-30",
_13
"transaction_type": "DEBIT"
_13
}
_13
}'

Response sample

200
Language:json

_17
{
_17
"scheduled_payment": {
_17
"transaction_type": "DEBIT",
_17
"recurrence_type": null,
_17
"amount": 45.63,
_17
"created_at": "2021-05-20T19:27:36+00:00",
_17
"description": "Power bill",
_17
"guid": "SCP-54bed778-6600-4262-908c-8822f141cc30",
_17
"is_completed": false,
_17
"is_recurring": null,
_17
"merchant_guid": "MCH-bbe0f849-fcd1-5d64-ad5d-1dbbea56b31c",
_17
"occurs_on": "2021-05-30",
_17
"recurrence_day": null,
_17
"updated_at": "2021-05-20T19:27:36+00:00",
_17
"user_guid": "USR-11a448aa-5e7b-70db-45d6-d6927092043e"
_17
}
_17
}