Skip to main content

Payment

Official Docs

Payment Resource#

export interface PaymentResource {  id: string;  type: 'payment';  attributes: {    access_url?: string;    amount: number;    balance_transaction_id: string;    billing?: Billing;    currency: Currency;    description?: string;    disputed: boolean;    external_reference_number?: string;
    // On Fail    failed_code?: ErrorSubCode;    failed_message?: string;
    fee: number;    foreign_fee: number;
    livemode: boolean;    net_amount: number;    origin: string;    payment_intent_id?: string;    payout?: number;
    source: PaymentSource;
    statement_descriptor: string;    status: PaymentStatus;
    tax_amount?: number;
    refunds: any[];    taxes: any[];
    available_at: number;    created_at: number;    paid_at: number;    updated_at: number;  };}

id *

string

type *

string
Possible value(s):
payment

attributes *

object

access_url

string

amount *

number
In cents (P100 = 10000).
Minimum amount is 10000

balance_transaction_id *

string

billing

Billing

currency *

string
Possible value(s):
PHP

description

string

disputed *

boolean

failed_code

ErrorSubCode

failed_message

string

livemode *

boolean

net_amount *

number
In cents
P100 = 10000

origin *

string

payment_intent_id

string

payout

number
In cents
P100 = 10000

statement_descriptor *

string

status

string
Possible value(s):
pending
|
paid
|
failed

tax_amount

number
In cents
P100 = 10000

refund *

any[]

taxes *

any[]

available_at *

number

created_at *

number

paid_at *

number

updated_at *

number

Create Payment#

caution

Only works in the when using the secret key

paymongo.payment.create(CreatePaymentParams): PaymentResource#

Example
paymongo.payment.create({  data: {    attributes: {      amount: 10000,      currency: 'PHP',      source: { id: 'tok_X925Gje9FzRxfZCiBzNaSCbE', type: 'source' },    },  },});

Create Payment Params#

data *

object

attributes *

object

amount *

number
In cents
P100 = 10000

description

string

currenct *

string
Possible value(s):
PHP

statement_descriptor

string

source *

object

id *

string

type *

string
Possible value(s):
source

Retrieve Payment#

caution

Only works in the when using the secret key

paymongo.payment.retrieve(RetrievePaymentParams): PaymentResource#

Example
paymongo.payment.retrieve({  id: 'pay_a1nn2DXxeooJ9JqQfj7ytxfe',});

Retrieve Payment Params#

id *

string

List Payments#

caution

Only works in the when using the secret key

paymongo.payment.list(ListPaymentParams): PaymentResource[]#

Example
paymongo.payment.list({});

List Payment Params#

before

string
a resource ID that defines your place in the list. For example, if you make a request and receive 20 resources, starting with some_resource_id, your subsequent call can include before=some_resource_id in order to fetch the previous page of the list.

after

string
a resource ID that defines your place in the list. For example, if you make a list request and receive 20 resources, ending with some_resource_id, your subsequent call can include after=some_resource_id in order to fetch the next page of the list.

limit

string
Limit of resources to return. Default: 20