Skip to main content

Sources

Official Docs

Source Resource#

export interface SourceResource {  id: string;  type: 'source';  attributes: {    amount: number;    billing?: Billing;    currency: Currency;    livemode: boolean;    redirect: SourceRedirect;    status: SourceStatus;    type: SourceType;    created_at: number;    updated_at: number;  };}

id *

string

type *

string
Possible value(s):
source

attributes *

object

amount *

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

currency *

string
Possible value(s):
PHP

livemode *

boolean

redirect *

object

checkout_url *

string

success *

string

failed *

string

status *

string
Possible value(s):
pending
|
chargeable
|
cancelled
|
expired
|
paid

type *

string
Possible value(s):
gcash
|
grab_pay

created_at *

number

updated_at *

number

billing

Billing

Create Source#

paymongo.source.create(CreateSourceParams): SourceResource#

Example
paymongo.source.create({  data: {    attributes: {      amount: 10000,      currency: 'PHP',      redirect: {        failed: 'https://example.com',        success: 'https://example.com',      },      type: 'gcash',    },  },});

Create Source Params#

data *

object

attributes *

object

type *

string
Possible value(s):
gcash
|
grab_pay

amount *

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

currency *

string
Possible value(s):
PHP

redirect *

object

success *

string

failed *

string

billing

Billing

Retrieve Source#

paymongo.source.retrieve(RetrieveSourceParams): SourceResource#

Example
paymongo.source.retrieve({  id: 'src_1bLmj5BnqV2fCnM1SGGTdcrf',});

Retrieve Source Params#

id *

string