GraphGrid Payment
2.0
API Version 1.0
Introduction
GraphGrid Payment allows users to create and manage customer profiles.
API
This Payment API version is 1.0 and as such all endpoints are rooted at /1.0/
. For example, http://localhost/1.0/payment
(requires auth) would be the base context for this Payment API under the GraphGrid API deployed at http://localhost.
Environment
Payment requires the following integrations:
- ONgDB 1.0+
Customer and payment profiles in the graph
Creating a customer profile creates a UsageOrg
node in the graph. This is an intermediary node between the organization or Org
node. Graph data
relating to customer profiles, and invoices are connected to the UsageOrg
node. This is structured to keep the graph organized.
Status
Check the status of GraphGrid Payment. Will return a 200 OK
response if healthy.
Base URL: /1.0/payment/status
Method: GET
Request
curl --location --request GET "${API_BASE}/1.0/payment/status"
Response
{
"status": "OK"
}
Customer and payment profiles
Create Customer and Payment Profile for an Org
Creates a customer and payment profile for a specified organization. The organization can be specified by orgName
or orgGrn
.
Base URL: /1.0/payment/customerProfiles/{{orgName or orgGrn}}
Method: POST
curl --location --request POST "${API_BASE}/1.0/payment/customerProfiles/grn:gg:org:NhEIOcoF52xoeDJKU2ri8QP2FH1Y0BvZL5VH4hdLAulw" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--data-raw '{
"address": {
"firstName": "John",
"lastName": "Doe",
"company": "",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"phoneNumber": "000-000-0000",
"email": "my-emails@mail.com",
"faxNumber": ""
},
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2023-12",
"cardCode": "123"
}
}'
Response
{
"message": "Account successfully created",
"status": "OK"
}
Graph schema
Create a Customer and Payment Profile (unspecified Org)
Create a customer and payment profile without specifying an organization(Org
).
Base URL: /1.0/payment/customerProfiles/{{UsageOrgName}}
Method: POST
Parameter | Description |
---|---|
UsageOrgName | The name by which the user would like to call the UsageOrg node connected to the customer profile. |
curl --location --request POST "${API_BASE}/1.0/payment/customerProfiles/new" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--data-raw '{
"address": {
"firstName": "John",
"lastName": "Doe",
"company": "",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"phoneNumber": "000-000-0000",
"faxNumber": "",
"email": "email@emails.com"
},
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2023-11",
"cardCode" : "123"
}
}'
Response
{
"message": "Account successfully created",
"status": "OK"
}
Graph schema
Add a Payment Profile to an existing Customer Profile
Add a paymentProfile
to an existing customerProfile
.
Base URL: http://localhost/1.0/payment/customerProfiles/{{OrgName/OrgGrn/UsageOrgGrn}}/paymentProfiles
Method: POST
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
curl --location --request POST "${API_BASE}/1.0/payment/customerProfiles/grn:gg:usageorg:9nulJFFNhdkDf2L1BXbtgOBOjOUPIPuYyFGbNrgn8pQZ/paymentProfiles" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--data-raw '{
"address": {
"firstName": "Jane",
"lastName": "Doe",
"company": "",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"phoneNumber": "000-000-0000",
"faxNumber": ""
},
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2023-11",
"cardCode" : "123"
}
}'
Response
{
"message": "Success",
"status": "OK"
}
Graph schema
Update Customer Profile
Update information on a customerProfile
.
Base URL: http://localhost/1.0/payment/customerProfiles/{{OrgName/OrgGrn/UsageOrgGrn}}
Method: PUT
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
curl --location --request PUT "${API_BASE}/1.0/payment/customerProfiles/myOrg" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--data-raw '{
"email" : "HELLOWORLD@mail.com",
"address": "321 Ave"
}'
Response
{
"message": "Account successfully updated",
"status": "OK"
}
Get customer and payment profile
Retrieve data on a customer profile and its payment profiles.
Base URL: http://localhost/1.0/payment/customerProfiles/{{OrgName/OrgGrn/UsageOrgGrn}}
Method: GET
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
curl --location --request GET "${API_BASE}/1.0/payment/customerProfiles/MyOrg" \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Response
{
"orgName": "MyOrg-OPi1eWLzcZLa",
"email": "HELLOWORLD@mail.com",
"paymentProfiles": [
{
"cardNumber": "XXXX1111",
"paymentProfileId": "511830354",
"address": {
"firstName": "Jane",
"lastName": "Doe",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"company": null,
"email": null,
"phoneNumber": "000-000-0000"
},
"email": null,
"expirationDate": "XXXX",
"cardType": "Visa",
"firstName": "Jane",
"lastName": "Doe",
"primary": false
},
{
"cardNumber": "XXXX1111",
"paymentProfileId": "511830233",
"address": {
"firstName": "John",
"lastName": "Doe",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"company": null,
"email": null,
"phoneNumber": "000-000-0000"
},
"email": null,
"expirationDate": "XXXX",
"cardType": "Visa",
"firstName": "John",
"lastName": "Doe",
"primary": true
}
]
}
Update Payment Profile
Update information for a payment profile.
Base URL: http://localhost/1.0/payment/customerProfiles/{{OrgName/OrgGrn/UsageOrgGrn}}/{{paymentProfileId}}
Method: PUT
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
paymentProfileId | The numeric identification assigned to the payment profile. |
curl --location --request PUT "${API_BASE}/1.0/payment/customerProfiles/MyOrg/paymentProfiles/511830233" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--data-raw '{
"address": {
"firstName": "John",
"lastName": "Doe",
"company": "GraphGrid",
"streetAddress": "1234 Sesame St.",
"city": "BK",
"state": "NY",
"zip": "90210",
"country": "USA",
"phoneNumber": "123-123-1234",
"faxNumber": ""
},
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "2023-11",
"cardCode" : "123"
}
}'
Response
{
"message": "Account successfully updated",
"status": "OK"
}
Email
Create Email for Org
Create an email for an organization(Org
).
Base URL: http://localhost/1.0/payment/email/{{OrgGrn/OrgName/usageOrgGrn}}
Method: POST
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
curl --location --request POST "${API_BASE}/1.0/payment/email/grn:gg:org:Aiz7nuXfdcgoetQ1EWmcOAUXmYU7RIt4vQlikY2ToKp5" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "my-emails@mail.com",
"emailRoles": [{
"name": "payment"
}],
"name": "test"
}'
Response
{
"emails": [
{
"id": 508,
"labels": [],
"enver": 0,
"createdAt": "2022-09-01T15:42:27.16Z",
"updatedAt": "2022-09-01T15:42:27.16Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"name": "my-emails@mail.com",
"usageOrgNode": {
"id": 522,
"labels": [],
"enver": 0,
"createdAt": "2022-09-01T15:42:27.183Z",
"updatedAt": "2022-09-01T15:42:27.183Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:usageorg:PCysblr21JkJtRF0sElMkFbOmJkzQw42DVo4IDi8PkLF",
"name": "default",
"accountId": "656708663687",
"excludeDefault": false,
"invoiceRateType": "fixed_rates",
"userNode": null,
"customerProfileNode": null,
"invoiceConfig": null,
"grnType": "usageorg",
"label": "UsageOrg"
},
"emailRoles": [
{
"id": 604,
"labels": ["Resource"],
"name": "payment",
"label": "EmailRole"
}
],
"label": "Email"
}
]
}
Graph schema
Update Email
Update an organization's (Org
) email.
Base URL: http://localhost/1.0/payment/email/{{OrgGrn/OrgName/usageOrgGrn}}/{{currentOrgEmail}}
Method: PUT
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
currentOrgEmail | The current email address of the organization to be updated. |
curl --location --request PUT "${API_BASE}/1.0/payment/email/grn:gg:usageorg:QnG4NIvON81tbXgF9IWqGQ3lzAvMtqI9SR2lUflmhvEq/my-emails@mail.com" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "my-new-email@mail.com",
"emailRoles": [{
"name": "payment"
}],
"name": "test"
}
Response
{
"emails": [
{
"id": 56,
"labels": ["GraphGridResource", "Resource"],
"enver": 0,
"createdAt": "2022-10-04T18:32:29.203Z",
"updatedAt": "2022-10-04T18:32:29.203Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"name": "my-new-email@mail.com",
"usageOrgNode": null,
"emailRoles": [
{
"id": 34,
"labels": ["GraphGridResource", "Resource"],
"name": "payment",
"label": "EmailRole"
}
],
"label": "Email"
}
]
}
Delete Email
Delete an organization's (Org
) email.
Base URL: http://localhost/1.0/payment/email/{{OrgGrn/OrgName/usageOrgGrn}}/{{currentOrgEmail}}
Method: DELETE
Parameter | Description |
---|---|
Parameter | Description |
--- | --- |
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
currentOrgEmail | The current email address of the organization to be deleted. |
curl --location --request DELETE "${API_BASE}/1.0/payment/email/grn:gg:org:jvaPm1O4dpmBKjfH2keCQnIAJBmRrzQUn4bewEYSyBqY/my-new-email@mail.com" \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Response
200 OK
Invoices
Create Invoice
Create an invoice for an organization (Org
).
Base URL: http://localhost/1.0/payment/email/{{OrgGrn/OrgName/usageOrgGrn}}/invoices
Method: POST
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
currentOrgEmail | The current email address of the organization to be updated. |
curl --location --request POST "${API_BASE}/1.0/payment/invoice/default/invoices" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 20.00,
"invoiceType": "in-person",
"billDate": "10/04/2022"
}'
Response
{
"orgInvoiceDetails": [
{
"invoice": {
"id": 84,
"labels": [],
"enver": 0,
"createdAt": "2022-10-04T18:59:46.181Z",
"updatedAt": "2022-10-04T18:59:46.181Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN",
"invoiceId": null,
"fileName": null,
"approvedBy": null,
"state": "WAITING_FOR_PAYMENT",
"invoiceType": "in-person",
"amount": 20.0,
"date": "10/04/2022",
"dueDate": null,
"netPay": null,
"remainingAmount": 20.0,
"decimalPrecision": null,
"usageOrgNode": {
"id": 86,
"labels": ["GraphGridResource"],
"enver": 0,
"createdAt": "2022-10-04T17:12:44.106Z",
"updatedAt": "2022-10-04T17:12:44.106Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:usageorg:kGZT6ut4vfujeDfGupEQ5JvIEOQyBma6hNc8MtmzqZPX",
"name": "default",
"accountId": "540329263687",
"excludeDefault": false,
"invoiceRateType": "fixed_rates",
"userNode": null,
"customerProfileNode": null,
"invoiceConfig": null,
"grnType": "usageorg",
"label": "UsageOrg"
},
"invoiceNode": null,
"monthNode": null,
"grnType": "orginvoice",
"label": "OrgInvoice"
},
"paymentProfile": null,
"invoiceTransactions": null
}
],
"chargeCard": null,
"userGrnToBeCharged": null
}
Graph schema
Get payment history / Invoice details
Base URL: http://localhost/1.0/payment/email/{{OrgGrn/OrgName/usageOrgGrn}}/invoices/{{invoiceGrn}}
Method: GET
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
invoiceGrn | The grn of the invoice to retrieve data for. |
curl --location --request GET "${API_BASE}/1.0/payment/invoice/grn:gg:usageorg:kGZT6ut4vfujeDfGupEQ5JvIEOQyBma6hNc8MtmzqZPX/invoices/grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN" \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Response
{
"invoice": {
"id": 84,
"labels": ["GraphGridResource"],
"enver": 0,
"createdAt": "2022-10-04T18:59:46.181Z",
"updatedAt": "2022-10-04T18:59:46.181Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN",
"invoiceId": null,
"fileName": null,
"approvedBy": null,
"state": "WAITING_FOR_PAYMENT",
"invoiceType": "in-person",
"amount": 20.0,
"date": "value",
"dueDate": null,
"netPay": null,
"remainingAmount": 20.0,
"decimalPrecision": null,
"usageOrgNode": {
"id": 86,
"labels": ["GraphGridResource"],
"enver": 0,
"createdAt": "2022-10-04T17:12:44.106Z",
"updatedAt": "2022-10-04T17:12:44.106Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:usageorg:kGZT6ut4vfujeDfGupEQ5JvIEOQyBma6hNc8MtmzqZPX",
"name": "default",
"accountId": "540329263687",
"excludeDefault": false,
"invoiceRateType": "fixed_rates",
"userNode": null,
"customerProfileNode": null,
"invoiceConfig": null,
"grnType": "usageorg",
"label": "UsageOrg"
},
"invoiceNode": null,
"monthNode": null,
"grnType": "orginvoice",
"label": "OrgInvoice"
},
"paymentProfile": null,
"invoiceTransactions": null
}
Make Payment
Make a payment on an invoice.
Base URL: http://localhost/1.0/payment/invoice/{{OrgGrn/OrgName/usageOrgGrn}}/invoices/{{invoiceGrn}}/pay
Method: GET
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
invoiceGrn | The grn of the invoice to retrieve data for. |
curl --location --request POST "${API_BASE}/1.0/payment/invoice/grn:gg:usageorg:kGZT6ut4vfujeDfGupEQ5JvIEOQyBma6hNc8MtmzqZPX/invoices/grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN/pay" \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 10.0,
"invoiceGrn": "grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN",
"customerProfileId": "507398890",
"customerPaymentProfileId": "511829792"
}
'
Response
{
"message": "Transaction successful :status is success",
"success": true,
"verificationCode": "40103831522"
}
Graph schema
Get all invoice details for an organization
Get all invoices and transactions for an organization
Base URL: http://localhost/1.0/payment/invoice/{{OrgGrn/OrgName/usageOrgGrn}}
Method: GET
Parameter | Description |
---|---|
OrgName | The name of the organization(Org ) node. |
OrgGrn | The grn of the UseageOrg node. |
UsageOrgGrn | The grn of the UseageOrg node. |
curl --location --request GET "${API_BASE}/1.0/payment/invoice/default" \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Response
{
"orgInvoiceDetails": [
{
"invoice": {
"id": 84,
"labels": [
"GraphGridResource"
],
"enver": 0,
"createdAt": "2022-10-04T18:59:46.181Z",
"updatedAt": "2022-10-04T19:13:17.729Z",
"createdBy": "graphgrid",
"lastModifiedBy": "graphgrid",
"grn": "grn:gg:orginvoice:rWKcgiQj0oVlVnfZSTly3dj1xAFhvz1cqUMKHRCSs9QN",
"invoiceId": null,
"fileName": null,
"approvedBy": null,
"state": "WAITING_FOR_PAYMENT",
"invoiceType": "in-person",
"amount": 20.0,
"date": "value",
"dueDate": null,
"netPay": null,
"remainingAmount": 10.0,
"decimalPrecision": null,
"usageOrgNode": null,
"invoiceNode": null,
"monthNode": null,
"grnType": "orginvoice",
"label": "OrgInvoice"
},
"paymentProfile": {
"cardNumber": "XXXX1111",
"paymentProfileId": "511829792",
"address": {
"firstName": "John",
"lastName": "Doe",
"streetAddress": "123 Main St.",
"city": "Bellevue",
"state": "WA",
"zip": "98004",
"country": "USA",
"company": null,
"email": null,
"phoneNumber": "000-000-0000"
},
"email": null,
"expirationDate": "XXXX",
"cardType": "Visa",
"firstName": "John",
"lastName": "Doe",
"primary": true
},
"invoiceTransactions": [
{
"id": 85,
"labels": [
"GraphGridResource"
],
"enver": 0,
"createdAt": "2022-10-04T19:13:17.729Z",
"updatedAt": "2022-10-04T19:13:17.729Z",