This document has details about the different endpoints that Scheme Adapter exposes:
POST
Create Invoice NotificationGET
Get InvoicePOST
Create QuotePOST
Submit PaymentGET
Get ilp addressGET
Health check
The different endpoints often deal with these data structures:
Information about various errors returned can be found here:
This endpoint allows a merchant to post invoice notifications to the payer.
POST http://host:8088/scheme/adapter/v1/invoices
Field | Type | Description |
---|---|---|
Content-Type | String | Must be set to application/json |
POST http://host:8088/scheme/adapter/v1/invoices HTTP/1.1
Content-Type: application/json
{
"invoiceId": "3",
"submissionUrl": "receiver-dfsp-host:8088/scheme/adapter/v1",
"senderIdentifier": "78956562",
"memo": "Invoice from merchant for 100 USD"
}
HTTP/1.1 201 CREATED
Field | Description |
---|
This endpoint allows retrieval of the invoice based on ID. Query Parameter invoiceUrl indicates the location of invoice on the merchant side.
GET http://host:8088/scheme/adapter/v1/invoices?invoiceUrl=http://merchant-dfsp-host:8088/scheme/adapter/v1/invoices/123
This endpoint allows a DFSP to request for a quote.
POST http://scheme-adapter/quotes
Field | Type | Description |
---|---|---|
Content-Type | String | Must be set to application/json |
Name | Type | Description |
---|---|---|
paymentId | UUID | Unique Identifier |
payer | Object | Person initiating the quote |
payer.identifier | String | Payer Id |
payer.identifierType | String | Central Directory Registry Type |
payer.url | URL | Base URL at which the payer information can be retrieved from |
payer.account | String | Payer Ledger Account |
payee | Object | Person for whom the quote is being requested for |
payee.identifier | String | Payee Id |
payee.identifierType | String | Central Directory Registry Type |
payee.url | URL | Base URL at which the payee information can be retrieved from |
payee.account | String | Payee Ledger Account |
amountType | String | Should be either "SEND" or "RECEIVE" |
amount | Object | Amount Object |
amount.amount | number | Amount |
amount.currency | String | defaulted to "USD" |
fees | Object | Payer Fees Object |
fees.amount | number | Amount |
fees.currency | String | defaulted to "USD" |
transferType | String | defaulted to "p2p" |
Name | Type | Description |
---|---|---|
paymentId | UUID | Unique Identifier |
receiveAmount | Object | Amount Object |
receiveAmount.amount | number | Amount |
receiveAmount.currency | String | defaulted to "USD" |
payeeFee | Object | Payee Fees Object |
payeeFee.amount | number | Amount |
payeeFee.currency | String | defaulted to "USD" |
payeeCommission | Object | Payee Commission Object |
payeeCommission.amount | number | Amount |
payeeCommission.currency | String | defaulted to "USD" |
connectorAccount | String | Ledger account URI of the connector through which this payment can be sent. |
ipr | String | Interledger Payment Request |
sourceExpiryDuration | number | Number of seconds after the payment is submitted that the outgoing transfer will expire. |
POST http://scheme-adapter-host:8088/scheme/adapter/v1/quotes HTTP/1.1
Content-Type: application/json
{
"paymentId": "110ec58a-a0f2-4ac4-8393-c866d813b8d1",
"payer": {
"identifier": "92806391",
"identifierType": "eur"
},
"payee": {
"identifier": "30754016",
"identifierType": "eur",
"url": "ec2-34-194-186-111.compute-1.amazonaws.com:8088/scheme/adapter/v1",
"account": "http://ec2-34-194-186-111.compute-1.amazonaws.com:8088/ilp/ledger/v1/accounts/alice"
},
"transferType": "p2p",
"amountType": "SEND",
"amount": {
"amount": "10",
"currency": "USD"
},
"fees": {
"amount": "0.25",
"currency": "USD"
}
}
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"paymentId": "110ec58a-a0f2-4ac4-8393-c866d813b8d1",
"receiveAmount": {
"amount": "9.25",
"currency": "USD"
},
"payeeFee": {
"amount": "1",
"currency": "USD"
},
"payeeCommission": {
"amount": "1",
"currency": "USD"
},
"connectorAccount":"http://host:port/scheme/adapter/v1/ilp/ledger/v1/accounts/connector-account",
"ipr": "c29tZSBpcHIgaGVyZQ==",
"sourceExpiryDuration": "10"
}
This endpoint is used to submit p2p and invoice payments. This is a pass through of the underlying ilp-service /payIPR endpoint
POST http://scheme-adapter/payment
Name | Type | Description |
---|---|---|
paymentId | UUID | Unique Identifier |
ipr | String | Interledger payment request. This value is returned as part of quote call |
sourceAmount | number | Amount that the sender will send. Depending on amount type of SEND/RECEIVE this value is calculated as part of quote |
sourceAccount | URI | Ledger account URI to send the transfer from. |
connectorAccount | URI | Ledger account URI of the connector through which this payment will be sent. |
sourceExpiryDuration | Integer | Number of seconds after the payment is submitted that the outgoing transfer will expire. |
Field | Type | Description |
---|---|---|
paymentId | UUID | Unique Identifier |
connectorAccount | URI | Ledger account URI of the connector through which this payment will be sent. |
status | string | executed, rejected, expired |
rejectionMessage | JSON Object | Only present when status is rejected. |
fulfillment | Base64-URL String | Only present when status is executed |
POST http://scheme-adapter-host:8088/scheme/adapter/v1/payment HTTP/1.1
Content-Type: application/json
{
"paymentId": "110ec58a-a0f2-4ac4-8393-c866d813b8d1",
"ipr":"",
"sourceAmount":"10",
"sourceAccount":"",
"connectorAccount":"",
"sourceExpiryDuration":"10"
}
HTTP/1.1 201 CREATED
Content-Type: application/json
{
}
Field | Description |
---|---|
NotFoundError | The requested payment could not be found. |
{
"id": "NotFoundError",
"message": "The requested resource could not be found."
}
Get the current status of the service
GET http://scheme-adapter/health
Field | Type | Description |
---|---|---|
status | String | The status of the service, OK if the service is working |
GET http://scheme-adapter/health HTTP/1.1
HTTP/1.1 200 OK
{
"status": "OK"
}
A resource represents the information returned about an identifier and identifier type.
A resource object can have the following fields:
Name | Type | Description |
---|---|---|
invoiceId | string | Invoice ID |
senderIdentifier | String | Sender ID |
submissionUrl | URL | URL of the receiver that is receiving the invoice |
invoiceUrl | URL | (optional)URL of the receiver(payer) |
memo | String | Information placeholder |
account | String | ledger account |
currencyCode | String | defaulted to "$" |
currencySymbol | String | defaulted to "USD" |
name | String | sender name |
userNumber | String | User Number |
amount | String | amount |
status | String | enum "paid, unpaid, cancelled " |
invoiceInfo | String | additional information about the invoice |
Represents a DFSP that has registered with the central directory.
Some fields are Read-only, meaning they are set by the API and cannot be modified by clients. A DFSP object can have the following fields:
Name | Type | Description |
---|---|---|
paymentId | UUID | Unique Identifier |
payer | Object | Person initiating the quote |
payer.identifier | String | Payer Id |
payer.identifierType | String | Central Directory Registry Type |
payer.url | URL | Base URL at which the payer information can be retrieved from |
payer.account | String | Payer Ledger Account |
payee | Object | Person for whom the quote is being requested for |
payee.identifier | String | Payee Id |
payee.identifierType | String | Central Directory Registry Type |
payee.url | URL | Base URL at which the payee information can be retrieved from |
payee.account | String | Payee Ledger Account |
amountType | String | Should be either "SEND" or "RECEIVE" |
amount | Object | Amount Object |
amount.amount | number | Amount |
amount.currency | String | defaulted to "USD" |
fees | Object | Payer Fees Object |
fees.amount | number | Amount |
fees.currency | String | defaulted to "USD" |
transferType | String | defaulted to "p2p" |
Data structure that represents the payment in p2p transactions. This object is a mere representation of the Payment object used by ilp-service in /payIPR.
Name | Type | Description |
---|---|---|
ipr | String | Interledger payment request. This value is returned as part of quote call |
sourceAmount | number | Amount that the sender will send. Depending on amount type of SEND/RECEIVE this value is calculated as part of quote |
sourceAccount | URI | Ledger account URI to send the transfer from. |
connectorAccount | URI | Ledger account URI of the connector through which this payment will be sent. |
sourceExpiryDuration | Integer | Number of seconds after the payment is submitted that the outgoing transfer will expire. |
This section identifies the potential errors returned and the structure of the response.