Get payment by cartId - Fabric
Get payment by cartId
cURL
curl --request GET \
--url https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}
import requests
url = "https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}"
response = requests.get(url)
print(response.text)
const options = {method: 'GET'};
fetch('https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [\
CURLOPT_URL => "https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}",\
CURLOPT_RETURNTRANSFER => true,\
CURLOPT_ENCODING => "",\
CURLOPT_MAXREDIRS => 10,\
CURLOPT_TIMEOUT => 30,\
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
CURLOPT_CUSTOMREQUEST => "GET",\
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment/{cartId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
Response Codes
- 200
- 400
- 403
- 404
- 500
Example Response
{
"query": {
"limit": 10,
"offset": 0,
"count": 1
},
"payments": [\
{\
"billToAddress": {\
"name": {\
"first": "John",\
"last": "Smith"\
},\
"email": "user1@gmail.com",\
"phone": {\
"number": "3334445555",\
"kind": "Mobile"\
},\
"street1": "1000 main street",\
"city": "Seattle",\
"state": "WA",\
"country": "US",\
"zipCode": "98101",\
"street2": "1000 main street"\
},\
"_id": "5fee9d59f2f08a1b3cbdea08",\
"createdAt": "2020-12-31T02:09:53.914Z",\
"updatedAt": "2020-12-31T02:09:53.914Z",\
"paymentDetails": {\
"transactionDetails": {\
"paymentType": "CARD_STRIPE",\
"paymentToken": "pi_1IyMGc2YBvYaVyBQNkOiCE3E"\
},\
"paymentStatus": {\
"cardHolderFullName": "First Last",\
"paymentMethod": "visa",\
"last4": "4242",\
"amountCapturable": 99900,\
"status": "succeeded"\
},\
"amount": 999,\
"currency": "USD"\
},\
"version": 0,\
"cartId": "60b90dd7308ded0008ee3c5d",\
"isValid": true,\
"__v": 0\
}\
]
}
Error Responses
{
"code": "<string>",
"message": "<string>"
}
{
"message": "Forbidden"
}
{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}
Parameters
Headers
- x-api-key: string
Example:
"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"
Path Parameters
- cartId: string (required) - Cart ID
Response
- 200: application/json - Payment for cartId
Attributes
- query: object
- payments: object[]