Skip to content
myela

Create a payment using exactly one funding source: a single-use payment token or a stored payment method. Capture immediately for a sale, or authorize now and capture later.

Create a payment

POST/v1/paymentsLink

Create a payment using exactly one funding source: a single-use payment token or a stored payment method. Capture immediately for a sale, or authorize now and capture later.

SandboxSecret keypayments.create

Request fields

Edit a field and the generated request updates immediately.

Common requests

Send exactly one funding source: paymentToken or paymentMethodId.

Request body
integerrequired

A non-negative integer in the currency’s minor unit. 4999 represents $49.99.

integer · minor units

stringrequired

A three-letter ISO 4217 currency code.

ISO 4217

Optional fields7
booleanoptional

When true, authorize and capture in one request. When false, authorize only.

stringoptional

A single-use token returned by Myela Elements or an approved card-capture field.

stringoptional

The reusable identifier of a stored payment method.

integeroptional

The goods-or-service part of amount. Omit it to derive amount less the other parts; send it and all parts must sum to amount.

integer · minor units

integeroptional

The surcharge part of amount. Recorded, not computed.

integer · minor units

integeroptional

The tax part of amount. Recorded, not computed.

integer · minor units

integeroptional

The tip part of amount. Recorded, not computed.

integer · minor units

Response contract

The successful wire shape and errors an integration should branch on.

201

Payment

application/json
idstringrequired
Unique payment identifier.
object"payment"required
Stable resource discriminator.
statusstringrequired
One of: requires_capture, pending_settlement, settled, declined, voided, refunded, partially_refunded, failed. pending_settlement means approved and captured — the dashboard shows this as 'Approved'.
settledbooleanrequired
Has settlement completed — true from the moment it is reported, and it stays true through later refunds. Branch on this for reconciliation instead of comparing status strings.
amountintegerrequired
Requested amount in minor units.
amountAuthorizedintegerrequired
Amount authorized in minor units.
amountApprovedinteger
Present only when the issuer approved less than requested: the approved total in minor units.
amountCapturedintegerrequired
Amount captured in minor units.
amountRefundedintegerrequired
Amount refunded in minor units.
currencystringrequired
Three-letter currency code.
amountBaseinteger
Present only when the charge was composed of parts. With amountSurcharge, amountTax and amountTip it sums to amount, in minor units.
amountSurchargeinteger
Surcharge part, in minor units.
amountTaxinteger
Tax part, in minor units.
amountTipinteger
Tip part, in minor units.
failureCodestring
Why the payment did not succeed. One of: card_declined, payment_declined, authentication_required, payment_method_invalid, payment_method_unsupported, payment_failed.
failureMessagestring
A safe, human-readable explanation. Present only alongside failureCode; branch on the code.
amountAdjustableboolean
Whether the authorized total can still be adjusted, when the account reports it.
authenticationobject
3-D Secure outcome when reported: type, status and version only, never an authentication value.
customerIdstring
Customer associated with the payment.
paymentMethodIdstring
Stored payment method used.
cardobject
Card brand and last four only.
createdAtstringrequired
ISO 8601 creation timestamp.
Example response
{
  "id": "pay_01JEXAMPLE",
  "object": "payment",
  "status": "pending_settlement",
  "settled": false,
  "amount": 1299,
  "amountAuthorized": 1299,
  "amountApproved": 1000,
  "amountCaptured": 1299,
  "amountRefunded": 0,
  "currency": "USD",
  "amountBase": 1199,
  "amountSurcharge": 0,
  "amountTax": 100,
  "amountTip": 0,
  "failureCode": "card_declined",
  "failureMessage": "The payment was declined.",
  "amountAdjustable": false,
  "authentication": {
    "type": "three_d_secure",
    "status": "Y",
    "version": "2.2.0"
  },
  "customerId": "cus_01JEXAMPLE",
  "paymentMethodId": "pm_01JEXAMPLE",
  "card": {
    "brand": "visa",
    "last4": "4242"
  },
  "createdAt": "2026-08-10T20:49:51.653Z"
}
Error responses
401authentication_failed

The key is missing, malformed, revoked, or invalid for this environment.

403permission_denied

The key does not have payments.create.

422invalid_request

One or more request fields are invalid.

409conflict

The resource is not in a state where this operation is valid.