Get a payment request
client.PaymentRequests.Get(ctx, paymentRequestID) (*PaymentRequest, error)
GET/v3/payment_requests/{paymentRequestId}
Get a payment request
package main
import (
"context"
"fmt"
"github.com/linq-team/linq-go"
"github.com/linq-team/linq-go/option"
)
func main() {
client := linqgo.NewClient(
option.WithAPIKey("My API Key"),
)
paymentRequest, err := client.PaymentRequests.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", paymentRequest.ID)
}
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"amount": 497,
"checkout_url": "https://zero.linqapp.com/pay/tomo?session=tok_abc123",
"created_at": "2019-12-27T18:11:19.117Z",
"currency": "usd",
"mode": "payment",
"object": "payment_request",
"status": "requested",
"description": "description",
"expires_at": "2019-12-27T18:11:19.117Z",
"interval": "day",
"interval_count": 0,
"metadata": {
"foo": "string"
},
"natural": {
"payment_request_id": "payment_request_id",
"transaction_id": "transaction_id"
},
"paid_at": "2019-12-27T18:11:19.117Z",
"price_id": "price_id",
"quantity": 0,
"rail": "stripe",
"stripe": {
"customer_id": "cus_QAbCdEfGhIjKlMn",
"payment_intent_id": "pi_3QAbCdEfGhIjKlMn",
"subscription_id": "sub_1QAbCdEfGhIjKlMn"
},
"trial_end": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
},
"success": false
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"amount": 497,
"checkout_url": "https://zero.linqapp.com/pay/tomo?session=tok_abc123",
"created_at": "2019-12-27T18:11:19.117Z",
"currency": "usd",
"mode": "payment",
"object": "payment_request",
"status": "requested",
"description": "description",
"expires_at": "2019-12-27T18:11:19.117Z",
"interval": "day",
"interval_count": 0,
"metadata": {
"foo": "string"
},
"natural": {
"payment_request_id": "payment_request_id",
"transaction_id": "transaction_id"
},
"paid_at": "2019-12-27T18:11:19.117Z",
"price_id": "price_id",
"quantity": 0,
"rail": "stripe",
"stripe": {
"customer_id": "cus_QAbCdEfGhIjKlMn",
"payment_intent_id": "pi_3QAbCdEfGhIjKlMn",
"subscription_id": "sub_1QAbCdEfGhIjKlMn"
},
"trial_end": "2019-12-27T18:11:19.117Z",
"updated_at": "2019-12-27T18:11:19.117Z"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found",
"doc_url": "https://docs.linqapp.com/error/codes/2xxx/2001/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/error/codes/3xxx/3006/"
},
"success": false
}