Create payment resource

Creates a payment resource to represent that an invoice was paid outside of the Moov platform. If a payment link was created for the invoice, the corresponding payment link is canceled, but a receipt is still sent.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/invoices.write scope.

POST
/accounts/{accountID}/invoices/{invoiceID}/payments
cURL Ruby Java TypeScript Python PHP
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -X POST "/accounts/{accountID}/invoices/{invoiceID}/payments" \
  -H "Authorization: Bearer {token}" \
  --data '{
    "amount": {
      "currency": "USD",
      "valueDecimal": "12.987654321"
    },
    "description": "string",
    "foreignID": "d8b40343-5784-4096-8d40-9f3b4a834066",
    "paymentDate": "2025-08-24T14:15:22Z"
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
      x_moov_version: '<value>',
    )

res = s.invoices.create_invoice_payment(account_id: 'e02333e4-a835-46d1-8d02-9af7a405e65f', invoice_id: '99e7ebb0-9996-49b2-98f0-304c7332ece6', create_invoice_payment: Models::Components::CreateInvoicePayment.new(
  foreign_id: 'EXT-PAY-12345',
  amount: Models::Components::AmountDecimal.new(
    currency: 'USD',
    value_decimal: '500.00',
  ),
  description: 'Payment received via wire transfer',
  payment_date: DateTime.iso8601('2026-01-20T14:45:00Z'),
))

unless res.invoice_payment.nil?
  # handle response
end
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package hello.world;

import java.lang.Exception;
import java.time.OffsetDateTime;
import org.openapis.openapi.Moov;
import org.openapis.openapi.models.components.*;
import org.openapis.openapi.models.errors.CreateInvoicePaymentError;
import org.openapis.openapi.models.errors.GenericError;
import org.openapis.openapi.models.operations.CreateInvoicePaymentResponse;

public class Application {

    public static void main(String[] args) throws GenericError, CreateInvoicePaymentError, Exception {

        Moov sdk = Moov.builder()
                .xMoovVersion("<value>")
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        CreateInvoicePaymentResponse res = sdk.invoices().createInvoicePayment()
                .accountID("e02333e4-a835-46d1-8d02-9af7a405e65f")
                .invoiceID("99e7ebb0-9996-49b2-98f0-304c7332ece6")
                .createInvoicePayment(CreateInvoicePayment.builder()
                    .amount(AmountDecimal.builder()
                        .currency("USD")
                        .valueDecimal("500.00")
                        .build())
                    .foreignID("EXT-PAY-12345")
                    .description("Payment received via wire transfer")
                    .paymentDate(OffsetDateTime.parse("2026-01-20T14:45:00Z"))
                    .build())
                .call();

        if (res.invoicePayment().isPresent()) {
            // handle response
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  xMoovVersion: "<value>",
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.invoices.createInvoicePayment({
    accountID: "e02333e4-a835-46d1-8d02-9af7a405e65f",
    invoiceID: "99e7ebb0-9996-49b2-98f0-304c7332ece6",
    createInvoicePayment: {
      foreignID: "EXT-PAY-12345",
      amount: {
        currency: "USD",
        valueDecimal: "500.00",
      },
      description: "Payment received via wire transfer",
      paymentDate: new Date("2026-01-20T14:45:00Z"),
    },
  });

  console.log(result);
}

run();
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from moovio_sdk import Moov
from moovio_sdk.models import components
from moovio_sdk.utils import parse_datetime


with Moov(
    x_moov_version="<value>",
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.invoices.create_invoice_payment(account_id="e02333e4-a835-46d1-8d02-9af7a405e65f", invoice_id="99e7ebb0-9996-49b2-98f0-304c7332ece6", amount={
        "currency": "USD",
        "value_decimal": "500.00",
    }, foreign_id="EXT-PAY-12345", description="Payment received via wire transfer", payment_date=parse_datetime("2026-01-20T14:45:00Z"))

    # Handle response
    print(res)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System;

var sdk = new MoovClient(xMoovVersion: "<value>");

var res = await sdk.Invoices.CreateInvoicePaymentAsync(
    accountID: "e02333e4-a835-46d1-8d02-9af7a405e65f",
    invoiceID: "99e7ebb0-9996-49b2-98f0-304c7332ece6",
    body: new CreateInvoicePayment() {
        ForeignID = "EXT-PAY-12345",
        Amount = new AmountDecimal() {
            Currency = "USD",
            ValueDecimal = "500.00",
        },
        Description = "Payment received via wire transfer",
        PaymentDate = System.DateTime.Parse("2026-01-20T14:45:00Z"),
    }
);

// handle response
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
use Moov\MoovPhp\Utils;

$sdk = MoovPhp\Moov::builder()
    ->setXMoovVersion('<value>')
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$createInvoicePayment = new Components\CreateInvoicePayment(
    foreignID: 'EXT-PAY-12345',
    amount: new Components\AmountDecimal(
        currency: 'USD',
        valueDecimal: '500.00',
    ),
    description: 'Payment received via wire transfer',
    paymentDate: Utils\Utils::parseDateTime('2026-01-20T14:45:00Z'),
);

$response = $sdk->invoices->createInvoicePayment(
    accountID: 'e02333e4-a835-46d1-8d02-9af7a405e65f',
    invoiceID: '99e7ebb0-9996-49b2-98f0-304c7332ece6',
    createInvoicePayment: $createInvoicePayment

);

if ($response->invoicePayment !== null) {
    // handle response
}
200 400 401 403 404 409 422 429 500 504
The request completed successfully.
application/json
{
  "amount": {
    "currency": "USD",
    "valueDecimal": "500.00"
  },
  "external": {
    "description": "Payment via external system",
    "foreignID": "EXT-PAY-12345",
    "paymentDate": "2026-01-20T14:45:00Z"
  },
  "invoicePaymentID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "invoicePaymentType": "external"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
application/json
{
  "error": "string"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request contained missing or expired authentication.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The user is not authorized to make the request.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The requested resource was not found.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
application/json
{
  "error": "string"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
application/json
{
  "amount": {
    "currency": "string",
    "valueDecimal": "string"
  },
  "foreignID": "string",
  "description": "string",
  "paymentDate": "string"
}

x-request-id

string <uuid> required
A unique identifier used to trace requests.
Request was refused due to rate limiting.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request failed due to an unexpected error.

x-request-id

string <uuid> required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.

x-request-id

string <uuid> required
A unique identifier used to trace requests.

Headers

X-Moov-Version

string

Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where

  • YYYY is the year
  • QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
  • BB is the build number, starting at .01, for subsequent builds in the same quarter.
    • For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release. When no version is specified, the API defaults to v2024.01.00.

Path parameters

accountID

string <uuid> required

invoiceID

string <uuid> required

Body

application/json

amount

object required
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

description

string

foreignID

string <=128 characters

paymentDate

string<date-time>

Response

application/json
Payment made towards an invoice, will be either a transfer or an external payment.

amount

object required
Show child attributes

currency

string required Pattern
A 3-letter ISO 4217 currency code.

valueDecimal

string required Pattern

A decimal-formatted numerical string that represents up to 9 decimal place precision.

For example, $12.987654321 is '12.987654321'.

invoicePaymentID

string <=36 characters required
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).

invoicePaymentType

string<enum> required
Possible values: transfer, external

external

object
Show child attributes

description

string

foreignID

string

paymentDate

string<date-time>

transfer

object
Show child attributes

transferID

string <=36 characters required
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).